Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added _static/images/roll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
sources/torchtitan/index.rst
sources/sglang/index.rst
sources/verl/index.rst
sources/roll/index.rst


选择您的偏好,并按照 :doc:`快速安装昇腾环境<sources/ascend/quick_install>` 的安装指导进行操作。
Expand Down Expand Up @@ -430,6 +431,24 @@
<span class="split">|</span>
<a href="sources/verl/quick_start.html">快速上手</a>
</div>
</div>
</div>
<!-- Card 22 -->
<div class="box rounded-lg p-4 flex flex-col items-center">
<div class="flex items-center mb-4">
<div class="img w-16 h-16 rounded-md mr-4" style="background-image: url('_static/images/roll.png')"></div>
<div>
<h2 class="text-lg font-semibold">ROLL</h2>
<p class="text-gray-600 desc">大规模学习的强化学习优化</p>
</div>
</div>
<div class="flex-grow"></div>
<div class="flex space-x-4 text-blue-600">
<a href="https://github.com/alibaba/ROLL ">官方链接</a>
<span class="split">|</span>
<a href="sources/roll/install.html">安装指南</a>
<span class="split">|</span>
<a href="sources/roll/quick_start.html">快速上手</a>
</div>
</div>
</div>
</div>
8 changes: 8 additions & 0 deletions sources/roll/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
roll
============

.. toctree::
:maxdepth: 2

install.rst
quick_start.rst
126 changes: 126 additions & 0 deletions sources/roll/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
安装指南
==============

本教程面向使用 roll & Ascend 的开发者,帮助完成昇腾环境下 roll 的安装。

昇腾环境安装
------------

请根据已有昇腾产品型号及 CPU 架构等按照 :doc:`快速安装昇腾环境指引 <../ascend/quick_install>` 进行昇腾环境安装。

.. warning::
CANN 最低版本为 8.2.RC1,安装 CANN 时,请同时安装 Kernel 算子包以及 nnal 加速库软件包。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this limitation from vLLM-Ascend?


Python 环境创建
----------------------

.. code-block:: shell
:linenos:

# 创建名为 roll 的 python 3.10 的虚拟环境
conda create -y -n roll python=3.10
# 激活虚拟环境
conda activate roll

Torch 安装创建
----------------------

.. code-block:: shell
:linenos:

# 安装 torch 的 CPU 版本
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu

# 安装 torch_npu
pip install torch_npu==2.5.1

vllm & vllm-ascend 安装
----------------------

.. code-block:: shell
:linenos:

# vllm
git clone -b v0.8.4 --depth 1 https://github.com/vllm-project/vllm.git
cd vllm

VLLM_TARGET_DEVICE=empty pip install -v -e .
cd ..


.. code-block:: shell
:linenos:

# vllm-ascend
git clone -b v0.8.4rc2 --depth 1 https://github.com/vllm-project/vllm-ascend.git
cd vllm-ascend

export COMPILE_CUSTOM_KERNELS=1
pip install -e .
cd ..

如果在安装 vllm-ascend 时遇到类似以下问题:

.. code-block:: shell
:linenos:

RuntimeError: CMake configuration failed: Command '['/pathto/miniconda3/envs/roll/bin/python3.10', '-m', 'pybind11', '--cmake']' returned non-zero exit status 2.

可尝试在 vllm-ascend 目录下 setup.py 文件 151-158 行进行如下修改并重新进行编译:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, installing vLLM version 0.8.4 is a bit complicated. Later, once version 0.11 is supported, we’ll also update the documentation.


.. code-block:: shell
:linenos:

try:
# if pybind11 is installed via pip
pybind11_cmake_path = (subprocess.check_output(
[python_executable, "-m", "pybind11",
"--cmakedir"]).decode().strip())
except subprocess.CalledProcessError as e:
# else specify pybind11 path installed from source code on CI container
raise RuntimeError(f"CMake configuration failed: {e}")

安装 roll
----------------------

使用以下指令安装 roll 及相关依赖:

.. code-block:: shell
:linenos:

git clone https://github.com/alibaba/ROLL.git
cd ROLL

# Install roll dependencies
pip install -r requirements_common.txt
pip install deepspeed==0.16.0


其他第三方库说明
----------------------

.. list-table::
:header-rows: 1
:widths: 30 20

* - Software
- Description
* - transformers
- v4.52.4
* - flash_attn
- not supported
* - transformer-engine[pytorch]
- not supported


1. 支持通过 transformers 使能 --flash_attention_2, transformers 需等于 4.52.4版本。

2. 不支持通过 flash_attn 使能 flash attention 加速。

3. 暂不支持 transformer-engine[pytorch]。


.. code-block:: shell
:linenos:

pip install transformers==4.52.4
Loading