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

VisionEncoderDecoderModel gradient checkpointing #18513

Closed
metemadi opened this issue Aug 7, 2022 · 3 comments
Closed

VisionEncoderDecoderModel gradient checkpointing #18513

metemadi opened this issue Aug 7, 2022 · 3 comments

Comments

@metemadi
Copy link

metemadi commented Aug 7, 2022

Feature request

Would love to be able to use gradient checkpointing on VisionEncoderDecoder model.

model.gradient_checkpointing_enable()
Traceback (most recent call last):
File "", line 1, in
File "/opt/conda/lib/python3.8/site-packages/transformers/modeling_utils.py", line 1418, in gradient_checkpointing_enable
raise ValueError(f"{self.class.name} does not support gradient checkpointing.")
ValueError: VisionEncoderDecoderModel does not support gradient checkpointing.

Motivation

Gradient checkpointing always helps increase the accessibility of larger models - HuggingFace is awesome!!!

Your contribution

Happy to take a stab at this if someone can point me to a previous example of this working with an EncoderDecoder model.

@LysandreJik
Copy link
Member

@NielsRogge, have you seen such examples? :)

@NielsRogge
Copy link
Contributor

Here's a PR that added gradient checkpointing to T5: https://github.com/huggingface/transformers/pull/11353/files

@NielsRogge
Copy link
Contributor

Fixed per #18697

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

3 participants