
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
English | 中文
PTA is maintained by the https://www.hiascend.com/developer/software/ai-frameworks/pytorch
Where to get help
The Ascend Extension for PyTorch plugin is a deep learning adaptation framework based on Ascend, enabling Ascend NPUs to support the PyTorch framework and providing users of the PyTorch framework with the powerful computing power of Ascend AI processors.
Tags follow the format:
<PTA_version>-<chip>-<os>-<python_version>
| Field | Example Value | Description |
|---|---|---|
| PTA Version | v26.0.0-beta.1-torch2.10.0 | Version identifier in the official torch_npu release tag |
| Chip | 910b / 310p / a3 | Ascend chip model identifier |
| OS | ubuntu / openeuler | OS distribution used for the base image |
| Python Version | py3.11 | Major Python version pre-installed in the image |
| System Arch | arm / x86 | Host and image runtime hardware architecture |
| CANN Version | 9.0.0-beta.2 | Ascend CANN toolkit version |
Check torch_npu official releases / patch releases
[***]
CANN base image repository (image tags, versions, OS query)
https://quay.io/repository/ascend/cann?tab=tags
| Argument | Description | Required | Reference Source | Example Value |
|---|---|---|---|---|
| CANN_VERSION | Ascend CANN toolkit version | Yes | CANN base image repo | 9.0.0-beta.2 |
| CHIP_ARCH | Ascend chip architecture identifier | Yes | CANN image tag rules | 910b / 310p / a3 |
| OS | Base image operating system | Yes | CANN image tag rules | ubuntu / openeuler |
| OS_VERSION | Operating system version | Yes | CANN image tag rules | 22.04 / 24.03 |
| PY_VERSION | Python version pre-installed in base image | Yes | CANN image tag rules | 3.11 |
| ARCH | Host hardware architecture | Yes | Environment hardware | arm / x86 |
| PY_TAG | Python package ABI tag (cp + version number) | Yes | Strictly match PY_VERSION | cp311 (PY3.11) |
| TORCH_NPU_RELEASE_VERSION | Official torch_npu release tag (including PyTorch version) | Yes | PTA repo releases | v26.0.0-beta.1-pytorch2.10.0 |
| TORCH_VERSION | Full torch_npu version number | Yes | PTA repo releases | 2.10.0rc3 |
| MANYLINUX_VER | PyPI package compatible system version | No | torch official wheel spec | manylinux_2_28 |
| PIP_MIRROR_URL | pip installation source URL (Tsinghua mirror by default) | No | PyPI mirror sources | https://pypi.tuna.tsinghua.edu.cn/simple |
Tips: Example full whl package download URL
[***]
TORCH_VERSION takes the content between
torch_npu-and-cp310
bashdocker build \ --build-arg CANN_VERSION=xxx \ --build-arg CHIP_ARCH=xxx \ --build-arg OS=xxx \ --build-arg OS_VERSION=xxx \ --build-arg PY_VERSION=xxx \ --build-arg TORCH_VERSION=xxx \ --build-arg ARCH=xxx \ --build-arg PY_TAG=xxx \ --build-arg TORCH_NPU_RELEASE_TAG=xxx \ --build-arg TORCH_NPU_PATCH_TAG=xxx \ -t image_name:tag \ -f Dockerfile .
bashdocker run \ --name pta_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 ascend/pta:tag bash
bashdocker buildx build -t {your_repo}/pta:latest -f Dockerfile .
bash# Use PTA image as base image and add user software FROM quay.io/ascend/ascend-pytorch:v26.0.0-beta.1-torch2.10.0-910b-ubuntu-py3.11-arm # Not yet published, example only, subject to change. RUN apt update -y && \ apt install gcc ... ...
| Chip Series | Product Examples | Architecture |
|---|---|---|
| Ascend 910B | Atlas 800T A2, Atlas 900 A2 PoD | ARM64 / x86_64 |
| Ascend A3 | Atlas 800T A3 | ARM64 / x86_64 |
| Ascend 310P | Atlas 300I Pro, Atlas 300V Pro | ARM64 / x86_64 |
See the license information for PTA included in these images.
Like all container images, pre-installed software packages (Python, system libraries, etc.) may be subject to their own licenses.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 ascendai/pytorch 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: