MindSpore Transformers is maintained by the MindSpore Transformers Community 维护
Where to get help
The MindSpore Transformers suite aims to build a comprehensive development toolkit covering the entire lifecycle of large-scale models, including pre-training, fine-tuning, evaluation, inference, and deployment. It provides industry-leading large Transformer-based language models, multimodal understanding models, and omni-modal models, enabling users to easily achieve end-to-end development of large-scale models.
Tags follow this format:
<MindSpore Transformers Version>-cann-<CANN Version>-mindspore<MindSpore Version>-<Hardware Info (Chip)>-<Operating System>-<Python Version>
| Field | Values | Description |
|---|---|---|
| MindSpore Transformers Version | 2.0.0 | Corresponds to the version identifier in MindSpore Transformers official release tags |
| CANN Version | 9.1.0 | CANN version built into the image |
| MindSpore Version | 2.10.0 | MindSpore version built into the image |
| Hardware Info (Chip) | 910b / a3 | NPU chip model identifier |
| Operating System | ubuntu22.04 / openeuler24.03 | Operating system distribution and version used in the base image |
| Python Version | py3.12 | Major Python version built into the image |
Tips: System architecture is automatically detected via Docker Manifest, no need to specify in the tag.
2.0.0-cann9.1.0-mindspore2.10.0-910b-ubuntu22.04-py3.122.0.0-cann9.1.0-mindspore2.10.0-910b-openeuler24.03-py3.122.0.0-cann9.1.0-mindspore2.10.0-a3-ubuntu22.04-py3.122.0.0-cann9.1.0-mindspore2.10.0-a3-openeuler24.03-py3.12MindSpore Transformers images are hosted on the Huawei Cloud SWR image repository:
swr.cn-south-1.myhuaweicloud.com/ascendhub/mindformers
Full Image Example:
swr.cn-south-1.myhuaweicloud.com/ascendhub/mindformers:2.0.0-cann9.1.0-mindspore2.10.0-910b-ubuntu22.04-py3.12
See dockerfile: dockerfile
| Parameter | Description | Required | Source | Values |
|---|---|---|---|---|
| CANN_VERSION | CANN toolkit version | Yes | CANN image tag | 9.1.0 |
| CHIP_ARCH | NPU chip architecture identifier | Yes | Tag specification | 910b / a3 |
| OS_SYSTEM | Base image operating system and version | Yes | Tag specification | ubuntu22.04 / openeuler24.03 |
| PY_VERSION | Python version built into the base image | Yes | Tag specification | py3.12 |
| MINDSPORE_VERSION | MindSpore version number | Yes | MindSpore repository releases | 2.10.0 |
| MINDFORMERS_VERSION | MindSpore Transformers version number | Yes | MindSpore Transformers repository releases | 2.0.0 |
| PIP_INDEX_URL | pip installation source URL (default: Huawei Cloud mirror) | No | PyPI mirror source | https://mirrors.huaweicloud.com/repository/pypi/simple |
# Enable Docker Content Trust so that image signatures are verified when building, pulling and
# pushing images, preventing tampered or man-in-the-middle replaced images
export DOCKER_CONTENT_TRUST=1
docker build \
--build-arg CANN_VERSION=9.1.0 \
--build-arg CHIP_ARCH=910b \
--build-arg OS_SYSTEM=ubuntu22.04 \
--build-arg PY_VERSION=py3.12 \
--build-arg MINDSPORE_VERSION=2.10.0 \
--build-arg MINDFORMERS_VERSION=2.0.0 \
--build-arg PIP_INDEX_URL=https://mirrors.huaweicloud.com/repository/pypi/simple \
-t mindformers:2.0.0-cann9.1.0-mindspore2.10.0-910b-ubuntu22.04-py3.12 \
-f Dockerfile .
Tips:
DOCKER_CONTENT_TRUST=1relies on the registry publishing signature (Notary) data. If the registry does not publish it, the legacy builder (DOCKER_BUILDKIT=0) fails withno trust data, while BuildKit simply ignores the variable. In both cases, pin the base image by digest instead (FROM quay.io/ascend/cann@sha256:...), which keeps the base image verifiable.
docker run \
--privileged \
--name mindformers_container \
--device /dev/davinci1 \
--device /dev/davinci_manager \
--device /dev/devmm_svm \
--device /dev/hisi_hdc \
-v /usr/local/dcmi:/usr/local/dcmi \
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-it mindspore:tag bash
The image ships a HEALTHCHECK instruction that runs python3 -c "import mindformers" every 5 minutes. The result can be queried with:
docker inspect --format '{{.State.Health.Status}}' mindformers_container
A single probe takes under 10 seconds and peaks at about 800MB of memory. Append --no-healthcheck to docker run to turn the periodic probe off.
When running MindSpore Transformers in Docker containers, pay attention to the following security risks:
Running as the root user:
Containers run as the root user by default, which may introduce security risks. It is recommended to create and use a non-privileged user in production environments.
Running with --privileged mode:
To ensure NPU functionality works properly, the container may require the --privileged option. This mode grants the container elevated access to host devices and system resources, increasing potential security risks. It is recommended to use it only in trusted environments and reduce risks through device whitelisting, resource limits, and network isolation.
Missing CPU and memory resource limits:
Without resource limits, containers may consume excessive system resources and impact host performance. It is recommended to use the --cpus and --memory options to limit resource usage.
Unverified image provenance:
Using images that are neither signed nor pinned by digest leaves room for tampering or man-in-the-middle replacement. It is recommended to export DOCKER_CONTENT_TRUST=1 before building, pulling or pushing images; when the registry publishes no signature data, pin the image version by digest (@sha256:...) instead.
| Chip Series | Product Examples | Architecture |
|---|---|---|
| 910B | Atlas 800T A2, Atlas 900 A2 PoD | Auto-detected (ARM64/x86_64) |
| A3 | Atlas 800T A3 | Auto-detected (ARM64/x86_64) |
Tips: Use the
docker manifest inspectcommand to view the system architectures supported by an image.
The released software images are community editions and are not intended for commercial use. They are provided solely as references for production practices. The responsibility statement is displayed in the image startup information and on the image hosting platform.
View the license information for MindSpore and license informationincluded in these images.
As with all container images, pre-installed software packages (Python, system libraries, etc.) may be subject to their respective licenses.
Content type
Image
Digest
sha256:252e231ba…
Size
5.2 GB
Last updated
1 day ago
docker pull ascendai/mindformers:1.9.0-a3-openeuler24.03-py3.11