-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Fixed gradient checkpoint bug for TimeSeriesTransformer #22272
Conversation
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.
Thanks a lot for this! I left a tiny suggestion
| if use_cache: | ||
| logger.warning_once( | ||
| "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..." | ||
| ) | ||
| use_cache = False |
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.
| if use_cache: | |
| logger.warning_once( | |
| "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..." | |
| ) | |
| use_cache = False | |
| if use_cache: | |
| logger.warning_once( | |
| "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..." | |
| ) | |
| use_cache = False |
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.
OK, just fixed indentation with another commit. Thanks!
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.
Awesome! Can you run make fixup to fix the styling checks? Then we should be good to go
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.
Sure! For some reason, I cannot seem to install this tool properly. Are there any guides on how to install this for the Transformers repository?
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.
if you are inside transformers repo, you should be able to just run make fixup and it should work. What are the errors you get?
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.
When I run that, I get this output:
pmollerus@Philips-MacBook-Pro time_series_transformer % make fixup
make: *** No rule to make target `fixup'. Stop.
I also tried running make fixup modeling_time_series_transformers.py in the time series transformer directory and receive the same output.
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.
I see, can you set yourself on the root of transformers repo? i.e. where the Makefile lives, that should fix the issue I believe
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.
Doing this, I receive the following output:
pmollerus@Philips-MacBook-Pro transformers % make fixup
make: python: Command not found
No library .py files were modified
python utils/custom_init_isort.py
make: python: No such file or directory
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.
Ahh this is because python is not installed on your environment I guess, I can run the command for you if you want, just let me know
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.
Just pushed for you!
|
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.
Thanks a lot for all your work on this!
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.
Thanks for your contribution!
|
Strange, I will see if I can install Python for my environment then. Thank you for all your help, and thanks for running make for me! |
…22272) * Fixed gradient checkpoint bug for this model * Updating PR indentation (maintainer feedback) * make fixup --------- Co-authored-by: younesbelkada <younesbelkada@gmail.com>
…22272) * Fixed gradient checkpoint bug for this model * Updating PR indentation (maintainer feedback) * make fixup --------- Co-authored-by: younesbelkada <younesbelkada@gmail.com>
What does this PR do?
Moved gradient checkpointing clause to above the decoder layer implementation. This should fix the bug this issue addresses.
Fixes #21737
Before submitting
Pull Request section?
to it if that's the case.
GitHub Issue
documentation guidelines, and
here are tips on formatting docstrings.
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.
@younesbelkada