From ce9dc9e072f80fa3abe0989d4ab90da25f083438 Mon Sep 17 00:00:00 2001 From: xvxuopop Date: Mon, 28 Sep 2026 17:10:59 +0800 Subject: [PATCH] [docker] add Ascend 950PR&950DT images (#10851) --- .github/workflows/docker_npu.yml | 9 ++++++- README.md | 4 ++++ README_zh.md | 4 ++++ docker/docker-npu/OVERVIEW.md | 30 +++++++++++++++--------- docker/docker-npu/OVERVIEW.zh.md | 30 +++++++++++++++--------- docker/docker-npu/docker-compose.yml | 35 ++++++++++++++++++++++++++++ 6 files changed, 89 insertions(+), 23 deletions(-) diff --git a/.github/workflows/docker_npu.yml b/.github/workflows/docker_npu.yml index 223d4bf16..7cafe115d 100644 --- a/.github/workflows/docker_npu.yml +++ b/.github/workflows/docker_npu.yml @@ -27,6 +27,12 @@ jobs: - device: "npu-a3" os: "openeuler" 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 @@ -68,7 +74,7 @@ jobs: base_image_tag="${BASE_IMAGE##*:}" 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)" - 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)" python_version="$(grep -oE 'py[0-9]+\.[0-9]+' <<< "${base_image_tag}" | head -n 1)" @@ -85,6 +91,7 @@ jobs: case "${MATRIX_DEVICE}" in npu-a2) expected_soc="910b" ;; npu-a3) expected_soc="a3" ;; + npu-a5) expected_soc="950" ;; *) echo "Unsupported NPU device ${MATRIX_DEVICE}" >&2 exit 1 diff --git a/README.md b/README.md index a12212ba4..6de8a1600 100644 --- a/README.md +++ b/README.md @@ -613,14 +613,18 @@ You can also download the pre-built Docker images: # Docker Hub docker pull hiyouga/llamafactory:latest-910b-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-a3-openeuler +docker pull hiyouga/llamafactory:latest-950-openeuler # quay.io 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-950-ubuntu 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-950-openeuler ``` #### Install BitsAndBytes diff --git a/README_zh.md b/README_zh.md index b310854aa..e57b6be6c 100644 --- a/README_zh.md +++ b/README_zh.md @@ -613,14 +613,18 @@ pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/downl # Docker Hub docker pull hiyouga/llamafactory:latest-910b-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-a3-openeuler +docker pull hiyouga/llamafactory:latest-950-openeuler # quay.io 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-950-ubuntu 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-950-openeuler ``` #### 安装 BitsAndBytes diff --git a/docker/docker-npu/OVERVIEW.md b/docker/docker-npu/OVERVIEW.md index 5383467f3..68dba7421 100644 --- a/docker/docker-npu/OVERVIEW.md +++ b/docker/docker-npu/OVERVIEW.md @@ -14,12 +14,14 @@ For installation and troubleshooting details, see the [English NPU installation 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` | -| A3 | Ubuntu 22.04 | `latest-a3-ubuntu` | -| A2 | openEuler 24.03 | `latest-910b-openeuler` | -| A3 | openEuler 24.03 | `latest-a3-openeuler` | +| Atlas A2 products | Ubuntu 22.04 | `latest-910b-ubuntu` | +| Atlas A3 products | Ubuntu 22.04 | `latest-a3-ubuntu` | +| Atlas A2 products | openEuler 24.03 | `latest-910b-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). @@ -53,7 +55,7 @@ latest-- | 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 | 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 | | `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` | -| `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 | | `Python-version` | `py3.12` | Parsed from the CANN base image tag | @@ -148,7 +150,7 @@ Available build arguments: ### 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 cd docker/docker-npu @@ -164,16 +166,22 @@ docker compose --profile a2-openeuler up -d # A3 with openEuler 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 build`. ## Hardware Support and Compatibility Notes -- A2 images use the `910b` CANN base image; A3 images use the `a3` 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. +- 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 product series is A2, A3, or 950PR&950DT. - 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>-` format. +- Legacy NPU tags are replaced by the `latest-<910b|a3|950>-` format. - Validate the exact driver, firmware, CANN, and SoC combination before production deployment. ## License and Disclaimer diff --git a/docker/docker-npu/OVERVIEW.zh.md b/docker/docker-npu/OVERVIEW.zh.md index 5fbf7614e..f4d47fb79 100644 --- a/docker/docker-npu/OVERVIEW.zh.md +++ b/docker/docker-npu/OVERVIEW.zh.md @@ -14,12 +14,14 @@ LlamaFactory 昇腾 NPU 镜像面向华为昇腾 Atlas NPU,提供可直接使 当前提供以下 `latest` NPU 镜像 tag: -| 硬件系列 | 操作系统 | Tag | +| 产品系列 | 操作系统 | Tag | | --- | --- | --- | -| A2 | Ubuntu 22.04 | `latest-910b-ubuntu` | -| A3 | Ubuntu 22.04 | `latest-a3-ubuntu` | -| A2 | openEuler 24.03 | `latest-910b-openeuler` | -| A3 | openEuler 24.03 | `latest-a3-openeuler` | +| Atlas A2 系列产品 | Ubuntu 22.04 | `latest-910b-ubuntu` | +| Atlas A3 系列产品 | Ubuntu 22.04 | `latest-a3-ubuntu` | +| Atlas A2 系列产品 | openEuler 24.03 | `latest-910b-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)。 @@ -53,7 +55,7 @@ latest-<芯片信息>-<操作系统> | 字段 | 可选值 | 说明 | | --- | --- | --- | -| `芯片信息` | `910b` 或 `a3` | 镜像所适配的昇腾芯片型号 | +| `芯片信息` | `910b`、`a3` 或 `950` | 镜像所适配的昇腾芯片型号 | | `操作系统` | `ubuntu` 或 `openeuler` | 容器操作系统类型 | 后续发布的 NPU release 镜像将使用以下完整 tag 格式。历史 release 镜像使用旧的命名格式,不适用以下规则。 @@ -67,7 +69,7 @@ latest-<芯片信息>-<操作系统> | `LlamaFactory版本` | `0.9.5` | LlamaFactory release 版本号 | | `CANN版本` | `9.1.0` | 从 CANN 基础镜像 tag 中提取 | | `TorchNPU版本` | `2.10.0.post2` | 镜像使用的 TorchNPU 完整版本,包含 `.postN` 等后缀 | -| `芯片信息` | `910b` 或 `a3` | 镜像所适配的昇腾芯片型号 | +| `芯片信息` | `910b`、`a3` 或 `950` | 镜像所适配的昇腾芯片型号 | | `操作系统` | `ubuntu22.04` 或 `openeuler24.03` | 容器操作系统类型和版本 | | `Python版本` | `py3.12` | 从 CANN 基础镜像 tag 中提取 | @@ -148,7 +150,7 @@ docker build \ ### 通过 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 cd docker/docker-npu @@ -164,16 +166,22 @@ docker compose --profile a2-openeuler up -d # A3 + openEuler 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 build`。 ## 硬件支持与兼容性说明 -- A2 镜像使用标记为 `910b` 的 CANN 基础镜像,A3 镜像使用标记为 `a3` 的 CANN 基础镜像。 -- 镜像构建目标同时包含 x86-64(`linux/amd64`)和 AArch64(`linux/arm64`)宿主机。CPU 架构与硬件系列是 A2 还是 A3 无关。 +- A2 镜像使用标记为 `910b` 的 CANN 基础镜像,A3 镜像使用标记为 `a3` 的 CANN 基础镜像,950PR&950DT 镜像使用标记为 `950` 的 CANN 基础镜像。 +- 镜像构建目标同时包含 x86-64(`linux/amd64`)和 AArch64(`linux/arm64`)宿主机。CPU 架构与产品系列是 A2、A3 还是 950PR&950DT 无关。 - Ubuntu 22.04 和 openEuler 24.03 指容器内部的操作系统。 -- 旧式 NPU tag 已由 `latest-<910b|a3>-` 格式取代。 +- 旧式 NPU tag 已由 `latest-<910b|a3|950>-` 格式取代。 - 正式部署前,请验证具体驱动、固件、CANN 和 SoC 组合的兼容性。 ## 许可证与免责声明 diff --git a/docker/docker-npu/docker-compose.yml b/docker/docker-npu/docker-compose.yml index f165c80a7..61fe439f4 100644 --- a/docker/docker-npu/docker-compose.yml +++ b/docker/docker-npu/docker-compose.yml @@ -23,6 +23,13 @@ x-npu-common: &npu-common - /dev/hisi_hdc restart: unless-stopped +x-npu-950: &npu-950 + <<: *npu-common + devices: + - /dev/davinci0 + - /dev/davinci_manager + - /dev/hisi_hdc + services: llamafactory-a2-ubuntu: <<: *npu-common @@ -79,3 +86,31 @@ services: ports: - "7863:7860" - "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"