Skip to content

Multi-GPU Support for GRPO Training with Vision-Language Models (VLM) #3571

Closed

Description

@TranMinhThang-dev

I’m trying to train Qwen 3 VL 8B using multiple GPUs, but I suspect that multi-GPU support isn’t implemented properly, as it raises an error.

2025-11-07 11:57:26
[rank0]:   File "/root/llm-synthetic-finetuning/unsloth_compiled_cache/UnslothGRPOTrainer.py", line 53, in wrapper
2025-11-07 11:57:26
[rank0]:     output = f(self, *args, **kwargs)
2025-11-07 11:57:26
[rank0]:              ^^^^^^^^^^^^^^^^^^^^^^^^
2025-11-07 11:57:26
[rank0]:   File "/root/llm-synthetic-finetuning/.venv/lib/python3.12/site-packages/transformers/trainer.py", line 2325, in train
2025-11-07 11:57:26
[rank0]:     return inner_training_loop(
2025-11-07 11:57:26
[rank0]:            ^^^^^^^^^^^^^^^^^^^^
2025-11-07 11:57:26
[rank0]:   File "<string>", line 328, in _fast_inner_training_loop
2025-11-07 11:57:26
[rank0]:   File "<string>", line 40, in _unsloth_training_step
2025-11-07 11:57:26
[rank0]:   File "/root/llm-synthetic-finetuning/unsloth_compiled_cache/UnslothGRPOTrainer.py", line 2861, in compute_loss
2025-11-07 11:57:26
[rank0]:     logit_softcapping = getattr(model.config, "final_logit_softcapping", 0) # Gemma
2025-11-07 11:57:26
[rank0]:                                 ^^^^^^^^^^^^
2025-11-07 11:57:26
[rank0]:   File "/root/llm-synthetic-finetuning/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1962, in __getattr__
2025-11-07 11:57:26
[rank0]:     raise AttributeError(
2025-11-07 11:57:26
[rank0]: AttributeError: 'DistributedDataParallel' object has no attribute 'config'

It might be because the model is wrapped with DDP, but my concern is whether that feature is actually supported.

Activity

  1. added
    feature request
    on Nov 8, 2025
  2. shimmyshimmer commented on Nov 8, 2025

    @shimmyshimmer
    Member

    We are working on multiGPU support for VLMs and normal LLMs.

  3. JerryTT2019 commented on Dec 15, 2025

    @JerryTT2019

    We are working on multiGPU support for VLMs and normal LLMs.

    Hi, I would like to know what progress has been made in official support for multi-GPU training to date (e.g., the training of qwen3vl in aspects like SFT, DPO, GRPO, etc.)? Are there any available examples? And I noticed that the official website states only Unsloth Pro supports multi-GPU. Does that mean the currently available open-source version will not receive official multi-GPU support?

  4. JakobDen commented on Dec 19, 2025

    @JakobDen

    We are working on multiGPU support for VLMs and normal LLMs.

    Hi, I would like to know what progress has been made in official support for multi-GPU training to date (e.g., the training of qwen3vl in aspects like SFT, DPO, GRPO, etc.)? Are there any available examples? And I noticed that the official website states only Unsloth Pro supports multi-GPU. Does that mean the currently available open-source version will not receive official multi-GPU support?

    Hi! I've just substituted necessary values instead of getattr(model.config, ...) in unsloth/unsloth/models/rl_replacements.py and now it seems to work properly in multi gpu setup.

  5. sea-comet commented on Feb 9, 2026

    @sea-comet

    We are working on multiGPU support for VLMs and normal LLMs.

    Hi, I would like to know what progress has been made in official support for multi-GPU training to date (e.g., the training of qwen3vl in aspects like SFT, DPO, GRPO, etc.)? Are there any available examples? And I noticed that the official website states only Unsloth Pro supports multi-GPU. Does that mean the currently available open-source version will not receive official multi-GPU support?

    Hi! I've just substituted necessary values instead of getattr(model.config, ...) in unsloth/unsloth/models/rl_replacements.py and now it seems to work properly in multi gpu setup.

    Hello! May I ask what and how you have substituted to make multigpu work? Do you need to modify the source code whenever model.config occurs? Could you share some insights? Thank you so much!

  6. akshathtiwari commented on Apr 21, 2026

    @akshathtiwari

    we monkey-patch the trainer's compute_loss method before training starts that seemed to have worked for us

  7. added a commit that references this issue on Jun 3, 2026
    d73c7b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions