Skip to content

Conversation

@joebos
Copy link
Contributor

@joebos joebos commented Oct 5, 2024

Differential Revision: D63576353

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 5, 2024

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 5, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: joebos / name: Joe Lee (eda1af9)

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 5, 2024

🔗 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 Failures

As of commit eda1af9 with merge base bd45c00 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63576353

@albanD albanD removed their request for review October 7, 2024 19:27
@xw285cornell
Copy link
Contributor

@albanD @jbschlosser this PR seems reasonable (more context in D63576353, c&p here:

"
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.
"

Wondering do you know who should be the best reviewer for this?

@mikaylagawarecki mikaylagawarecki added release notes: nn release notes category topic: improvements topic category labels Oct 22, 2024
Copy link
Contributor

@mikaylagawarecki mikaylagawarecki left a 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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63576353

Copy link
Contributor

@mikaylagawarecki mikaylagawarecki left a 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)

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63576353

@joebos
Copy link
Contributor Author

joebos commented Nov 5, 2024

#137403 (comment) please also sign the CLI and add the test per #137403 (review)
The PR/diff is updated, mikaylagawarecki, could you help review again?

Copy link
Contributor

@mikaylagawarecki mikaylagawarecki left a 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?

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63576353

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63576353

@facebook-github-bot
Copy link
Contributor

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
@joebos joebos force-pushed the export-D63576353 branch 2 times, most recently from 7ebc15a to eda1af9 Compare November 6, 2024 01:39
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63576353

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63576353

Copy link
Contributor

@mikaylagawarecki mikaylagawarecki left a comment

Choose a reason for hiding this comment

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

Thanks!

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 6, 2024
@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged release notes: nn release notes category topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants