-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Add runtime profiler info for AOTDispatcher prologue #155785
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 runtime profiler info for AOTDispatcher prologue #155785
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/155785
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 1 Pending, 1 Unrelated FailureAs of commit c1de92d with merge base b4442f4 ( UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
try: | ||
if grad_enabled: | ||
torch._C._set_grad_enabled(False) | ||
record_runtime_wrapper_prologue_exit(cm) |
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 at first I was going to ask you to use the context manager directly, so we don't need to worry about carefully making sure that the enter/exit line up in all the various branches.
I guess this is actually a pain to do though, since you need different global state to be toggled in the different branches, and you want to capture that inside of the recorded region
def record_runtime_wrapper_prologue_enter() -> AbstractContextManager[None]: | ||
cm: AbstractContextManager[None] = ( | ||
torch._C._profiler._RecordFunctionFast("AOTDispatcher Runtime Wrapper Prologue") | ||
if torch.autograd.profiler._is_profiler_enabled |
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.
@anijain2305 I saw that you have an additional config.record_pre_graph_bytecode_in_traces
that you branch on in your case. Did you add that because you're worried about the extra overhead even in this case where profiling is off? https://github.com/pytorch/pytorch/pull/154769/files#diff-0bb1756725c4426408938314b0c9d3988ae5bf49994892d7038ad7746e209e9fR617
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.
nice work!
af4604f
to
c843fc9
Compare
@pytorchbot merge -r |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Rebase failed due to Command
Raised by https://github.com/pytorch/pytorch/actions/runs/15742581401 |
@pytorchbot merge -r |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Rebase failed due to Command
Raised by https://github.com/pytorch/pytorch/actions/runs/15768102447 |
Successfully rebased |
13581a7
to
f92f250
Compare
@pytorchbot merge |
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 |
Merge failedReason: 1 jobs have failed, first few of them are: inductor-rocm / rocm-py3.10-inductor / build Details for Dev Infra teamRaised by workflow job |
f92f250
to
13581a7
Compare
@pytorchbot merge |
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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@pytorchbot merge -r |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
da90d5a
to
db38892
Compare
This PR updates submodules third_party/eigen If those updates are intentional, please add "submodule" keyword to PR title/description. |
db38892
to
13581a7
Compare
13581a7
to
140d34e
Compare
@pytorchbot merge |
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 |
Fixes #155721
cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168 @voznesenskym @penguinwu @EikanWang @Guobing-Chen @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @xmfan