MindSpore
Last reviewed
Jun 3, 2026
Sources
11 citations
Review status
Source-backed
Revision
v1 · 1,728 words
Improve this article
Add missing citations, update stale details, or suggest a clearer explanation.
Last reviewed
Jun 3, 2026
Sources
11 citations
Review status
Source-backed
Revision
v1 · 1,728 words
Add missing citations, update stale details, or suggest a clearer explanation.
MindSpore is an open-source deep learning framework developed by Huawei. It was announced and made open source on 28 March 2020 at the Huawei Developer Conference (HDC.Cloud), positioned as an "all-scenario" framework meant to run across device, edge, and cloud with a single programming model [1][2]. MindSpore provides first-class support for Huawei's Ascend AI processors and also runs on CPU and GPU backends [3]. Its design centers on three capabilities that Huawei emphasized from the start: source-to-source automatic differentiation, automatic parallelism for large-scale distributed training, and a unified execution model that mixes dynamic and static computational graphs [3][4]. The framework is released under the Apache License 2.0 and is the framework used to train Huawei's PanGu large language models [3][5].
Huawei first showed MindSpore publicly in August 2019, when it presented the framework alongside the Ascend 910 training chip and the Ascend 310 inference chip as part of its full-stack AI strategy [2]. The open-source release followed on 28 March 2020. The announcement was made by Professor Chen Lei, a chief scientist on the MindSpore team, who described it as China's first all-scenario AI computing framework [1][2]. The code was published on the Chinese hosting platform Gitee, with a mirror on GitHub [1]. Huawei stated that MindSpore had been developed together with external collaborators including Imperial College London, Peking University, and the University of Edinburgh [1].
The same launch introduced two companion tools that ship alongside the core framework: MindInsight, a debugging and visualization tool for inspecting the training process, and MindArmour, a module for adversarial robustness and model security testing [1].
The first publicly available package was version 0.1.0, uploaded on 28 March 2020 [6]. The project moved quickly through its 0.x and 1.x series before reaching a 2.0 milestone in 2023, after which development continued on a roughly biannual cadence.
| Version | Release date | Notes |
|---|---|---|
| 0.1.0 | 28 March 2020 | First open-source release [6] |
| 1.0.0 | 24 September 2020 | First stable 1.x line [6] |
| 1.1.0 | 31 December 2020 | On-device training, expanded operators [6] |
| 1.2.0 | 15 April 2021 | Support for very large model training [6] |
| 1.5.0 | 15 October 2021 | N/A [6] |
| 1.7.0 | 29 April 2022 | Version used to train CodeGeeX [6][7] |
| 2.0.0 | 16 June 2023 | Functional and dynamic-graph improvements [6][8] |
| 2.6.0 | 10 June 2025 | Foundation-model training and inference focus [6] |
| 2.9.0 | 8 May 2026 | Recent release on PyPI [6] |
MindSpore is written mainly in C++ and Python, with additional language components, and exposes a Python API for building models [4]. Its architecture is usually described in layers. At the top is a model and suite layer that bundles ready-made models and development kits such as MindSpore Transformers and scientific-computing libraries. Below that is the Python expression layer (the user-facing API for defining networks, control flow, and custom operators in native Python). Underneath sits the framework core: tensor data structures, operators, the automatic-differentiation engine, the parallel-computing modules, and the compiler and runtime [4].
A central element is MindIR, MindSpore's intermediate representation. User code is parsed into this functional IR, which the compiler (sometimes referred to as MindCompiler) then optimizes. The IR is the substrate for hardware-independent passes such as automatic differentiation and for hardware-related passes such as automatic parallelism and operator fusion [3][4]. Because MindIR is a functional representation, it has a direct correspondence to the composition of mathematical functions, which is what makes the source-to-source differentiation approach tractable [3].
MindSpore supports two execution modes. PyNative mode runs operations eagerly, op by op, which is convenient for debugging and matches the imperative style familiar from other frameworks. Graph mode (GRAPH_MODE) compiles the network into a static graph for whole-graph optimization and better performance, particularly on Ascend hardware. The framework converts Python source into graphs via abstract-syntax-tree analysis, so the same code can run in either mode and developers can switch between them [3][4].
MindSpore's automatic differentiation uses source transformation rather than operator overloading. The framework parses the Python function or Cell object to be differentiated, builds a differentiable function object in MindIR, and derives gradients by following the call chain [3]. Huawei has described this as performing the symbolic differentiation of the program itself, which lets it differentiate through native Python control flow such as if, while, and for constructs while still allowing static compilation and optimization [3][2].
Automatic parallelism is one of MindSpore's most distinctive features. The aim is to let a user write what looks like serial, single-device code and have the framework distribute it across many accelerators [2][3]. MindSpore supports several parallel strategies that can be combined: data parallelism, operator-level model parallelism, pipeline parallelism, and optimizer parallelism [4]. It uses a fine-grained approach that can split individual operators across devices. A key mechanism here is tensor redistribution, which automatically inserts the operations needed to convert the device layout of a tensor produced by one operator into the layout expected by the next, so that mixed strategies can be expressed uniformly [4]. In its automatic mode, MindSpore can search for a low-cost partitioning strategy rather than requiring the user to specify the sharding by hand [3].
MindSpore is the software half of Huawei's AI stack and is co-designed with the Ascend processors and the CANN (Compute Architecture for Neural Networks) software layer that sits between the framework and the hardware [3]. Huawei has emphasized native support for Ascend, with the graph engine compiling MindSpore graphs to run efficiently on the chips [2]. Because MindSpore also targets CPU and GPU, models can be developed on commodity hardware and then deployed to Ascend, but the framework is most tightly optimized for the Ascend line, including the Ascend 910 training accelerator [3][5].
The table below summarizes the hardware backends MindSpore targets.
| Backend | Description |
|---|---|
| Ascend (NPU) | Huawei Ascend AI processors, the primary and most optimized target [3] |
| GPU | NVIDIA GPUs via CUDA [3] |
| CPU | x86 and ARM processors [3] |
Beyond the core training and inference engine, MindSpore has grown a set of suites and tools. The best known is MindSpore Transformers, also called MindFormers, a full-process development suite for pretraining, fine-tuning, evaluating, and deploying large Transformer models [9]. MindFormers builds on the framework's parallel capabilities and supports combinations of data, model, optimizer, pipeline, sequence, context, and mixture-of-experts (MoE) parallelism, and it interoperates with mainstream ecosystems such as Hugging Face, Megatron-LM, vLLM, and OpenCompass [9].
For deployment outside the data center, MindSpore Lite provides a lightweight runtime for inference and training on mobile, embedded, and edge devices, which is the part of the framework that delivers on the "device" side of the all-scenario design [3]. The launch-day companions MindInsight (debugging and visualization) and MindArmour (model security and adversarial robustness) remain part of the wider project [1]. There are also domain-specific science kits in the MindSpore family, such as MindFlow for computational fluid dynamics and MindElec for electromagnetic simulation, reflecting Huawei's interest in AI for scientific computing [8].
MindSpore occupies similar ground to PyTorch and TensorFlow, but its distinguishing choices follow from Huawei's hardware strategy. Where TensorFlow 1.x was built around static graphs and PyTorch around eager (dynamic) execution, MindSpore tries to unify both modes behind one Python API so that the same model definition can run eagerly for debugging or be compiled to a static graph for performance [2][4]. Its source-to-source automatic differentiation contrasts with the tape-based, operator-overloading autograd used by PyTorch, and it is intended to differentiate through Python control flow while preserving opportunities for static optimization [3]. The automatic-parallelism system, which can shard a model across many devices from serial-looking code, is positioned as an answer to the manual sharding work that large-model training otherwise requires [3]. In practice MindSpore's clearest advantage is on Huawei's own Ascend processors, for which it is the natively supported and most heavily optimized framework [2][3].
MindSpore is the training framework behind Huawei's PanGu family of large models and several other Chinese research models. PanGu-Alpha, a Chinese autoregressive language model described in a 2021 paper, was trained on a cluster of 2,048 Ascend 910 processors using MindSpore's automatic-parallelism system, which the authors combined across five parallelism dimensions [5]. The later PanGu-Sigma, a sparse model with 1.085 trillion parameters, was implemented with MindSpore (version 1.6) and trained on 512 Ascend 910 accelerators over more than 100 days, processing about 329 billion tokens [10]. CodeGeeX, a multilingual code-generation model from Tsinghua University and Zhipu AI, was trained on a cluster of 1,536 Ascend 910 processors using MindSpore version 1.7, consuming roughly 850 billion tokens over about two months [7].
Huawei has reported that the MindSpore open-source community grew to more than 170,000 developers with over 240,000 downloads, used across more than ten industries, though such figures come from Huawei itself and should be read as the company's own community numbers rather than independently audited usage [11].
MindSpore is released under the Apache License 2.0, a permissive open-source license that allows use, modification, and redistribution, including in commercial and proprietary products, subject to attribution and the license's patent and notice terms [3][4]. The source is hosted on Gitee (gitee.com/mindspore/mindspore) with a mirror on GitHub, and releases are distributed through PyPI as well [4][6].