Mindspore
MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
Install / Use
/learn @mindspore-ai/MindsporeREADME

- What Is MindSpore
- Installation
- Quickstart
- Docs
- Community
- Contributing
- Maintenance phases
- Maintenance status
- Release Notes
- License
What Is MindSpore
MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. MindSpore is designed to provide development experience with friendly design and efficient execution for the data scientists and algorithmic engineers, native support for Ascend AI processor, and software hardware co-optimization. At the meantime MindSpore as a global AI open source community, aims to further advance the development and enrichment of the AI software/hardware application ecosystem.
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/MindSpore-architecture.png" alt="MindSpore Architecture"/>For more details please check out our Architecture Guide.
Automatic Differentiation
Currently, there are two automatic differentiation techniques in mainstream deep learning frameworks:
- Operator Overloading (OO): Overloading the basic operators of the programming language to encapsulate their gradient rules. Record the operation trajectory of the network during forward execution in an operator overloaded manner, then apply the chain rule to the dynamically generated data flow graph to implement automatic differentiation.
- Source Transformation (ST): This technology is evolving from the functional programming framework and performs automatic differential transformation on the intermediate expression (the expression form of the program during the compilation process) in the form of just-in-time compilation (JIT), supporting complex control flow scenarios, higher-order functions and closures.
PyTorch used OO. Compared to ST, OO generates gradient graph in runtime, so it does not need to take function call and control flow into consideration, which makes it easier to develop. However, OO can not perform gradient graph optimization in compilation time and the control flow has to be unfolded in runtime, so it is difficult to achieve extreme optimization in performance.
MindSpore implemented automatic differentiation based on ST. On the one hand, it supports automatic differentiation of automatic control flow, so it is quite convenient to build models like PyTorch. On the other hand, MindSpore can perform static compilation optimization on neural networks to achieve great performance.
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/Automatic-differentiation.png" alt="Automatic Differentiation" width="600"/>The implementation of MindSpore automatic differentiation can be understood as the symbolic differentiation of the program itself. Because MindSpore IR is a functional intermediate expression, it has an intuitive correspondence with the composite function in basic algebra. The derivation formula of the composite function composed of arbitrary basic functions can be derived. Each primitive operation in MindSpore IR can correspond to the basic functions in basic algebra, which can build more complex flow control.
Automatic Parallel
The goal of MindSpore automatic parallel is to build a training method that combines data parallelism, model parallelism, and hybrid parallelism. It can automatically select a least cost model splitting strategy to achieve automatic distributed parallel training.
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/Automatic-parallel.png" alt="Automatic Parallel" width="600"/>At present, MindSpore uses a fine-grained parallel strategy of splitting operators, that is, each operator in the figure is split into a cluster to complete parallel operations. The splitting strategy during this period may be very complicated, but as a developer advocating Pythonic, you don't need to care about the underlying implementation, as long as the top-level API compute is efficient.
Installation
Pip mode method installation
MindSpore offers build options across multiple backends:
| Hardware Platform | Operating System | Status | | :---------------- | :--------------- | :----- | | Ascend910 | Ubuntu-x86 | ✔️ | | | Ubuntu-aarch64 | ✔️ | | | EulerOS-aarch64 | ✔️ | | | CentOS-x86 | ✔️ | | | CentOS-aarch64 | ✔️ | | GPU CUDA 10.1 | Ubuntu-x86 | ✔️ | | CPU | Ubuntu-x86 | ✔️ | | | Ubuntu-aarch64 | ✔️ | | | Windows-x86 | ✔️ |
For installation using pip, take CPU and Ubuntu-x86 build version as an example:
-
Download whl from MindSpore download page, and install the package.
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0-rc1/MindSpore/cpu/ubuntu_x86/mindspore-1.2.0rc1-cp37-cp37m-linux_x86_64.whl -
Run the following command to verify the install.
import numpy as np import mindspore.context as context import mindspore.nn as nn from mindspore import Tensor from mindspore.ops import operations as P context.set_context(mode=context.GRAPH_MODE, device_target="CPU") class Mul(nn.Cell): def __init__(self): super(Mul, self).__init__() self.mul = P.Mul() def construct(self, x, y): return self.mul(x, y) x = Tensor(np.array([1.0, 2.0, 3.0]).astype(np.float32)) y = Tensor(np.array([4.0, 5.0, 6.0]).astype(np.float32)) mul = Mul() print(mul(x, y))[ 4. 10. 18.]
Use pip mode method to install MindSpore in different environments. Refer to the following documents.
- Using pip mode method to install MindSpore in Ascend environment
- Using pip mode method to install MindSpore in GPU environment
- Using pip mode method to install MindSpore in CPU environment
Source code compilation installation
Use the source code compilation method to install MindSpore in different environments. Refer to the following documents.
- Using the source code compilation method to install MindSpore in Ascend environment
- Using the source code compilation method to install MindSpore in GPU environment
- Using the source code compilation method to install MindSpore in CPU environment
Docker Image
MindSpore docker image is hosted on Docker Hub, currently the containerized build options are supported as follows:
| Hardware Platform | Docker Image Repository | Tag | Description |
| :---------------- | :---------------------- | :-- | :---------- |
| CPU | mindspore/mindspore-cpu | x.y.z | Production environment with pre-installed MindSpore x.y.z CPU release. |
| | | devel | Development environment provided to build MindSpore (with CPU backend) from the source, refer to https://www.mindspore.cn/install/en for installation details. |
| | | runtime | Runtime environment provided to install MindSpore binary package with CPU backend. |
| GPU | mindspore/mindspore-gpu | x.y.z | Production environment with pre-installed MindSpore x.y.z GPU release. |
| | | devel | Development environment provided to build MindSpore (with GPU CUDA10.1 backend) from the source, refer to https://www.mindspore.cn/install/en for installation details. |
| | | runtime | Runtime environment provided to install MindSpore binary package with GPU CUDA10.1 backend. |
NOTICE: For GPU
develdocker image, it's NOT suggested to directly install the whl package after building from the source, instead we strongly RECOMMEND you transfer and install the whl package inside GPUruntimedocker image.
-
CPU
For
CPUbackend, you can directly pull and run the latest stable image using the below command:docker pull mindspore/mindspore-cpu:1.1.0 docker run -it mindspore/mindspore-cpu:1.1.0 /b
Related Skills
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
isf-agent
a repo for an agent that helps researchers apply for isf funding
last30days-skill
17.2kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
