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

Adding support for native Huggingface gradient checkpointing #50

Open
xhluca opened this issue Jul 8, 2022 · 1 comment
Open

Adding support for native Huggingface gradient checkpointing #50

xhluca opened this issue Jul 8, 2022 · 1 comment

Comments

@xhluca
Copy link

xhluca commented Jul 8, 2022

It would be nice to have support for Huggingface's gradient checkpointing capabilities.
With models like BERT, you can simply do:

model.gradient_checkpointing_enable()

Here's the docs on the subject.

I think this might be a good option for models that might not be supported by GradCache (or maybe both can be combined to save even more memory, though I'm not sure if they are compatible).

@MXueguang
Copy link
Contributor

Hi @xhluca,
I am not very sure about this. maybe @luyug can take a look.

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

No branches or pull requests

2 participants