Fix flaky CI test_rloo[fsdp2]: Replace non-deterministic xfail with skipif for transformers 5.4.0#5403
Merged
albertvillanova merged 2 commits intohuggingface:mainfrom Mar 31, 2026
Merged
Conversation
|
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. |
kashif
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace non-deterministic xfail with skipif for test_rloo[fsdp2]
Fix to:
The
test_rloo[fsdp2]test was markedxfail(strict=True)for transformers 5.4.0 due to an upstream bug that causes NaN weights on non-rank-0 FSDP processes (see #5386 and transformers#45050). However, the NaN generation is non-deterministic, so the test randomly passes or fails, makingstrict=Trueincorrect: a passing run is reported as XPASS (an error), causing flaky CI: https://github.com/huggingface/trl/actions/runs/23733750480/job/69133242696?pr=5402xfailmeans "this test is expected to fail", which doesn't apply when the failure is random.skipifis the correct marker: it signals that the test cannot run reliably on this version, keeps CI deterministic (always SKIPPED for 5.4.0), and avoids noise for maintainers. Tracking of the upstream fix remains via the issue links in the reason string.Changes
Testing logic update:
test_rewardto usepytest.mark.skipiffortransformersversion 5.4.0, skipping the test when the upstream NaN weights issue is present, instead of marking it as an expected failure.Note
Low Risk
Low risk: changes only a pytest marker to make CI deterministic by skipping a known-flaky upstream combination; no production code paths affected.
Overview
Makes
test_rloo[fsdp2]deterministic ontransformers==5.4.0by replacing axfail(strict=True)withskipiffor the known upstream NaN-weights issue, preventing intermittent XPASS failures in CI.Written by Cursor Bugbot for commit 18df790. This will update automatically on new commits. Configure here.