Skip to main content

MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.

Project description

MindSpore Logo

PyPI - Python Version PyPI Downloads DockerHub LICENSE Slack PRs Welcome

查看中文

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.

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.

Automatic Differentiation

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.

Automatic Parallel

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:

  1. 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
    
  2. 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.

Source code compilation installation

Use the source code compilation method to install MindSpore in different environments. Refer to the following documents.

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 devel docker 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 GPU runtime docker image.

  • CPU

    For CPU backend, 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 /bin/bash
    
  • GPU

    For GPU backend, please make sure the nvidia-container-toolkit has been installed in advance, here are some install guidelines for Ubuntu users:

    DISTRIBUTION=$(. /etc/os-release; echo $ID$VERSION_ID)
    curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add -
    curl -s -L https://nvidia.github.io/nvidia-docker/$DISTRIBUTION/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list
    
    sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit nvidia-docker2
    sudo systemctl restart docker
    

    Then edit the file daemon.json:

    $ vim /etc/docker/daemon.json
    {
        "runtimes": {
            "nvidia": {
                "path": "nvidia-container-runtime",
                "runtimeArgs": []
            }
        }
    }
    

    Restart docker again:

    sudo systemctl daemon-reload
    sudo systemctl restart docker
    

    Then you can pull and run the latest stable image using the below command:

    docker pull mindspore/mindspore-gpu:1.1.0
    docker run -it -v /dev/shm:/dev/shm --runtime=nvidia --privileged=true mindspore/mindspore-gpu:1.1.0 /bin/bash
    

    To test if the docker image works, please execute the python code below and check the output:

    import numpy as np
    import mindspore.context as context
    from mindspore import Tensor
    from mindspore.ops import functional as F
    
    context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
    
    x = Tensor(np.ones([1,3,3,4]).astype(np.float32))
    y = Tensor(np.ones([1,3,3,4]).astype(np.float32))
    print(F.tensor_add(x, y))
    
    [[[ 2.  2.  2.  2.],
    [ 2.  2.  2.  2.],
    [ 2.  2.  2.  2.]],
    
    [[ 2.  2.  2.  2.],
    [ 2.  2.  2.  2.],
    [ 2.  2.  2.  2.]],
    
    [[ 2.  2.  2.  2.],
    [ 2.  2.  2.  2.],
    [ 2.  2.  2.  2.]]]
    

If you want to learn more about the building process of MindSpore docker images, please check out docker repo for the details.

Quickstart

See the Quick Start to implement the image classification.

Docs

More details about installation guide, tutorials and APIs, please see the User Documentation.

Community

Governance

Check out how MindSpore Open Governance works.

Communication

Contributing

Welcome contributions. See our Contributor Wiki for more details.

Maintenance phases

Project stable branches will be in one of the following states:

State Time frame Summary
Planning 1 - 3 months Features are under planning.
Development 3 months Features are under development.
Maintained 6 - 12 months All bugfixes are appropriate. Releases produced.
Unmaintained 0 - 3 months All bugfixes are appropriate. No Maintainers and No Releases produced.
End Of Life (EOL) N/A Branch no longer accepting changes.

Maintenance status

Branch Status Initial Release Date Next Phase EOL Date
r2.2 Maintained 2023-10-18 Unmaintained
2024-10-18 estimated
r2.1 Maintained 2023-07-29 Unmaintained
2024-07-29 estimated
r2.0 Maintained 2023-06-15 Unmaintained
2024-06-15 estimated
r1.10 End Of Life 2023-02-02 2024-02-02
r1.9 End Of Life 2022-10-26 2023-10-26
r1.8 End Of Life 2022-07-29 2023-07-29
r1.7 End Of Life 2022-04-29 2023-04-29
r1.6 End Of Life 2022-01-29 2023-01-29
r1.5 End Of Life 2021-10-15 2022-10-15
r1.4 End Of Life 2021-08-15 2022-08-15
r1.3 End Of Life 2021-07-15 2022-07-15
r1.2 End Of Life 2021-04-15 2022-04-29
r1.1 End Of Life 2020-12-31 2021-09-30
r1.0 End Of Life 2020-09-24 2021-07-30
r0.7 End Of Life 2020-08-31 2021-02-28
r0.6 End Of Life 2020-07-31 2020-12-30
r0.5 End Of Life 2020-06-30 2021-06-30
r0.3 End Of Life 2020-05-31 2020-09-30
r0.2 End Of Life 2020-04-30 2020-08-31
r0.1 End Of Life 2020-03-28 2020-06-30

Release Notes

The release notes, see our RELEASE.

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_11_0_arm64.whl (222.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_10_15_x86_64.whl (237.9 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_11_0_arm64.whl (221.8 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_10_15_x86_64.whl (237.4 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

mindspore_dev-2.4.0.dev20241020-cp39-none-any.whl (333.7 MB view details)

Uploaded CPython 3.9

mindspore_dev-2.4.0.dev20241020-cp39-cp39-macosx_11_0_arm64.whl (221.9 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp311-cp311-manylinux1_x86_64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp311-cp311-manylinux1_x86_64.whl
  • Upload date:
  • Size: 971.5 MB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a7cae9d04dad7f128c8f82e3a150016f27755f717cb4c2eea9c5a7dc69c55c21
MD5 95c74991507f1a8e224bff4b3c801b17
BLAKE2b-256 e296b6fb5ea97e3f3febb12df03e06affe4b5df8eef85a6b922eedd4abbabbb5

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 222.1 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 147813f6b0b3b2373c826ab04fa7a6aa425ae5a1129e0fe0ce23a57ff38d93f2
MD5 d2e031f3e803ab4181f95861a6a4f2b0
BLAKE2b-256 de087f37c6b0bc100e7afe9972a36687996c0af4e51aec412c5fa58f57ad1067

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 237.9 MB
  • Tags: CPython 3.11, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5027980e652abc5aaa9861d832a2514232d9c49a7935694faba99a178068053c
MD5 a779cfde591586cac53a0d9f8c7a006e
BLAKE2b-256 915cd247196182ddd3d7b425c07dbe78ea08dd0fff6da2e8ee817c64eb078828

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp310-cp310-manylinux1_x86_64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp310-cp310-manylinux1_x86_64.whl
  • Upload date:
  • Size: 967.9 MB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c93ee28b88d9cf70821902d7bfbb573587595a9432cc33e4237397ebef21932f
MD5 aec78d8c523e68bbb86955c8a96ace5a
BLAKE2b-256 9a9b6aabc32ecb734fe956d10ec8a5fc1bea01d200c2bdc9a51ddb2ff30bda7a

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 221.8 MB
  • Tags: CPython 3.10, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6bd93e5f4f5bca79bbf163e85d4f5b578b61b8a31fc3171933b18f35e041ed0
MD5 6e557fce465f3c1074b22b158ad6e056
BLAKE2b-256 19a024ca3735d9815d2ace218b1df4b9655bc137e0bfab153d9ea8fe02566388

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 237.4 MB
  • Tags: CPython 3.10, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ff29d254dee8cd7dbdfd3bc2ea72376607eddc09348e24fac8f7ca0d69818888
MD5 5556011d7279e3100ec21d66f898f648
BLAKE2b-256 e7e8f524baebfc3b3296e78a653ef4624d1aebdc27a317bd00d100cb8461e4ee

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp39-none-any.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp39-none-any.whl
  • Upload date:
  • Size: 333.7 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp39-none-any.whl
Algorithm Hash digest
SHA256 abd0362a4494f2cac5061d0b8e2141d4b6a05ba21bcb132aa5531a67d6eb2253
MD5 f556d9015e862bd224fe6de0b9d76fce
BLAKE2b-256 ff32b6747f4903bf0a6146e3625a79bff76ba1b8ca65182effd52b71d71b16e9

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 968.0 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 32b60fea7913754392370e05b33758b7ef2c4218dc43b3d5f3dd9e84ff46e886
MD5 82db89154adbb878e369143e60a1e226
BLAKE2b-256 293d071a104c4ddf729dfcb0f570972ad8cc38a98f8b0d5952a03553098bb5d9

See more details on using hashes here.

File details

Details for the file mindspore_dev-2.4.0.dev20241020-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mindspore_dev-2.4.0.dev20241020-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 221.9 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

File hashes

Hashes for mindspore_dev-2.4.0.dev20241020-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 19c3dd724d371a52bdc11bc6663c9bd9ba232b37beaa576d862fed7bfe8e72c5
MD5 35373671c91974646a25c609277e6d2d
BLAKE2b-256 c644760ddcd2b5e9048b86a5f51269a321b2034eb0f725d7ee9d61bb153ed747

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page