verl x 昇腾 (Ascend) =================================== 最后更新:09/25/2025。 我们在 verl 中增加了对华为昇腾 (Ascend) 设备的支持。 硬件支持 ----------------------------------- Atlas 200T A2 Box16 Atlas 900 A2 PODc Atlas 800T A3 安装 ----------------------------------- 基础环境准备 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-----------+-------------+ | software | version | +-----------+-------------+ | Python | == 3.11 | +-----------+-------------+ | CANN | == 8.3.RC1 | +-----------+-------------+ | HDK | == 25.3.RC1 | +-----------+-------------+ | torch | == 2.6.0 | +-----------+-------------+ | torch_npu | == 2.6.0 | +-----------+-------------+ **目前 verl 框架中 sglang npu 后端仅支持上述 HDK、CANN 和 PTA 版本,商用版本预计 2025 年 10 月发布。** 为了能在 verl 中正常使用 sglang,需使用以下命令安装 sglang、torch_memory_saver 和 verl。 sglang ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash # sglang git clone https://github.com/sgl-project/sglang.git cd sglang mv python/pyproject.toml python/pyproject.toml.backup mv python/pyproject_other.toml python/pyproject.toml pip install -e "python[srt_npu]" 安装 torch_memory_saver ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash # torch_memory_saver git clone https://github.com/sgl-project/sgl-kernel-npu.git cd sgl-kernel-npu bash build.sh -a memory-saver pip install output/torch_memory_saver*.whl 安装 verl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash git clone https://github.com/volcengine/verl.git cd verl pip install --no-deps -e . pip install -r requirements-npu.txt 其他三方库说明 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +--------------+---------------+ | software | description | +--------------+---------------+ | transformers | v4.56.1 | +--------------+---------------+ | triton_ascend| v3.2.0 | +--------------+---------------+ 1. sglang 依赖 transformers v4.56.1 2. sglang 依赖 triton_ascend v3.2.0 3. 暂不支持多模态模型,请卸载相关安装包 torchvision、timm .. code-block:: bash pip uninstall torchvision pip uninstall timm pip uninstall triton pip install transformers==4.56.1 pip install -i https://test.pypi.org/simple/ triton-ascend==3.2.0.dev20250925 快速开始 ----------------------------------- 正式使用前,建议您通过对 Qwen3-8B GRPO 的训练尝试,以检验环境准备和安装的正确性。 1. 下载数据集并将数据集预处理为 parquet 格式,以便包含计算 RL 奖励所需的必要字段 .. code-block:: bash python3 examples/data_preprocess/gsm8k.py --local_save_dir ~/data/gsm8k 2. 执行训练 .. code-block:: bash bash verl/examples/grpo_trainer/run_qwen3_8b_grpo_sglang_1k_npu.sh