Skip to content

Hotfix CI: xfail the GRPO continuous batching test under DataParallel - #7422

Merged
albertvillanova merged 1 commit into
mainfrom
hotfix-xfail-grpo-continuous-batching-data-parallel
Sep 28, 2026
Merged

albertvillanova merged 1 commit into
mainfrom
hotfix-xfail-grpo-continuous-batching-data-parallel

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Hotfix:

This PR marks as xfail the GRPO continuous batching slow test when several accelerators are visible, where Trainer wraps the model in nn.DataParallel.

Motivation

Since #7389, GRPO patches the fused LM head by binding a new forward to the model instance. nn.DataParallel copies that bound method into every replica, so replica 1 still runs on the device-0 weights and the multi-GPU slow job fails:

RuntimeError: Expected all tensors to be on the same device, but got index is on cuda:1, different from other tensors on cuda:0

This is the same root cause as the SFT failures in #6836. See the investigation in #7421.

Solution

Apply the existing xfail_data_parallel marker, as done for SFT in #6841. It is conditional on more than one accelerator being visible, so the test keeps reporting normally in the single-GPU job.

Changes

  • Apply xfail_data_parallel to test_train_with_transformers_continuous_batching in tests/test_grpo_trainer.py

Note

Low Risk
Test-only CI adjustment using an existing marker; no production or trainer logic changes.

Overview
Marks test_train_with_transformers_continuous_batching with the shared @xfail_data_parallel marker so CI stops failing when multiple accelerators are visible and Hugging Face Trainer wraps the model in nn.DataParallel.

That path hits a known TRL limitation: GRPO’s fused LM head rebinds forward on one module instance, which DataParallel replicas mishandle (cross-device tensor errors). Single-GPU runs are unchanged—the marker only applies when more than one device is present.

Reviewed by Cursor Bugbot for commit 80b1069. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added the 🔧 maintenance CI, tooling, tests, or repo upkeep label Sep 28, 2026
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova

Copy link
Copy Markdown
Member Author

Merging this PR as a CI hotfix.

@albertvillanova
albertvillanova merged commit 0f23835 into main Sep 28, 2026
11 checks passed
@albertvillanova
albertvillanova deleted the hotfix-xfail-grpo-continuous-batching-data-parallel branch September 28, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 maintenance CI, tooling, tests, or repo upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant