mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2026-10-05 14:25:43 +08:00
[docker] add Ascend 950PR&950DT images (#10851)
This commit is contained in:
@@ -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-<chip>-<os>
|
||||
|
||||
| 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 <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>-<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.
|
||||
|
||||
## License and Disclaimer
|
||||
|
||||
@@ -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 <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>-<ubuntu|openeuler>` 格式取代。
|
||||
- 旧式 NPU tag 已由 `latest-<910b|a3|950>-<ubuntu|openeuler>` 格式取代。
|
||||
- 正式部署前,请验证具体驱动、固件、CANN 和 SoC 组合的兼容性。
|
||||
|
||||
## 许可证与免责声明
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user