Sign inSign up

ascendai/pytorch

By ascendai

•Updated 5 months ago

Ascend PyTorch base container image

Image
4

10K+

ascendai/pytorch repository overview

⁠Ascend PyTorch

English | 中文⁠

⁠Quick Reference


⁠Ascend PyTorch

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.


⁠Supported Tags and Dockerfile Usage

⁠Tag Specification

Tags follow the format:

<PTA_version>-<chip>-<os>-<python_version>
FieldExample ValueDescription
PTA Versionv26.0.0-beta.1-torch2.10.0Version identifier in the official torch_npu release tag
Chip910b / 310p / a3Ascend chip model identifier
OSubuntu / openeulerOS distribution used for the base image
Python Versionpy3.11Major Python version pre-installed in the image
System Archarm / x86Host and image runtime hardware architecture
CANN Version9.0.0-beta.2Ascend CANN toolkit version
  1. Check torch_npu official releases / patch releases

    https://gitcode.com/Ascend/pytorch/releases⁠

  2. CANN base image repository (image tags, versions, OS query)

    https://quay.io/repository/ascend/cann?tab=tags⁠

⁠Build Arguments
ArgumentDescriptionRequiredReference SourceExample Value
CANN_VERSIONAscend CANN toolkit versionYesCANN base image repo9.0.0-beta.2
CHIP_ARCHAscend chip architecture identifierYesCANN image tag rules910b / 310p / a3
OSBase image operating systemYesCANN image tag rulesubuntu / openeuler
OS_VERSIONOperating system versionYesCANN image tag rules22.04 / 24.03
PY_VERSIONPython version pre-installed in base imageYesCANN image tag rules3.11
ARCHHost hardware architectureYesEnvironment hardwarearm / x86
PY_TAGPython package ABI tag (cp + version number)YesStrictly match PY_VERSIONcp311 (PY3.11)
TORCH_NPU_RELEASE_VERSIONOfficial torch_npu release tag (including PyTorch version)YesPTA repo releasesv26.0.0-beta.1-pytorch2.10.0
TORCH_VERSIONFull torch_npu version numberYesPTA repo releases2.10.0rc3
MANYLINUX_VERPyPI package compatible system versionNotorch official wheel specmanylinux_2_28
PIP_MIRROR_URLpip installation source URL (Tsinghua mirror by default)NoPyPI mirror sourceshttps://pypi.tuna.tsinghua.edu.cn/simple⁠

Tips: Example full whl package download URL

https://gitcode.com/Ascend/pytorch/releases/download/v26.0.0-beta.1-pytorch2.10.0/torch_npu-2.10.0rc3-cp310-cp310-manylinux_2_28_aarch64.whl⁠

TORCH_VERSION takes the content between torch_npu- and -cp310

⁠Quick Start

⁠Build PTA Image
docker 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 .
⁠Run PTA Container
docker 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
⁠Local Build
docker buildx build -t {your_repo}/pta:latest -f Dockerfile .
⁠Secondary Development
# 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 ...

...

⁠Supported Hardware

Chip SeriesProduct ExamplesArchitecture
Ascend 910BAtlas 800T A2, Atlas 900 A2 PoDARM64 / x86_64
Ascend A3Atlas 800T A3ARM64 / x86_64
Ascend 310PAtlas 300I Pro, Atlas 300V ProARM64 / x86_64

⁠License

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.

Tag summary

Content type

Image

Digest

sha256:f8abdc996…

Size

3.3 GB

Last updated

5 months ago

docker pull ascendai/pytorch:ubuntu-python3.8-cann8.0.rc1-pytorch2.2.0