Skip to content

Commit ecabe22

Browse files
committed
docs: update Ascend NPU documentation
1 parent 7f9d4d3 commit ecabe22

17 files changed

Lines changed: 1504 additions & 474 deletions

File tree

.github/workflows/ci-npu-test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
- name: Install ROLL requirements
199199
run: |
200200
python3 -m pip install -r requirements_common.txt
201-
python3 -m pip install deepspeed==0.16.4 tensorboard
201+
python3 -m pip install tensorboard
202202
203203
- name: Install SGLang NPU kernel from source
204204
shell: bash
@@ -289,7 +289,7 @@ jobs:
289289
except metadata.PackageNotFoundError:
290290
return "not installed"
291291
292-
packages = ("vllm-ascend", "transformers", "deepspeed", "triton-ascend")
292+
packages = ("vllm-ascend", "transformers", "triton-ascend")
293293
for package_name in packages:
294294
print(f"{package_name}={package_version(package_name)}")
295295
@@ -302,7 +302,6 @@ jobs:
302302
export PYTHONPATH="${GITHUB_WORKSPACE}:${PYTHONPATH:-}"
303303
python3 -m pytest tests/third_party/sglang \
304304
tests/third_party/vllm \
305-
tests/third_party/deepspeed \
306305
tests/distributed \
307306
tests/models \
308307
tests/pipeline \
@@ -315,4 +314,3 @@ jobs:
315314
-v --timeout=600 --durations=0 --durations-min=0 -x
316315
env:
317316
ROLL_NPU_CI: "1"
318-
DS_UNITTEST_TIMEOUT: "600"

docker/Dockerfile.A2

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/ascend/cann:8.5.1-910b-ubuntu22.04-py3.11
1+
FROM quay.io/ascend/cann:9.0.0-910b-ubuntu22.04-py3.11
22

33
ARG SOC_VERSION="ascend910b1"
44

@@ -9,6 +9,7 @@ ENV PIP_CONSTRAINT=""
99

1010
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64/common:/usr/local/Ascend/driver/lib64/driver:/usr/local/Ascend/add-ons:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64:/usr/local/Ascend/ascend-toolkit/latest/acllib/lib64:/usr/local/Ascend/ascend-toolkit/latest/atc/lib64:${LD_LIBRARY_PATH}
1111
ENV ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest
12+
ENV HCCL_NPU_SOCKET_PORT_RANGE=auto
1213

1314
RUN apt-get update -y && \
1415
apt-get install -y --no-install-recommends \
@@ -26,8 +27,8 @@ RUN pip config set global.index-url https://mirrors.huaweicloud.com/repository/p
2627

2728
WORKDIR /workspace
2829

29-
RUN git clone --depth 1 -b v0.13.0 https://github.com/vllm-project/vllm.git && \
30-
git clone --depth 1 -b releases/v0.13.0 https://github.com/vllm-project/vllm-ascend.git
30+
RUN git clone --depth 1 -b v0.18.0 https://github.com/vllm-project/vllm.git && \
31+
git clone --depth 1 -b v0.18.0 https://github.com/vllm-project/vllm-ascend.git
3132

3233
RUN cd vllm && \
3334
pip install -r requirements/build.txt && \
@@ -36,7 +37,7 @@ RUN cd vllm && \
3637
pip cache purge && \
3738
cd ..
3839

39-
RUN pip install torch==2.8.0+cpu torchvision==0.23.0 torchaudio==2.8.0 \
40+
RUN pip install torch==2.9.0+cpu torchvision==0.24.0 torchaudio==2.9.0 \
4041
--index-url https://download.pytorch.org/whl/cpu
4142

4243
RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
@@ -50,17 +51,18 @@ COPY . .
5051

5152
RUN pip install -r requirements_common.txt
5253

53-
RUN pip install "deepspeed==0.16.4" "transformers==4.57.6" "tensorboard==2.20.0"
54+
RUN pip install "transformers==4.57.6" "tensorboard==2.20.0"
5455

5556
RUN pip install -e .
5657

5758
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
5859
pip uninstall -y triton && \
5960
pip uninstall -y triton-ascend && \
60-
pip install triton-ascend==3.2.0 && \
61+
pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
6162
pip cache purge
6263

6364
RUN echo "source /usr/local/Ascend/ascend-toolkit/set_env.sh" >> /root/.bashrc && \
64-
echo "source /usr/local/Ascend/nnal/atb/set_env.sh" >> /root/.bashrc
65+
echo "source /usr/local/Ascend/nnal/atb/set_env.sh" >> /root/.bashrc && \
66+
echo "export HCCL_NPU_SOCKET_PORT_RANGE=auto" >> /root/.bashrc
6567

66-
CMD ["/bin/bash"]
68+
CMD ["/bin/bash"]

docker/Dockerfile.A3

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/ascend/cann:8.5.1-a3-ubuntu22.04-py3.11
1+
FROM quay.io/ascend/cann:9.0.0-a3-ubuntu22.04-py3.11
22

33
ARG SOC_VERSION="ascend910_9391"
44

@@ -9,6 +9,7 @@ ENV PIP_CONSTRAINT=""
99

1010
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64/common:/usr/local/Ascend/driver/lib64/driver:/usr/local/Ascend/add-ons:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64:/usr/local/Ascend/ascend-toolkit/latest/acllib/lib64:/usr/local/Ascend/ascend-toolkit/latest/atc/lib64:${LD_LIBRARY_PATH}
1111
ENV ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest
12+
ENV HCCL_NPU_SOCKET_PORT_RANGE=auto
1213

1314
RUN apt-get update -y && \
1415
apt-get install -y --no-install-recommends \
@@ -26,8 +27,8 @@ RUN pip config set global.index-url https://mirrors.huaweicloud.com/repository/p
2627

2728
WORKDIR /workspace
2829

29-
RUN git clone --depth 1 -b v0.13.0 https://github.com/vllm-project/vllm.git && \
30-
git clone --depth 1 -b releases/v0.13.0 https://github.com/vllm-project/vllm-ascend.git
30+
RUN git clone --depth 1 -b v0.18.0 https://github.com/vllm-project/vllm.git && \
31+
git clone --depth 1 -b v0.18.0 https://github.com/vllm-project/vllm-ascend.git
3132

3233
RUN cd vllm && \
3334
pip install -r requirements/build.txt && \
@@ -36,7 +37,7 @@ RUN cd vllm && \
3637
pip cache purge && \
3738
cd ..
3839

39-
RUN pip install torch==2.8.0+cpu torchvision==0.23.0 torchaudio==2.8.0 \
40+
RUN pip install torch==2.9.0+cpu torchvision==0.24.0 torchaudio==2.9.0 \
4041
--index-url https://download.pytorch.org/whl/cpu
4142

4243
RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
@@ -50,17 +51,18 @@ COPY . .
5051

5152
RUN pip install -r requirements_common.txt
5253

53-
RUN pip install "deepspeed==0.16.4" "transformers==4.57.6" "tensorboard==2.20.0"
54+
RUN pip install "transformers==4.57.6" "tensorboard==2.20.0"
5455

5556
RUN pip install -e .
5657

5758
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
5859
pip uninstall -y triton && \
5960
pip uninstall -y triton-ascend && \
60-
pip install triton-ascend==3.2.0 && \
61+
pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
6162
pip cache purge
6263

6364
RUN echo "source /usr/local/Ascend/ascend-toolkit/set_env.sh" >> /root/.bashrc && \
64-
echo "source /usr/local/Ascend/nnal/atb/set_env.sh" >> /root/.bashrc
65+
echo "source /usr/local/Ascend/nnal/atb/set_env.sh" >> /root/.bashrc && \
66+
echo "export HCCL_NPU_SOCKET_PORT_RANGE=auto" >> /root/.bashrc
6567

66-
CMD ["/bin/bash"]
68+
CMD ["/bin/bash"]

docs_roll/docs/User Guides/Hardware Support/ascend_docker_usage.md

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
Last updated: 04/27/2026.
44

5-
This guide explains how to build and run ROLL on **Huawei Ascend NPU** using `Dockerfile.A2` and `Dockerfile.A3`.
5+
This guide explains how to get, build, and run ROLL images on **Huawei Ascend NPU**. Prefer the pre-built image when possible; use `Dockerfile.A2` or `Dockerfile.A3` when you need to customize dependencies.
66

77
## Hardware & Software Requirements
88

99
| Item | Dockerfile.A2 | Dockerfile.A3 |
1010
| ---- | ------------- | ------------- |
1111
| Hardware | Atlas 900 A2 PODc (Ascend 910B1) | Atlas 900 A3 PODc (Ascend 910_9391) |
1212
| Host OS | Ubuntu 22.04 | Ubuntu 22.04 |
13-
| CANN | 8.5.1 | 8.5.1 |
13+
| CANN | 9.0.0 | 9.0.0 |
1414
| Python | 3.11 | 3.11 |
1515
| Docker | >= 20.10 | >= 20.10 |
1616
| Ascend NPU Driver | Installed on host | Installed on host |
@@ -21,21 +21,42 @@ Both Dockerfiles install the same versions of core dependencies:
2121

2222
| Component | Version |
2323
| --------- | ------- |
24-
| PyTorch | 2.8.0+cpu |
25-
| vLLM | 0.13.0 |
26-
| vLLM-Ascend | 0.13.0 |
27-
| DeepSpeed | 0.16.4 |
24+
| PyTorch | 2.9.0+cpu |
25+
| vLLM | 0.18.0 |
26+
| vLLM-Ascend | 0.18 |
2827
| Transformers | 4.57.6 |
29-
| triton-ascend | 3.2.0 |
28+
| triton-ascend | 3.2.1 |
3029

3130
The primary difference is the base image and SOC version:
3231

3332
| Item | Dockerfile.A2 | Dockerfile.A3 |
3433
| ---- | ------------- | ------------- |
35-
| Base Image | `quay.io/ascend/cann:8.5.1-910b-ubuntu22.04-py3.11` | `quay.io/ascend/cann:8.5.1-a3-ubuntu22.04-py3.11` |
34+
| Base Image | `quay.io/ascend/cann:9.0.0-910b-ubuntu22.04-py3.11` | `quay.io/ascend/cann:9.0.0-a3-ubuntu22.04-py3.11` |
3635
| SOC_VERSION | `ascend910b1` | `ascend910_9391` |
3736

38-
## Build the Docker Image
37+
## Get the Docker Image
38+
39+
### Option A: Use the Pre-built Image (Recommended)
40+
41+
Pull the image that matches your hardware, then tag it with the local name used by the commands below:
42+
43+
**For Atlas 900 A2 PODc (Ascend 910B1):**
44+
45+
```bash
46+
docker pull quay.io/ascend/roll:main-a2
47+
docker tag quay.io/ascend/roll:main-a2 roll:ascend-a2
48+
```
49+
50+
**For Atlas 900 A3 PODc (Ascend 910_9391):**
51+
52+
```bash
53+
docker pull quay.io/ascend/roll:main-a3
54+
docker tag quay.io/ascend/roll:main-a3 roll:ascend-a3
55+
```
56+
57+
Check https://quay.io/repository/ascend/roll?tab=tags for available image tags. If you use a pre-built image, continue with [Run the Container](#run-the-container).
58+
59+
### Option B: Build from Dockerfile
3960

4061
### 1. Clone the ROLL Repository
4162

@@ -88,6 +109,7 @@ docker run -dit \
88109
--device /dev/davinci4 \
89110
--device /dev/davinci5 \
90111
--device /dev/davinci6 \
112+
--device /dev/davinci7 \
91113
--device /dev/davinci_manager \
92114
--device /dev/devmm_svm \
93115
--device /dev/hisi_hdc \
@@ -115,6 +137,37 @@ docker run -dit \
115137
--device /dev/davinci4 \
116138
--device /dev/davinci5 \
117139
--device /dev/davinci6 \
140+
--device /dev/davinci7 \
141+
--device /dev/davinci_manager \
142+
--device /dev/devmm_svm \
143+
--device /dev/hisi_hdc \
144+
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
145+
-v /usr/local/Ascend/add-ons:/usr/local/Ascend/add-ons \
146+
-v /usr/local/dcmi:/usr/local/dcmi \
147+
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
148+
-v /etc/ascend_install.info:/etc/ascend_install.info \
149+
-v /home/$USER:/home/$USER \
150+
--ipc=host \
151+
--net=host \
152+
roll:ascend-a3 \
153+
/bin/bash
154+
```
155+
156+
### Multi-NPU Startup (Recommended for Training)
157+
158+
For multi-NPU training, mount all available NPU devices. Adjust the number of `--device /dev/davinciX` entries according to the NPU count on your node:
159+
160+
```bash
161+
docker run -dit \
162+
--name roll_ascend \
163+
--device /dev/davinci0 \
164+
--device /dev/davinci1 \
165+
--device /dev/davinci2 \
166+
--device /dev/davinci3 \
167+
--device /dev/davinci4 \
168+
--device /dev/davinci5 \
169+
--device /dev/davinci6 \
170+
--device /dev/davinci7 \
118171
--device /dev/davinci_manager \
119172
--device /dev/devmm_svm \
120173
--device /dev/hisi_hdc \
@@ -124,12 +177,20 @@ docker run -dit \
124177
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
125178
-v /etc/ascend_install.info:/etc/ascend_install.info \
126179
-v /home/$USER:/home/$USER \
180+
-v /path/to/models:/path/to/models \
181+
-v /path/to/data:/path/to/data \
127182
--ipc=host \
128183
--net=host \
129184
roll:ascend-a3 \
130185
/bin/bash
131186
```
132187

188+
> **Note:**
189+
> - `--device /dev/davinciX`: Mounts NPU devices. Add or remove entries based on available NPU count.
190+
> - `--device /dev/davinci_manager`, `--device /dev/devmm_svm`, `--device /dev/hisi_hdc`: Required management devices for Ascend NPU.
191+
> - `-v /usr/local/Ascend/driver`: Mounts the host Ascend driver.
192+
> - `-v /path/to/models` and `-v /path/to/data`: Mount model weights and training data directories as needed.
193+
133194
### Enter the Container
134195

135196
```bash
@@ -152,7 +213,7 @@ npu-smi info
152213
env | grep -E "ASCEND|LD_LIBRARY_PATH|PATH"
153214

154215
# Verify Python packages
155-
python -c "import torch; import torch_npu; print(torch_npu.npu.is_available())"
216+
python -c "import torch; import torch_npu; print(torch.npu.is_available())"
156217
python -c "import vllm; print(f'vllm: {vllm.__version__}')"
157218
python -c "import vllm_ascend; print(f'vllm_ascend available')"
158219
```
@@ -161,20 +222,21 @@ python -c "import vllm_ascend; print(f'vllm_ascend available')"
161222

162223
### Important Configuration Notes
163224

164-
Since Megatron-LM training is not yet supported on Ascend NPU, you need to use **DeepSpeed** as the training backend. Make sure your configuration files use the following settings:
225+
Since Megatron-LM is not supported on Ascend NPU, you need to use **FSDP2** as the training backend. Make sure your configuration files use the following settings:
165226

166-
1. Set `strategy_args` to use DeepSpeed
167-
2. Set `device_mapping` to ensure training and inference are performed on different NPUs
227+
1. Set `strategy_args` to use FSDP2
168228

169229
### Example: RLVR Pipeline
170230

171231
```bash
172232
# After modifying model paths and adjusting device_mapping
173233
python examples/start_rlvr_pipeline.py \
174234
--config_path ascend_examples \
175-
--config_name qwen3_8b_rlvr_deepspeed
235+
--config_name qwen3_30b_rlvr_fsdp2
176236
```
177237

238+
> **Note:** The `qwen3_30b_rlvr_fsdp2` configuration is specifically designed for Ascend NPU with FSDP2 as the training backend. Adjust `device_mapping` in the configuration file according to your NPU topology.
239+
178240
## Troubleshooting
179241

180242
### NPU Not Visible Inside Container

docs_roll/docs/User Guides/Hardware Support/ascend_npu_env_config.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ These variables control the behavior of HCCL (Huawei Collective Communication Li
7979
| `HCCL_DETERMINISTIC` | `false` | Disable deterministic computation. Enabling it significantly reduces communication performance |
8080
| `HCCL_OP_EXPANSION_MODE` | `"AIV"` | Communication algorithm dispatch location. `AIV` uses Vector Core, outperforms `AI_CPU`/`HOST`/`HOST_TS` |
8181
| `HCCL_BUFFSIZE` | e.g. `"2147483648"` | HCCL communication buffer size in bytes. Increase for large data volume scenarios |
82+
| `HCCL_NPU_SOCKET_PORT_RANGE` | `auto` | Allow HCCL to allocate non-default device-side NIC ports when multiple worker processes run on the same NPU |
8283
| `HCCL_IF_IP` | Node's IP address | Specify the IP address used by HCCL for inter-node communication. Required for multi-node training |
8384
| `HCCL_SOCKET_IFNAME` | e.g. `"enp194s0f0"` | Network interface name for HCCL socket communication. Must be consistent across all nodes |
8485
| `HCCL_IF_BASE_PORT` | e.g. `23456` | Base port for HCCL inter-node communication. Ensure ports are not blocked by firewall |
@@ -90,6 +91,7 @@ Example (single-node):
9091
export HCCL_CONNECT_TIMEOUT=3600
9192
export HCCL_DETERMINISTIC=false
9293
export HCCL_OP_EXPANSION_MODE="AIV"
94+
export HCCL_NPU_SOCKET_PORT_RANGE="auto"
9395
```
9496

9597
Example (multi-node):
@@ -99,6 +101,7 @@ export HCCL_CONNECT_TIMEOUT=3600
99101
export HCCL_EXEC_TIMEOUT=3600
100102
export HCCL_DETERMINISTIC=false
101103
export HCCL_OP_EXPANSION_MODE="AIV"
104+
export HCCL_NPU_SOCKET_PORT_RANGE="auto"
102105
export HCCL_IF_IP=$(hostname -I | awk '{print $1}')
103106
export HCCL_SOCKET_IFNAME="enp194s0f0"
104107
export HCCL_IF_BASE_PORT=23456
@@ -151,8 +154,7 @@ export CPU_AFFINITY_CONF=1,npu0:0-1,npu1:2-3,npu2:4-5,npu3:6-7
151154
| `VLLM_USE_V1` | `1` | Enable vLLM V1 architecture. Required for vLLM-Ascend |
152155
| `VLLM_ATTENTION_BACKEND` | `XFORMERS` | vLLM attention computation backend |
153156
| `VLLM_ASCEND_ENABLE_FLASHCOMM` | `1` | Enable Ascend FlashComm high-speed communication optimization |
154-
| `VLLM_ASCEND_ENABLE_DENSE_OPTIMIZE` | `1` | Enable dense computation optimization for large model inference |
155-
| `VLLM_ASCEND_ENABLE_PREFETCH_MLP` | `1` | Enable MLP layer weight prefetching |
157+
| `VLLM_ASCEND_ENABLE_PREFETCH_MLP` | `1` | Enable MLP layer weight prefetching. This replaces the older dense optimize toggle in current vLLM-Ascend releases. |
156158
| `VLLM_ASCEND_ENABLE_TOPK_OPTIMIZE` | `1` | Enable TopK operator fusion optimization for generation decoding |
157159
| `VLLM_ASCEND_MODEL_EXECUTE_TIME_OBSERVE` | `1` | Print prefill/decode phase timing details (for debugging) |
158160
| `VLLM_ASCEND_TRACE_RECOMPILES` | `1` | Trace operator recompilation for debugging performance issues |
@@ -164,7 +166,6 @@ Example:
164166
export VLLM_USE_V1=1
165167
export VLLM_ATTENTION_BACKEND=XFORMERS
166168
export VLLM_ASCEND_ENABLE_FLASHCOMM=1
167-
export VLLM_ASCEND_ENABLE_DENSE_OPTIMIZE=1
168169
export VLLM_ASCEND_ENABLE_PREFETCH_MLP=1
169170
```
170171

@@ -243,7 +244,6 @@ export OMP_NUM_THREADS=1
243244
# vLLM-Ascend inference
244245
export VLLM_USE_V1=1
245246
export VLLM_ASCEND_ENABLE_FLASHCOMM=1
246-
export VLLM_ASCEND_ENABLE_DENSE_OPTIMIZE=1
247247
export VLLM_ASCEND_ENABLE_PREFETCH_MLP=1
248248

249249
# Operator compilation cache

0 commit comments

Comments
 (0)