-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[pytorch] Make global module hook to pass kwargs similar to how module hook works #137403
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
Conversation
|
This appears to be a diff that was exported from phabricator, but the PR author does not have sufficient permissions to run CI. @joebos, please do step 2 of internal wiki to get write access so you do not need to get CI approvals in the future. If you think this is a mistake, please contact the Pytorch Dev Infra team. |
|
|
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/137403
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit eda1af9 with merge base bd45c00 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
|
@albanD @jbschlosser this PR seems reasonable (more context in D63576353, c&p here: " Wondering do you know who should be the best reviewer for 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.
Sorry for missing this, this looks alright but can we perhaps add a small test in https://github.com/pytorch/pytorch/blob/main/test/nn/test_module_hooks.py and also fix lint
59b7783 to
33e0800
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
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.
#137403 (comment) please also sign the CLI and add the test per #137403 (review)
33e0800 to
0ce0ce4
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
|
mikaylagawarecki
left a comment
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.
This looks good, just need to fix lint, fyi external and internal lintrunner are different (but we need external lintrunner to pass to merge this).
Could you undo the internal lintrunner changes and do make setuplint and lintrunner -a?
0ce0ce4 to
b0f6219
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
b0f6219 to
359934f
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
359934f to
28814db
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
…e hook works (pytorch#137403) Summary: Currently you can register a module forward hook to a module, and get called with args, kwargs and output. PyTorch also supports global module forward hook so we do not need to register the hook at each module level. however, current global hook can only pass args and ouput. It does not support kwargs passing. This diff is to make the global module hook to pass kwargs, same as module level hook does. Test Plan: Tested with actually registering a global module forward hook func, and get args, kwargs and output from a module forward call. Reviewed By: Yuzhen11 Differential Revision: D63576353
7ebc15a to
eda1af9
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
1 similar comment
|
This pull request was exported from Phabricator. Differential Revision: D63576353 |
mikaylagawarecki
left a comment
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!
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…e hook works (pytorch#137403) Differential Revision: D63576353 Pull Request resolved: pytorch#137403 Approved by: https://github.com/mikaylagawarecki
Differential Revision: D63576353