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

add recurse argument in remove_hook_from_module #812

Merged
merged 4 commits into from
Nov 2, 2022

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

This PR adds recurse argument in remove_hook_from_module to be able to remove the hooks of a module recursively. Useful in the context of huggingface/optimum#423

cc @sgugger
Thanks!

@younesbelkada younesbelkada requested a review from sgugger November 2, 2022 13:57
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 2, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

src/accelerate/hooks.py Outdated Show resolved Hide resolved
src/accelerate/hooks.py Outdated Show resolved Hide resolved
younesbelkada and others added 2 commits November 2, 2022 15:11
Co-authored-by: Sylvain Gugger <[email protected]>
Co-authored-by: Sylvain Gugger <[email protected]>
@younesbelkada
Copy link
Contributor Author

younesbelkada commented Nov 2, 2022

Thanks for the suggestion! Can confirm the BetterTransformers tests pass on my side ;)

@sgugger sgugger merged commit 102cf00 into huggingface:main Nov 2, 2022
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

Successfully merging this pull request may close these issues.

3 participants