|
| 1 | +# ROLL x Ascend |
| 2 | + |
| 3 | +Last updated: 09/28/2025. |
| 4 | + |
| 5 | +We have added support for Huawei Ascend devices in ROLL. |
| 6 | + |
| 7 | +## Hardware Support |
| 8 | + |
| 9 | +Atlas 900 A2 PODc |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +### Basic Environment Setup |
| 14 | + |
| 15 | +| Software | Version | |
| 16 | +| -------- | ------- | |
| 17 | +| Python | 3.10 | |
| 18 | +| CANN | 8.1.RC1 | |
| 19 | + |
| 20 | +### Create Conda Environment |
| 21 | + |
| 22 | +Use the following commands to create a new conda environment in Miniconda: |
| 23 | + |
| 24 | +``` |
| 25 | +conda create --name roll python=3.10 |
| 26 | +conda activate roll |
| 27 | +``` |
| 28 | + |
| 29 | +### Install torch & torch_npu |
| 30 | + |
| 31 | +To use torch and torch_npu in ROLL, install them using the commands below: |
| 32 | + |
| 33 | +``` |
| 34 | +# Install CPU version of torch |
| 35 | +pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu |
| 36 | +
|
| 37 | +# Install torch_npu |
| 38 | +pip install torch_npu==2.5.1 |
| 39 | +``` |
| 40 | + |
| 41 | +### Install vllm & vllm-ascend |
| 42 | + |
| 43 | +To use vllm in ROLL, compile and install vllm and vllm-ascend as follows: |
| 44 | + |
| 45 | +``` |
| 46 | +# vllm |
| 47 | +git clone -b v0.8.4 --depth 1 https://github.com/vllm-project/vllm.git |
| 48 | +cd vllm |
| 49 | +
|
| 50 | +VLLM_TARGET_DEVICE=empty pip install -v -e . |
| 51 | +cd .. |
| 52 | +# vllm-ascend |
| 53 | +git clone -b v0.8.4rc2 --depth 1 https://github.com/vllm-project/vllm-ascend.git |
| 54 | +cd vllm-ascend |
| 55 | +
|
| 56 | +export COMPILE_CUSTOM_KERNELS=1 |
| 57 | +pip install -e . |
| 58 | +cd .. |
| 59 | +``` |
| 60 | + |
| 61 | +If you encounter an error like this during the vllm-ascend installation: |
| 62 | + |
| 63 | +``` |
| 64 | +RuntimeError: CMake configuration failed: Command '['/pathto/miniconda3/envs/roll/bin/python3.10', '-m', 'pybind11', '--cmake']' returned non-zero exit status 2. |
| 65 | +``` |
| 66 | + |
| 67 | +Try modifying lines 151–158 in `setup.py` under the vllm-ascend directory as follows, then recompile: |
| 68 | + |
| 69 | +``` |
| 70 | +try: |
| 71 | + # if pybind11 is installed via pip |
| 72 | + pybind11_cmake_path = (subprocess.check_output( |
| 73 | + [python_executable, "-m", "pybind11", |
| 74 | + "--cmakedir"]).decode().strip()) |
| 75 | +except subprocess.CalledProcessError as e: |
| 76 | + # else specify pybind11 path installed from source code on CI container |
| 77 | + raise RuntimeError(f"CMake configuration failed: {e}") |
| 78 | +``` |
| 79 | + |
| 80 | +### Install ROLL |
| 81 | + |
| 82 | +``` |
| 83 | +git clone https://github.com/alibaba/ROLL.git |
| 84 | +cd ROLL |
| 85 | +pip install -r requirements_common.txt |
| 86 | +pip install deepspeed==0.16.0 |
| 87 | +cd .. |
| 88 | +``` |
| 89 | + |
| 90 | +### Additional Third-Party Libraries |
| 91 | + |
| 92 | +| Software | Description | |
| 93 | +| --------------------------- | ------------- | |
| 94 | +| transformers | v4.52.4 | |
| 95 | +| flash_attn | not supported | |
| 96 | +| transformer-engine[pytorch] | not supported | |
| 97 | + |
| 98 | +1. `transformers` v4.52.4 supports enabling `--flash_attention_2`. |
| 99 | +2. `flash_attn` acceleration is not supported. |
| 100 | +3. `transformer-engine[pytorch]` is currently not supported. |
| 101 | + |
| 102 | +``` |
| 103 | +pip install transformers==4.52.4 |
| 104 | +``` |
| 105 | + |
| 106 | +## Quick Start: Single-Node Deployment |
| 107 | + |
| 108 | +Before full usage, we recommend testing the single-node pipeline to verify your environment and installation. |
| 109 | +Since Megatron-LM training is not yet supported, first change `strategy_args` in the relevant files to use the `deepspeed` option. |
| 110 | + |
| 111 | +1. Run the single-node pipeline via shell: |
| 112 | + |
| 113 | +``` |
| 114 | +bash examples/agentic_demo/run_agentic_pipeline_frozen_lake_single_node_demo.sh |
| 115 | +``` |
| 116 | + |
| 117 | +2. Run the agentic pipeline using a config file: |
| 118 | + |
| 119 | +``` |
| 120 | +# Make sure you are in the root directory of the ROLL project |
| 121 | +# export PYTHONPATH=$(pwd):$PYTHONPATH |
| 122 | +
|
| 123 | +python examples/start_agentic_pipeline.py \ |
| 124 | + --config_path qwen2.5-0.5B-agentic \ |
| 125 | + --config_name agentic_val_sokoban |
| 126 | +``` |
| 127 | + |
| 128 | +- `--config_path` – Directory containing your YAML configuration files. |
| 129 | +- `--config_name` – Filename (without the `.yaml` extension). |
| 130 | + |
| 131 | +## Current Support Status |
| 132 | + |
| 133 | +| Feature | Example | Training Backend | Inference Backend | Hardware | |
| 134 | +| --------------- | ------------------------------------------------------------ | ---------------- | ----------------- | ----------------- | |
| 135 | +| Agentic | examples/qwen2.5-0.5B-agentic/run_agentic_pipeline_sokoban.sh | DeepSpeed | vLLM | Atlas 900 A2 PODc | |
| 136 | +| Agentic-Rollout | examples/qwen2.5-0.5B-agentic/run_agentic_rollout_sokoban.sh | DeepSpeed | vLLM | Atlas 900 A2 PODc | |
| 137 | +| DPO | examples/qwen2.5-3B-dpo_megatron/run_dpo_pipeline.sh | DeepSpeed | vLLM | Atlas 900 A2 PODc | |
| 138 | +| RLVR | examples/qwen2.5-7B-rlvr_megatron/run_rlvr_pipeline.sh | DeepSpeed | vLLM | Atlas 900 A2 PODc | |
| 139 | + |
| 140 | +## Disclaimer |
| 141 | + |
| 142 | +The Ascend support provided in ROLL is intended as a reference example. For production use, please consult official channels. |
0 commit comments