Skip to content

🎀 New defaults: gradient_checkpointing=True #3510

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

qgallouedec
Copy link
Member

What does this PR do?

Fixes # (issue)

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? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • 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.

@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.

"help": "If True, use gradient checkpointing to save memory at the expense of slower backward pass."
},
)

Copy link
Member

Choose a reason for hiding this comment

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

So technically you wanna overwrite by setting the default to be True always?
always doing the grad_checkpointing

I guess in most of the trainer scripts most of us set this to True, so I believe its a good time to change the default!

Copy link
Member Author

@qgallouedec qgallouedec May 29, 2025

Choose a reason for hiding this comment

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

Yes! that's the underlying motivation. We should do that with all the arguments that match:

most of the trainer scripts most of us set this to [VALUE]

Comment on lines -31 to -33
learning_rate (`float`, *optional*, defaults to `1e-6`):
Initial learning rate for [`AdamW`] optimizer. The default value replaces that of
[`~transformers.TrainingArguments`].
Copy link
Member Author

@qgallouedec qgallouedec May 30, 2025

Choose a reason for hiding this comment

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

Giving the added

Note that default values in this class may differ from those in [~transformers.TrainingArguments]."

there is no need to double-document

@qgallouedec qgallouedec changed the title New defaults: gradient_checkpointing=True 🎀 New defaults: gradient_checkpointing=True May 30, 2025
Copy link
Member

@shirinyamani shirinyamani left a comment

Choose a reason for hiding this comment

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

I know the failing is not relevant to this PR directly, but have you checked the root?

@qgallouedec
Copy link
Member Author

No, not yet, I have to fix the tests before merging.

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.

3 participants