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

More robust tests required for gradient checkpointing #32063

Open
anferico opened this issue Jul 18, 2024 · 3 comments
Open

More robust tests required for gradient checkpointing #32063

anferico opened this issue Jul 18, 2024 · 3 comments

Comments

@anferico
Copy link
Contributor

anferico commented Jul 18, 2024

As flagged in this comment from #31945, the current test suite for gradient checkpointing may fail to spot subtle bugs. For example, the bug flagged in #31028 was not detected by any test, because the success criterion is simply that gradients are not None for each parameter that has requires_grad=True.

Proposal: every function whose behavior is affected by whether gradient checkpointing is enabled or not, such as a model's forward() method, should be tested twice: once with GC enabled and once with GC disabled, making sure that the outputs are exactly the same given certain inputs and configuration parameters.

@amyeroberts
Copy link
Collaborator

cc @ydshieh

@ydshieh
Copy link
Collaborator

ydshieh commented Jul 18, 2024

Would you like to contribute @anferico ?

@anferico
Copy link
Contributor Author

@ydshieh sure, though this will likely take some time and require support

@huggingface huggingface deleted a comment from github-actions bot Aug 21, 2024
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