Skip to content

Conversation

@IlyasMoutawwakil
Copy link
Member

What does this PR do?

The test for the "brokenness" of gradient accumulation loss uses an arbitrary value to check if not passing "num_items_in_batch" results in a loss different from normal training loss. This value got smaller after I made some changes to the test (mostly trying to make it more understandable).
See changes in https://github.com/huggingface/transformers/pull/36424/files#diff-ac9b69e204d41f7ddf23e8bd5b53a2a0ffa64c4784101abeef3b5d4c14342656R823-R905

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@github-actions github-actions bot marked this pull request as draft March 13, 2025 09:33
@github-actions
Copy link
Contributor

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the Ready for review button (at the bottom of the PR page).

@IlyasMoutawwakil
Copy link
Member Author

@muellerzr @Cyrilvallez

@IlyasMoutawwakil IlyasMoutawwakil marked this pull request as ready for review March 13, 2025 09:33
@github-actions github-actions bot requested review from SunMarc and muellerzr March 13, 2025 09:34
@HuggingFaceDocBuilderDev

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.

Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me !

Copy link
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, LGTM! Thanks a lot!

@IlyasMoutawwakil IlyasMoutawwakil merged commit 6f3e0b6 into main Mar 14, 2025
24 checks passed
@IlyasMoutawwakil IlyasMoutawwakil deleted the fix-grad-accum-test branch March 14, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants