Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[fx] Filter stacktrace#151029

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
angelayi wants to merge1 commit intomainfromangelayi/filter_stacktrace
Closed

Conversation

@angelayi
Copy link
Contributor

@angelayiangelayi commentedApr 10, 2025
edited
Loading

Filtering out the stacktrace so that the stacktrace on nodes when using fx.Tracer looks nicer. I just copied the filtering we have inproxy_tensor.py.

Previously the stacktrace looked like:

File "/data/users/angelayi/pytorch/moo.py", line 3964, in <module>    run_tests()  File "/data/users/angelayi/pytorch/torch/testing/_internal/common_utils.py", line 1342, in run_tests    unittest.main(argv=argv)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/main.py", line 101, in __init__    self.runTests()  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/main.py", line 271, in runTests    self.result = testRunner.run(self.test)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/runner.py", line 184, in run    test(result)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 84, in __call__    return self.run(*args, **kwds)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 122, in run    test(result)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 84, in __call__    return self.run(*args, **kwds)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 122, in run    test(result)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/case.py", line 650, in __call__    return self.run(*args, **kwds)  File "/data/users/angelayi/pytorch/torch/testing/_internal/common_utils.py", line 3324, in run    self._run_custom(  File "/data/users/angelayi/pytorch/torch/testing/_internal/common_utils.py", line 3296, in _run_custom    super_run(result=result)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/case.py", line 591, in run    self._callTestMethod(testMethod)  File "/home/angelayi/.conda/envs/pytorch-3.10/lib/python3.10/unittest/case.py", line 549, in _callTestMethod    method()  File "/data/users/angelayi/pytorch/torch/testing/_internal/common_utils.py", line 3156, in wrapper    method(*args, **kwargs)  File "/data/users/angelayi/pytorch/moo.py", line 1495, in test_stack_trace    gm = torch.fx.GraphModule(m, tracer.trace(m))  File "/data/users/angelayi/pytorch/torch/fx/_symbolic_trace.py", line 837, in trace    (self.create_arg(fn(*args)),),  File "/data/users/angelayi/pytorch/moo.py", line 1485, in forward    x = x * 2  File "/data/users/angelayi/pytorch/torch/fx/proxy.py", line 716, in impl    return tracer.create_proxy("call_function", target, args, kwargs)  File "/data/users/angelayi/pytorch/torch/fx/proxy.py", line 248, in create_proxy    proxy.node.stack_trace = "".join(CapturedTraceback.extract().format())

Now it looks like:

File "/data/users/angelayi/pytorch/moo.py", line 1485, in forward    x = x * 2

cc@ezyang@SherlockNoMad@EikanWang@jgong5@wenzhe-nrv

@pytorch-botpytorch-botbot added the release notes: fxrelease notes category labelApr 10, 2025
@pytorch-bot
Copy link

pytorch-botbot commentedApr 10, 2025
edited
Loading

🔗 Helpful Links

🧪 See artifacts and rendered test results athud.pytorch.org/pr/151029

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit9988b11 with merge base7d205b2 (image):
💚 Looks good so far! There are no failures yet. 💚

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

Copy link
Contributor

@jfix71jfix71 left a comment

Choose a reason for hiding this comment

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

Thanks! 🚀

Copy link
Contributor

@zou3519zou3519 left a comment

Choose a reason for hiding this comment

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

do you have a before and after of the new stack trace?

@angelayi
Copy link
ContributorAuthor

Updated the PR summary to include the stacktrace!

Comment on lines 267 to 268
frame.filename.endswith("fx/_symbolic_trace.py")
orframe.filename.endswith("export/_trace.py")
Copy link
Collaborator

@Skylion007Skylion007Apr 14, 2025
edited
Loading

Choose a reason for hiding this comment

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

Suggested change
frame.filename.endswith("fx/_symbolic_trace.py")
orframe.filename.endswith("export/_trace.py")
frame.filename.endswith(("fx/_symbolic_trace.py","export/_trace.py"))

Faster and more efficient

Copy link
Contributor

@zou3519zou3519 left a comment

Choose a reason for hiding this comment

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

looks fine but it would be nice to have a test

@angelayiangelayiforce-pushed theangelayi/filter_stacktrace branch 3 times, most recently from53839e3 to6e4942eCompareApril 15, 2025 21:52
@angelayiangelayiforce-pushed theangelayi/filter_stacktrace branch from8098b0c to9988b11CompareApril 22, 2025 16:35
@angelayi
Copy link
ContributorAuthor

@pytorchbot merge

pytorch-bot[bot] reacted with thumbs up emoji

@pytorch-botpytorch-botbot added the ciflow/trunkTrigger trunk jobs on your pull request labelApr 22, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in thewiki.

Questions? Feedback? Please reach out to thePyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actionsgithub-actionsbot deleted the angelayi/filter_stacktrace branchJune 7, 2025 02:20
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Skylion007Skylion007Skylion007 left review comments

@jfix71jfix71jfix71 approved these changes

@zou3519zou3519zou3519 approved these changes

@SherlockNoMadSherlockNoMadAwaiting requested review from SherlockNoMad

@ezyangezyangAwaiting requested review from ezyangezyang is a code owner

@ChilleeChilleeAwaiting requested review from ChilleeChillee is a code owner

@bobrenjc93bobrenjc93Awaiting requested review from bobrenjc93bobrenjc93 is a code owner

@laithsakkalaithsakkaAwaiting requested review from laithsakkalaithsakka is a code owner

+1 more reviewer

@jingshjingshjingsh approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

ciflow/inductorciflow/trunkTrigger trunk jobs on your pull requestfxMergedrelease notes: fxrelease notes category

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@angelayi@pytorchmergebot@jingsh@jfix71@Skylion007@zou3519@facebook-github-bot

[8]ページ先頭

©2009-2025 Movatter.jp