Skip to content

About

verl on RTX PRO 6000 Blackwell 部署指南 + GRPO 验证实验

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

verl on RTX PRO 6000 Blackwell 部署指南

在 AutoDL 的 8×RTX PRO 6000 Blackwell (sm_120) 服务器上从零部署 verl,包含完整踩坑记录和 GRPO 验证实验。

目录


环境信息

项目 详情
GPU 8× NVIDIA RTX PRO 6000 Blackwell Server Edition
GPU 架构 sm_120 (Blackwell)
GPU 显存 98GB / 卡
CUDA 13.0
NVIDIA Driver 580.95.05 / 580.119.02
平台 AutoDL
系统盘 30GB(很小,容易满)

已验证软件版本

软件 版本 备注
Python 3.12 conda 创建
PyTorch 2.10.0+cu128 由 vllm 拉入
vllm 0.17.1
transformers 4.57.6
swanlab 0.7.11 可选,实验追踪
flash_attn 不安装 Blackwell 不兼容,详见踩坑

踩坑记录

坑 1: flash_attn —— 不要装!

现象链:

  1. verl 默认 use_remove_padding: true,会调用 unpad_input() → 依赖 flash_attn.bert_padding
  2. 没装 flash_attn → ModuleNotFoundError: No module named 'flash_attn'
  3. 装预编译 wheel (cu12torch2.8) → ABI 不兼容,vLLM 引擎崩溃
  4. 从源码编译 → Blackwell sm_120 太新,编译失败

解决方案:不装 flash_attn,用 PyTorch SDPA 替代

# 确保没装
pip uninstall flash-attn -y

# 训练脚本中加两个配置
actor_rollout_ref.model.use_remove_padding=False
+actor_rollout_ref.model.override_config.attn_implementation=eager

坑 2: 系统盘 30GB 满

现象:[Errno 28] No space left on device

AutoDL 系统盘只有 30GB,pip 缓存 + Ray 临时文件很快就满了。

解决方案:

# 清 pip 缓存(释放 ~5GB)
pip cache purge

# Ray 临时目录指向数据盘
export RAY_TMPDIR=/root/autodl-tmp/ray_tmp
mkdir -p $RAY_TMPDIR

坑 3: Hydra override 语法

现象:Could not override 'xxx'. Key 'yyy' is not in struct

verl 用 Hydra 管理配置,新增配置项必须用 + 前缀:

# 错误 ❌
actor_rollout_ref.model.override_config.attn_implementation=eager

# 正确 ✅
+actor_rollout_ref.model.override_config.attn_implementation=eager

坑 4: use_remove_padding 共享配置

现象:单独设 ref 的 use_remove_padding 报错

Could not override 'actor_rollout_ref.ref.model.use_remove_padding'.
Key 'model' is not in struct

ref 模型没有独立的 model 子配置,它共享 actor_rollout_ref.model。只需设一次:

actor_rollout_ref.model.use_remove_padding=False  # 同时作用于 actor 和 ref

坑 5: PyTorch sm_120 不兼容

现象:NVIDIA RTX PRO 6000 Blackwell with CUDA capability sm_120 is not compatible with the current PyTorch installation

解决方案:需要 PyTorch nightly + cu130(但后续 pip install vllm 会覆盖为 2.10.0+cu128,也能用)

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130

手动安装步骤

# 1. 网络加速(AutoDL 专用)
source /etc/network_turbo

# 2. 创建 conda 环境
conda create -n verl python=3.12 -y
source /root/miniconda3/etc/profile.d/conda.sh
conda activate verl

# 3. 克隆 verl
cd /root/autodl-tmp
git clone https://github.com/volcengine/verl.git
cd verl

# 4. 安装 verl(跳过 megatron)
USE_MEGATRON=0 bash scripts/install_vllm_sglang_mcore.sh

# 5. Blackwell GPU: 先装 PyTorch nightly cu130
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130

# 6. 升级 vllm 到最新(会覆盖 torch 为 2.10.0+cu128)
pip install vllm

# 7. 不要装 flash_attn!
# pip install flash-attn  # ← 不要执行

# 8. 修复 transformers/tokenizers 版本
pip install 'transformers>=4.55.2' 'tokenizers>=0.21.1'

# 9. (可选)安装实验追踪
pip install swanlab

# 10. 环境变量
export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1
export RAY_TMPDIR=/root/autodl-tmp/ray_tmp
mkdir -p $RAY_TMPDIR

# 11. 清理系统盘空间
pip cache purge

# 12. 验证安装
python -c "import torch; print(f'PyTorch {torch.__version__}, CUDA {torch.version.cuda}')"
python -c "import vllm; print(f'vLLM {vllm.__version__}')"
python -c "import verl; print('verl OK')"

一键安装

bash scripts/install_verl.sh

详见 scripts/install_verl.sh


GRPO 验证实验

用简单算术加法任务验证 verl GRPO 训练管线是否正常工作。

实验设计

项目 详情
模型 Qwen2.5-0.5B (base)
任务 两位/三位数加法
训练数据 2048 条
验证数据 128 条
算法 GRPO, rollout.n=8
GPU 8 卡并行
训练时间 ~9 分钟

训练结果

8 卡训练 (48 steps, 3 epochs):

  • score/mean: 0.169 (step 1) → 0.932 (step 48)
  • 8 卡 GPU 利用率 94-99%,每卡 ~7.7GB 显存

训练前后对比

指标 训练前 (Qwen2.5-0.5B base) 训练后 (GRPO 3 epochs) 变化
Accuracy 0.78% (1/128) 92.19% (118/128) +91.41%
Format Rate 49.22% (63/128) 100% (128/128) +50.78%
Reward Mean 0.056 0.930 +0.874

运行实验

cd grpo_proof/

# 1. 生成数据
python gen_arithmetic_data.py --train_size 2048 --output_dir ./data

# 2. 测试奖励函数
python arithmetic_reward.py

# 3. 8 卡 GRPO 训练
bash run_arithmetic_grpo.sh

# 4. 训练前后对比评估
python eval_before_after.py \
  --base_model /path/to/Qwen2.5-0.5B \
  --output_dir ./output \
  --val_data ./data/val.parquet

文件说明

文件 说明
gen_arithmetic_data.py 生成 verl 格式的算术训练/验证数据
arithmetic_reward.py 规则奖励函数(正确=1.0, 有数字=0.1, 无输出=0.0)
run_arithmetic_grpo.sh 8 卡 GRPO 训练启动脚本
eval_before_after.py vLLM 推理 + 训练前后对比评估

致谢

  • verl - 字节跳动开源的 RL 训练框架
  • Qwen2.5 - 通义千问基座模型
  • AutoDL - GPU 云服务器

About

verl on RTX PRO 6000 Blackwell 部署指南 + GRPO 验证实验

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages