[docker] add Ascend 950PR&950DT images (#10851)

This commit is contained in:
xvxuopop
2026-09-28 17:10:59 +08:00
committed by GitHub
parent c1dc0f51ab
commit ce9dc9e072
6 changed files with 89 additions and 23 deletions

View File

@@ -27,6 +27,12 @@ jobs:
- device: "npu-a3" - device: "npu-a3"
os: "openeuler" os: "openeuler"
base_image: "quay.io/ascend/cann:9.1.0-a3-openeuler24.03-py3.12" base_image: "quay.io/ascend/cann:9.1.0-a3-openeuler24.03-py3.12"
- device: "npu-a5"
os: "ubuntu"
base_image: "quay.io/ascend/cann:9.1.0-950-ubuntu22.04-py3.12"
- device: "npu-a5"
os: "openeuler"
base_image: "quay.io/ascend/cann:9.1.0-950-openeuler24.03-py3.12"
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -68,7 +74,7 @@ jobs:
base_image_tag="${BASE_IMAGE##*:}" base_image_tag="${BASE_IMAGE##*:}"
cann_version="${base_image_tag%%-*}" cann_version="${base_image_tag%%-*}"
torch_npu_version="$(sed -nE 's/^torch[-_]npu==([0-9]+(\.[0-9]+)*(\.post[0-9]+)?).*/\1/p' requirements/npu.txt)" torch_npu_version="$(sed -nE 's/^torch[-_]npu==([0-9]+(\.[0-9]+)*(\.post[0-9]+)?).*/\1/p' requirements/npu.txt)"
soc="$(grep -oE '(910b|a3)' <<< "${base_image_tag}" | head -n 1)" soc="$(grep -oE '(910b|a3|950)' <<< "${base_image_tag}" | head -n 1)"
operating_system="$(grep -oE '(ubuntu|openeuler)[0-9]+(\.[0-9]+)*' <<< "${base_image_tag}" | head -n 1)" operating_system="$(grep -oE '(ubuntu|openeuler)[0-9]+(\.[0-9]+)*' <<< "${base_image_tag}" | head -n 1)"
python_version="$(grep -oE 'py[0-9]+\.[0-9]+' <<< "${base_image_tag}" | head -n 1)" python_version="$(grep -oE 'py[0-9]+\.[0-9]+' <<< "${base_image_tag}" | head -n 1)"
@@ -85,6 +91,7 @@ jobs:
case "${MATRIX_DEVICE}" in case "${MATRIX_DEVICE}" in
npu-a2) expected_soc="910b" ;; npu-a2) expected_soc="910b" ;;
npu-a3) expected_soc="a3" ;; npu-a3) expected_soc="a3" ;;
npu-a5) expected_soc="950" ;;
*) *)
echo "Unsupported NPU device ${MATRIX_DEVICE}" >&2 echo "Unsupported NPU device ${MATRIX_DEVICE}" >&2
exit 1 exit 1

View File

@@ -613,14 +613,18 @@ You can also download the pre-built Docker images:
# Docker Hub # Docker Hub
docker pull hiyouga/llamafactory:latest-910b-ubuntu docker pull hiyouga/llamafactory:latest-910b-ubuntu
docker pull hiyouga/llamafactory:latest-a3-ubuntu docker pull hiyouga/llamafactory:latest-a3-ubuntu
docker pull hiyouga/llamafactory:latest-950-ubuntu
docker pull hiyouga/llamafactory:latest-910b-openeuler docker pull hiyouga/llamafactory:latest-910b-openeuler
docker pull hiyouga/llamafactory:latest-a3-openeuler docker pull hiyouga/llamafactory:latest-a3-openeuler
docker pull hiyouga/llamafactory:latest-950-openeuler
# quay.io # quay.io
docker pull quay.io/ascend/llamafactory:latest-910b-ubuntu docker pull quay.io/ascend/llamafactory:latest-910b-ubuntu
docker pull quay.io/ascend/llamafactory:latest-a3-ubuntu docker pull quay.io/ascend/llamafactory:latest-a3-ubuntu
docker pull quay.io/ascend/llamafactory:latest-950-ubuntu
docker pull quay.io/ascend/llamafactory:latest-910b-openeuler docker pull quay.io/ascend/llamafactory:latest-910b-openeuler
docker pull quay.io/ascend/llamafactory:latest-a3-openeuler docker pull quay.io/ascend/llamafactory:latest-a3-openeuler
docker pull quay.io/ascend/llamafactory:latest-950-openeuler
``` ```
#### Install BitsAndBytes #### Install BitsAndBytes

View File

@@ -613,14 +613,18 @@ pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/downl
# Docker Hub # Docker Hub
docker pull hiyouga/llamafactory:latest-910b-ubuntu docker pull hiyouga/llamafactory:latest-910b-ubuntu
docker pull hiyouga/llamafactory:latest-a3-ubuntu docker pull hiyouga/llamafactory:latest-a3-ubuntu
docker pull hiyouga/llamafactory:latest-950-ubuntu
docker pull hiyouga/llamafactory:latest-910b-openeuler docker pull hiyouga/llamafactory:latest-910b-openeuler
docker pull hiyouga/llamafactory:latest-a3-openeuler docker pull hiyouga/llamafactory:latest-a3-openeuler
docker pull hiyouga/llamafactory:latest-950-openeuler
# quay.io # quay.io
docker pull quay.io/ascend/llamafactory:latest-910b-ubuntu docker pull quay.io/ascend/llamafactory:latest-910b-ubuntu
docker pull quay.io/ascend/llamafactory:latest-a3-ubuntu docker pull quay.io/ascend/llamafactory:latest-a3-ubuntu
docker pull quay.io/ascend/llamafactory:latest-950-ubuntu
docker pull quay.io/ascend/llamafactory:latest-910b-openeuler docker pull quay.io/ascend/llamafactory:latest-910b-openeuler
docker pull quay.io/ascend/llamafactory:latest-a3-openeuler docker pull quay.io/ascend/llamafactory:latest-a3-openeuler
docker pull quay.io/ascend/llamafactory:latest-950-openeuler
``` ```
#### 安装 BitsAndBytes #### 安装 BitsAndBytes

View File

@@ -14,12 +14,14 @@ For installation and troubleshooting details, see the [English NPU installation
The following `latest` NPU image tags are available: The following `latest` NPU image tags are available:
| Hardware series | Operating system | Tag | | Product series | Operating system | Tag |
| --- | --- | --- | | --- | --- | --- |
| A2 | Ubuntu 22.04 | `latest-910b-ubuntu` | | Atlas A2 products | Ubuntu 22.04 | `latest-910b-ubuntu` |
| A3 | Ubuntu 22.04 | `latest-a3-ubuntu` | | Atlas A3 products | Ubuntu 22.04 | `latest-a3-ubuntu` |
| A2 | openEuler 24.03 | `latest-910b-openeuler` | | Atlas A2 products | openEuler 24.03 | `latest-910b-openeuler` |
| A3 | openEuler 24.03 | `latest-a3-openeuler` | | Atlas A3 products | openEuler 24.03 | `latest-a3-openeuler` |
| Ascend 950PR&950DT products | Ubuntu 22.04 | `latest-950-ubuntu` |
| Ascend 950PR&950DT products | openEuler 24.03 | `latest-950-openeuler` |
For historical NPU image tags and links to their corresponding archived Dockerfiles, see [Supported Tags](./supported_tags.md). For historical NPU image tags and links to their corresponding archived Dockerfiles, see [Supported Tags](./supported_tags.md).
@@ -53,7 +55,7 @@ latest-<chip>-<os>
| Field | Values | Description | | Field | Values | Description |
| --- | --- | --- | | --- | --- | --- |
| `chip` | `910b` or `a3` | Ascend chip model supported by the image | | `chip` | `910b`, `a3`, or `950` | Ascend chip model supported by the image |
| `os` | `ubuntu` or `openeuler` | Container operating system family | | `os` | `ubuntu` or `openeuler` | Container operating system family |
Future NPU release images will use the full tag format below. Historical release images used earlier naming formats and do not follow this rule. Future NPU release images will use the full tag format below. Historical release images used earlier naming formats and do not follow this rule.
@@ -67,7 +69,7 @@ Future NPU release images will use the full tag format below. Historical release
| `LlamaFactory-version` | `0.9.5` | LlamaFactory release version | | `LlamaFactory-version` | `0.9.5` | LlamaFactory release version |
| `CANN-version` | `9.1.0` | Parsed from the CANN base image tag | | `CANN-version` | `9.1.0` | Parsed from the CANN base image tag |
| `TorchNPU-version` | `2.10.0.post2` | Full TorchNPU version used by the image, including suffixes such as `.postN` | | `TorchNPU-version` | `2.10.0.post2` | Full TorchNPU version used by the image, including suffixes such as `.postN` |
| `chip` | `910b` or `a3` | Ascend chip model supported by the image | | `chip` | `910b`, `a3`, or `950` | Ascend chip model supported by the image |
| `os` | `ubuntu22.04` or `openeuler24.03` | Container operating system family and version | | `os` | `ubuntu22.04` or `openeuler24.03` | Container operating system family and version |
| `Python-version` | `py3.12` | Parsed from the CANN base image tag | | `Python-version` | `py3.12` | Parsed from the CANN base image tag |
@@ -148,7 +150,7 @@ Available build arguments:
### Start with Docker Compose ### Start with Docker Compose
The preceding `docker build` command invokes the Dockerfile directly. It builds an image but does not start a container. Docker Compose does not use a separate build implementation: it reads the presets in `docker-compose.yml`, reuses the same Dockerfile, and selects a hardware-series and operating-system combination through a profile. Each `up -d` command below starts the selected container in the background. If the image is not available locally, Docker Compose builds it first: The preceding `docker build` command invokes the Dockerfile directly. It builds an image but does not start a container. Docker Compose does not use a separate build implementation: it reads the presets in `docker-compose.yml`, reuses the same Dockerfile, and selects a product-series and operating-system combination through a profile. Each `up -d` command below starts the selected container in the background. If the image is not available locally, Docker Compose builds it first:
```bash ```bash
cd docker/docker-npu cd docker/docker-npu
@@ -164,16 +166,22 @@ docker compose --profile a2-openeuler up -d
# A3 with openEuler # A3 with openEuler
docker compose --profile a3-openeuler up -d docker compose --profile a3-openeuler up -d
# 950PR&950DT with Ubuntu
docker compose --profile 950-ubuntu up -d
# 950PR&950DT with openEuler
docker compose --profile 950-openeuler up -d
``` ```
To build an image with Docker Compose without starting a container, use `docker compose --profile <profile> build`. To build an image with Docker Compose without starting a container, use `docker compose --profile <profile> build`.
## Hardware Support and Compatibility Notes ## Hardware Support and Compatibility Notes
- A2 images use the `910b` CANN base image; A3 images use the `a3` CANN base image. - A2 images use the `910b` CANN base image; A3 images use the `a3` CANN base image; 950PR&950DT images use the `950` CANN base image.
- The image build targets both x86-64 (`linux/amd64`) and AArch64 (`linux/arm64`) hosts. The CPU architecture is independent of whether the hardware series is A2 or A3. - The image build targets both x86-64 (`linux/amd64`) and AArch64 (`linux/arm64`) hosts. The CPU architecture is independent of whether the product series is A2, A3, or 950PR&950DT.
- Ubuntu 22.04 and openEuler 24.03 refer to the operating system inside the container. - Ubuntu 22.04 and openEuler 24.03 refer to the operating system inside the container.
- Legacy NPU tags are replaced by the `latest-<910b|a3>-<ubuntu|openeuler>` format. - Legacy NPU tags are replaced by the `latest-<910b|a3|950>-<ubuntu|openeuler>` format.
- Validate the exact driver, firmware, CANN, and SoC combination before production deployment. - Validate the exact driver, firmware, CANN, and SoC combination before production deployment.
## License and Disclaimer ## License and Disclaimer

View File

@@ -14,12 +14,14 @@ LlamaFactory 昇腾 NPU 镜像面向华为昇腾 Atlas NPU,提供可直接使
当前提供以下 `latest` NPU 镜像 tag: 当前提供以下 `latest` NPU 镜像 tag:
| 硬件系列 | 操作系统 | Tag | | 产品系列 | 操作系统 | Tag |
| --- | --- | --- | | --- | --- | --- |
| A2 | Ubuntu 22.04 | `latest-910b-ubuntu` | | Atlas A2 系列产品 | Ubuntu 22.04 | `latest-910b-ubuntu` |
| A3 | Ubuntu 22.04 | `latest-a3-ubuntu` | | Atlas A3 系列产品 | Ubuntu 22.04 | `latest-a3-ubuntu` |
| A2 | openEuler 24.03 | `latest-910b-openeuler` | | Atlas A2 系列产品 | openEuler 24.03 | `latest-910b-openeuler` |
| A3 | openEuler 24.03 | `latest-a3-openeuler` | | Atlas A3 系列产品 | openEuler 24.03 | `latest-a3-openeuler` |
| Ascend 950PR&950DT 系列产品 | Ubuntu 22.04 | `latest-950-ubuntu` |
| Ascend 950PR&950DT 系列产品 | openEuler 24.03 | `latest-950-openeuler` |
历史版本的 NPU 镜像 Tag 及其对应的 Dockerfile 归档链接,请参阅 [Supported Tags](./supported_tags.md)。 历史版本的 NPU 镜像 Tag 及其对应的 Dockerfile 归档链接,请参阅 [Supported Tags](./supported_tags.md)。
@@ -53,7 +55,7 @@ latest-<芯片信息>-<操作系统>
| 字段 | 可选值 | 说明 | | 字段 | 可选值 | 说明 |
| --- | --- | --- | | --- | --- | --- |
| `芯片信息` | `910b` 或 `a3` | 镜像所适配的昇腾芯片型号 | | `芯片信息` | `910b`、`a3` 或 `950` | 镜像所适配的昇腾芯片型号 |
| `操作系统` | `ubuntu` 或 `openeuler` | 容器操作系统类型 | | `操作系统` | `ubuntu` 或 `openeuler` | 容器操作系统类型 |
后续发布的 NPU release 镜像将使用以下完整 tag 格式。历史 release 镜像使用旧的命名格式,不适用以下规则。 后续发布的 NPU release 镜像将使用以下完整 tag 格式。历史 release 镜像使用旧的命名格式,不适用以下规则。
@@ -67,7 +69,7 @@ latest-<芯片信息>-<操作系统>
| `LlamaFactory版本` | `0.9.5` | LlamaFactory release 版本号 | | `LlamaFactory版本` | `0.9.5` | LlamaFactory release 版本号 |
| `CANN版本` | `9.1.0` | 从 CANN 基础镜像 tag 中提取 | | `CANN版本` | `9.1.0` | 从 CANN 基础镜像 tag 中提取 |
| `TorchNPU版本` | `2.10.0.post2` | 镜像使用的 TorchNPU 完整版本,包含 `.postN` 等后缀 | | `TorchNPU版本` | `2.10.0.post2` | 镜像使用的 TorchNPU 完整版本,包含 `.postN` 等后缀 |
| `芯片信息` | `910b` 或 `a3` | 镜像所适配的昇腾芯片型号 | | `芯片信息` | `910b`、`a3` 或 `950` | 镜像所适配的昇腾芯片型号 |
| `操作系统` | `ubuntu22.04` 或 `openeuler24.03` | 容器操作系统类型和版本 | | `操作系统` | `ubuntu22.04` 或 `openeuler24.03` | 容器操作系统类型和版本 |
| `Python版本` | `py3.12` | 从 CANN 基础镜像 tag 中提取 | | `Python版本` | `py3.12` | 从 CANN 基础镜像 tag 中提取 |
@@ -148,7 +150,7 @@ docker build \
### 通过 Docker Compose 启动 ### 通过 Docker Compose 启动
前面的 `docker build` 命令直接调用 Dockerfile,只构建镜像,不启动容器。Docker Compose 不使用另一套构建逻辑:它读取 `docker-compose.yml` 中的预设配置,复用同一个 Dockerfile,并通过 profile 选择硬件系列和操作系统组合。下面的 `up -d` 会在后台启动容器;若本地镜像不存在,Docker Compose 会先构建镜像: 前面的 `docker build` 命令直接调用 Dockerfile,只构建镜像,不启动容器。Docker Compose 不使用另一套构建逻辑:它读取 `docker-compose.yml` 中的预设配置,复用同一个 Dockerfile,并通过 profile 选择产品系列和操作系统组合。下面的 `up -d` 会在后台启动容器;若本地镜像不存在,Docker Compose 会先构建镜像:
```bash ```bash
cd docker/docker-npu cd docker/docker-npu
@@ -164,16 +166,22 @@ docker compose --profile a2-openeuler up -d
# A3 + openEuler # A3 + openEuler
docker compose --profile a3-openeuler up -d docker compose --profile a3-openeuler up -d
# 950PR&950DT + Ubuntu
docker compose --profile 950-ubuntu up -d
# 950PR&950DT + openEuler
docker compose --profile 950-openeuler up -d
``` ```
如果只想通过 Docker Compose 构建镜像而不启动容器,请使用 `docker compose --profile <profile> build`。 如果只想通过 Docker Compose 构建镜像而不启动容器,请使用 `docker compose --profile <profile> build`。
## 硬件支持与兼容性说明 ## 硬件支持与兼容性说明
- A2 镜像使用标记为 `910b` 的 CANN 基础镜像,A3 镜像使用标记为 `a3` 的 CANN 基础镜像。 - A2 镜像使用标记为 `910b` 的 CANN 基础镜像,A3 镜像使用标记为 `a3` 的 CANN 基础镜像,950PR&950DT 镜像使用标记为 `950` 的 CANN 基础镜像。
- 镜像构建目标同时包含 x86-64(`linux/amd64`)和 AArch64(`linux/arm64`)宿主机。CPU 架构与硬件系列是 A2 还是 A3 无关。 - 镜像构建目标同时包含 x86-64(`linux/amd64`)和 AArch64(`linux/arm64`)宿主机。CPU 架构与产品系列是 A2、A3 还是 950PR&950DT 无关。
- Ubuntu 22.04 和 openEuler 24.03 指容器内部的操作系统。 - Ubuntu 22.04 和 openEuler 24.03 指容器内部的操作系统。
- 旧式 NPU tag 已由 `latest-<910b|a3>-<ubuntu|openeuler>` 格式取代。 - 旧式 NPU tag 已由 `latest-<910b|a3|950>-<ubuntu|openeuler>` 格式取代。
- 正式部署前,请验证具体驱动、固件、CANN 和 SoC 组合的兼容性。 - 正式部署前,请验证具体驱动、固件、CANN 和 SoC 组合的兼容性。
## 许可证与免责声明 ## 许可证与免责声明

View File

@@ -23,6 +23,13 @@ x-npu-common: &npu-common
- /dev/hisi_hdc - /dev/hisi_hdc
restart: unless-stopped restart: unless-stopped
x-npu-950: &npu-950
<<: *npu-common
devices:
- /dev/davinci0
- /dev/davinci_manager
- /dev/hisi_hdc
services: services:
llamafactory-a2-ubuntu: llamafactory-a2-ubuntu:
<<: *npu-common <<: *npu-common
@@ -79,3 +86,31 @@ services:
ports: ports:
- "7863:7860" - "7863:7860"
- "8003:8000" - "8003:8000"
llamafactory-950-ubuntu:
<<: *npu-950
profiles: ["950-ubuntu"]
build:
<<: *build
args:
<<: *build-args
BASE_IMAGE: quay.io/ascend/cann:9.1.0-950-ubuntu22.04-py3.12
container_name: llamafactory-950-ubuntu
image: llamafactory:npu-950-ubuntu
ports:
- "7864:7860"
- "8004:8000"
llamafactory-950-openeuler:
<<: *npu-950
profiles: ["950-openeuler"]
build:
<<: *build
args:
<<: *build-args
BASE_IMAGE: quay.io/ascend/cann:9.1.0-950-openeuler24.03-py3.12
container_name: llamafactory-950-openeuler
image: llamafactory:npu-950-openeuler
ports:
- "7865:7860"
- "8005:8000"