Reduce inconsistency across trainer test files#5678
Open
qgallouedec wants to merge 12 commits intomainfrom
Open
Reduce inconsistency across trainer test files#5678qgallouedec wants to merge 12 commits intomainfrom
qgallouedec wants to merge 12 commits intomainfrom
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. |
- Updated assertions in `test_grpo_trainer.py`, `test_reward_trainer.py`, `test_rloo_trainer.py`, and `test_sft_trainer.py` to use `torch.allclose` instead of `torch.equal` for better numerical stability when checking if parameters have changed. - Ensured consistency in assertion messages across all modified tests.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c5a2467. Configure here.
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.

What changed
test_training_*→test_train_*(stragglers in DPO, GRPO, RLOO, and 10 experimental files)parameters→params,Check the→Check that the# Get the dataset,# Initialize the trainer,# Train the model, etc. — per CLAUDE.md guidance)torch.equalvstorch.allclose, missing inline comments on shared config args)Note
Low Risk
Test-only refactors (renames, comment cleanup, and assertion consistency) with minor dataset-loading adjustments; low risk outside of potentially changing which splits are exercised in a few tests.
Overview
Improves consistency across trainer test suites by renaming remaining
test_training*methods totest_train*, tightening/standardizing assertion messaging, and removing redundant narrative comments.Also aligns dataset usage in several tests (e.g., consistently using
load_dataset(..., split="train")where a single-split dataset is expected) and standardizes parameter-change checks to usetorch.equal(andparamswording) for clearer, uniform test behavior.Reviewed by Cursor Bugbot for commit c06fb06. Bugbot is set up for automated code reviews on this repo. Configure here.