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. |
vasqu
approved these changes
Apr 14, 2026
Contributor
vasqu
left a comment
There was a problem hiding this comment.
Nice thank you, just thinking if we should have a 4th case with proper check against different gas bsz x step (4:2 vs 8:1 which is tested for both)
|
|
||
| def test_gradient_accumulation_grad_norm_consistency(self): | ||
| trainer = Trainer(model=RegressionModel(), args=args, train_dataset=RegressionDataset()) | ||
| self.assertEqual(trainer.accelerator.gradient_accumulation_steps, 1) |
Contributor
There was a problem hiding this comment.
We can add a reference to the issue imo
Comment on lines
+251
to
+252
| loss_tolerance=0.1, | ||
| model_accepts_loss_kwargs=False, |
Contributor
There was a problem hiding this comment.
Would it make sense with a tighter tolerance when we accept loss kwargs as last test case?
Member
Author
There was a problem hiding this comment.
do have a tigher tolerance here already test_gradient_accumulation_grad_norm_with_num_items_in_batch
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 does this PR do?
This PR updates the grad acc tests so that we are able to better catch issues. We check the grad norm also in addition to the loss. We are remove some redundant tests. As promised @vasqu. Just read the new test directly, don't bother checking the old tests