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
Node.stack_trace should have innermost frame last #95592
Node.stack_trace should have innermost frame last #95592
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/95592
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d757afb: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ghstack-source-id: ee9ddd25d268e431d7117976eade9b3b54cc4487 Pull Request resolved: #95592
@@ -180,9 +180,9 @@ def create_proxy(self, kind: str, target: Target, args: Tuple[Any, ...], kwargs: | |||
if self.record_stack_traces and not proxy.node.stack_trace: | |||
user_frame = self._find_user_frame() | |||
if user_frame: | |||
walk_stack_gen = traceback.walk_stack(user_frame) | |||
summary = traceback.StackSummary.extract(walk_stack_gen) # type: ignore[arg-type] |
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.
interesting, I wonder why we did it this way originally
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.
Not sure... traceback.extract_stack(frame) would reverse the stack for user.
torch/fx/graph.py
Outdated
# iterate backwards to find the first line that starts | ||
# with 'File ' | ||
idx = len(lines) - 1 | ||
while idx >= 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.
nit: use a range loop here? for idx in range(len(lines)-1, -1, -1)
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.
ok, I rewrote to simplify the code.
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!
Both fx.Tracer and Dynamo should store node.stack_trace in the "innermost frame last" order. cc soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire [ghstack-poisoned]
ghstack-source-id: 8a1b4d307733ab7b9982a3c483a22960323abbe7 Pull Request resolved: #95592
@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 / linux-focal-cpu-py3.8-gcc7-inductor / test (inductor_timm_cpu_accuracy, 2, 2, linux.4xlarge) Details for Dev Infra teamRaised by workflow job |
@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 |
Both fx.Tracer and Dynamo should store node.stack_trace in the "innermost frame last" order. Pull Request resolved: pytorch/pytorch#95592 Approved by: https://github.com/ezyang
Both fx.Tracer and Dynamo should store node.stack_trace in the "innermost frame last" order. Pull Request resolved: pytorch/pytorch#95592 Approved by: https://github.com/ezyang
Both fx.Tracer and Dynamo should store node.stack_trace in the "innermost frame last" order. Pull Request resolved: pytorch/pytorch#95592 Approved by: https://github.com/ezyang
)" This reverts commit f8692dc.
Both fx.Tracer and Dynamo should store node.stack_trace in the "innermost frame last" order. Pull Request resolved: pytorch#95592 Approved by: https://github.com/ezyang
Both fx.Tracer and Dynamo should store node.stack_trace in the "innermost frame last" order.
Stack from ghstack (oldest at bottom):
cc @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire