-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
[Trainer
/ GC
] Add gradient_checkpointing_kwargs
in trainer and training arguments
#27068
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank 🔥
src/transformers/training_args.py
Outdated
gradient_checkpointing_kwargs: dict = field( | ||
default=None, | ||
metadata={ | ||
"help": "Gradient checkpointing key word arguments. Will be passed to `torch.utils.checkpoint.checkpoint` through `model.gradient_checkpointing_enable`." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add why anyone would want to pass antyhing and what is supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And a small small test!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Also why does it partially fix the issue |
It partially fixes the issue because I need huggingface/peft#1036 to be merged to fix the bug with respect to PEFT models |
… training arguments (huggingface#27068) * add `gradient_checkpointing_kwargs` in trainer and training arguments * add comment * add test - currently failing * now tests pass
What does this PR do?
Partially fixes: huggingface/trl#912
Following #27020 it is important to propagate
gradient_checkpointing_kwargs
inTrainer
as wellcc @ArthurZucker