Skip to content

Fix traceback formatting in permutation_lib.py#1987

Open
yujincheng08 wants to merge 2 commits intoNVIDIA:masterfrom
yujincheng08:patch-1
Open

Fix traceback formatting in permutation_lib.py#1987
yujincheng08 wants to merge 2 commits intoNVIDIA:masterfrom
yujincheng08:patch-1

Conversation

@yujincheng08
Copy link
Copy Markdown

Python 3.10+ no longer supports etype:

TypeError: format_exception() got an unexpected keyword argument 'etype'

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates exception traceback printing when Torch.FX symbolic tracing fails in apex.contrib.sparsity utilities.

Changes:

  • Simplifies the traceback formatting call in trace_and_print_raw_fx_graph when symbolic_trace(model) raises.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 2011 to 2013
print(ex)
print(
"".join(
traceback.format_exception(
etype=type(ex), value=ex, tb=ex.__traceback__
)
)
)
print("".join(traceback.format_exception(value=ex, tb=ex.__traceback__)))
print(
Copy link
Copy Markdown
Author

@yujincheng08 yujincheng08 Mar 17, 2026

Choose a reason for hiding this comment

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

hmm, this may cause inconsistency. And since python 3.6 etype has no effect.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants