VLM Qwen2.5VL GRPO训练微调 EasyR1 多机多卡训练(2)
在之前博客进行了简单的训练尝试:https://www.dong-blog.fun/post/2060
在本博客,将会深入进行多机多卡训练,以及调整训练奖励函数。
之前构建了镜像: docker build . -t kevinchina/deeplearning:r1
FROM hiyouga/verl:ngc-th2.6.0-cu126-vllm0.8.4-flashinfer0.2.2-cxx11abi0
WORKDIR /workplace
RUN git clone https://github.com/hiyouga/EasyR1.git
WORKDIR /workplace/EasyR1
RUN pip install -e . -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
RUN pip install swanlab -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
多机多卡的rbma通信条件在这个镜像也具备: apt-get install libibverbs1 -y
verl 依托于 Ray, 所以多机多卡使用需要使用Ray进行训练,Ray和torchrun的原理也差不多。Ray在master节点启动head,在子节点启动服务,然后由Ray统一任务调度。
所以官网教程有: