Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Suppressed 'use_reentrant=False' warning #33208

Merged

Conversation

ankush13r
Copy link
Contributor

What does this PR do?

Fixes #28536 Resolving 'use_reentrant=False' warning due to empty dict in gradient_checkpointing_kwargs.

Referenced prior issue where gradient_checkpointing_kwargs was initialized as an empty dict in the Trainer. This led to the gradient_checkpointing_enable function not handling it as None, causing a 'use_reentrant=False' warning. The issue was resolved by removing the unnecessary initialization, ensuring proper handling of gradient checkpointing parameters.

For more information, see: #28536 (comment)

@ArthurZucker

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

thanks, LGTM

@ArthurZucker ArthurZucker merged commit 409fcfd into huggingface:main Sep 2, 2024
21 checks passed
@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.

itazap pushed a commit to NielsRogge/transformers that referenced this pull request Sep 20, 2024
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
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.

Gradient checkpointing throws use_reentrant warning on PyTorch 2.1
3 participants