Frequently Asked Questions
Distributed training
How to run multi-node post-training with Ray?
You can start a ray cluster and submit a ray job, following the official guide from Ray: https://docs.ray.io/en/latest/ray-core/starting-ray.html
Then in the configuration, set the trainer.nnode config to the number of machines for your job.
How to use verl on a Slurm-managed cluster?
Ray provides users with this official tutorial to start a Ray cluster on top of Slurm. We have verified the GSM8K example on a Slurm cluster under a multi-node setting with the following steps.
1. [Optional] If your cluster support Apptainer or Singularity and you wish to use it, convert verl’s Docker image to an Apptainer image. Alternatively, set up the environment with the package manager available on your cluster or use other container runtimes (e.g. through Slurm’s OCI support) available to you.
apptainer pull /your/dest/dir/vemlp-th2.4.0-cu124-vllm0.6.3-ray2.10-te1.7-v0.0.3.sif docker://verlai/verl:vemlp-th2.4.0-cu124-vllm0.6.3-ray2.10-te1.7-v0.0.3
Follow GSM8K example to prepare the dataset and model checkpoints.
Modify examples/slurm/ray_on_slurm.slurm with your cluster’s own information.
Submit the job script to the Slurm cluster with sbatch.
Please note that Slurm cluster setup may vary. If you encounter any issues, please refer to Ray’s Slurm user guide for common caveats.
If you changed Slurm resource specifications, please make sure to update the environment variables in the job script if necessary.
Illegal memory access
If you encounter the error message like CUDA error: an illegal memory access was encountered during rollout, most likely it is due to a known issue from vllm.
Please set the following environment variable. The env var must be set before the ray start command if any.
export VLLM_ATTENTION_BACKEND=XFORMERS
If in doubt, print this env var in each rank to make sure it is properly set.
Checkpoints
If you want to convert the model checkpoint into huggingface safetensor format, please refer to scripts/model_merger.py.