Skip to content

Support for GRPO multi-GPU training with Qwen2.5? #3901

Closed

Description

@ChengHu98

Hi Unsloth team,

Thanks for the amazing work on Unsloth – it has been extremely helpful for efficient LLM training.

I’m currently working on a project that uses GRPO (as in TRL’s GRPOTrainer / RL-style optimization) to fine-tune Qwen2.5 models (e.g., Qwen2.5-3B / 7B). On a single GPU everything works well, but I would like to scale the training to multiple GPUs.

My questions are:

  1. Does Unsloth currently support GRPO-style training on multiple GPUs (e.g., via DDP / Accelerate / FSDP)?
  2. Are there any example scripts or recommended patterns for running GRPO with Qwen2.5 on multi-GPU setups?
  3. If not yet supported, is this something on the roadmap, or are there known limitations that prevent GRPO from working in a multi-GPU setting with Unsloth?

Any guidance, pointers, or example code would be greatly appreciated.

Best regards,

Activity

  1. self-assigned this
    on Oct 9, 2026
  2. danielhanchen commented on Oct 9, 2026

    @danielhanchen
    Member

    Fixed! Sorry on the delay. GRPO now works with multi-GPU DDP. Before, Unsloth's GRPO loss ran the model outside DDP's forward, so gradients were never averaged across GPUs and each rank silently trained its own copy. #12193 averages the gradients across ranks (with unslothai/unsloth-zoo#1498 so the loss normalisation matches a single GPU run, and unslothai/unsloth-zoo#1499 for float32 on T4 / V100). Launch your usual GRPO script with torchrun --nproc_per_node 2 train.py (or accelerate launch) and set ddp_find_unused_parameters = False in GRPOConfig. I checked Qwen2.5-0.5B-Instruct LoRA GRPO on 2 ranks with the latest release, and both ranks end with identical weights. Guide: https://unsloth.ai/docs/basics/multi-gpu-training-with-unsloth/ddp
    To update: uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir (if it's not in the current release yet it'll be in the next one). Reopen if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions