-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Tutorial for DebugMode #3697
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
base: main
Are you sure you want to change the base?
Tutorial for DebugMode #3697
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3697
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 89931fb with merge base 05681a1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
70107fb to
6e85e8a
Compare
Lucaskabela
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.
I think one thing that would be very helpful for this tutorial is a log where the compiled and eager mode diverge - this could be extremely value to show users what they should be looking for. Can we add that here?
| # Hooks allow you to annotate each call with custom metadata such as GPU memory usage. ``log_hook`` returns a mapping | ||
| # that is rendered inline with the debug string. | ||
|
|
||
| MB = 1024 * 1024.0 |
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.
We should call out somewhere that with all context managers: DebugMode(), log_tensor_hashes(), dispatch_hooks(), you can wrap them around any particular region (except inside compiled regions). So the wrappers aren't global.
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.
hmm, i think the "except inside compiled regions" part can be confusing, so I'd prefer to leave this one out.
|
overall looks great! |
3c67013 to
e1931d2
Compare
Lucaskabela
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 to me! Thank you for incorporate the feedback - can we link this PR to a RFC in main repo as well?
pianpwk
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.
thank you!
svekars
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.
Please include into a relevant toctree in one of the related .rst file. And please don't merge until the doc team does the review. We typically merge closer to the release date.
f25aad9 to
4337b4b
Compare
4337b4b to
89931fb
Compare
sure, added now |
A tutorial for DebugMode
cc @pianpwk