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

Appearance settings

add graph_code_verbose_log artifact for fx passes #153775

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

Conversation

rivtechprojects
Copy link
Contributor

@rivtechprojects rivtechprojects commented May 17, 2025

Fixes #153646

This PR refactors the logging behavior in the FX pass insert_deferred_runtime_asserts and runtime_assert.py to separate verbose/intermediate graph logs from the final output graph log. All verbose logs generated during the FX pass are now routed to a new artifact logger, graph_code_verbose, while only the final output graph remains logged to the original graph_code artifact.

Changes

  • Added a new artifact logger: [graph_code_log = torch._logging.getArtifactLogger(name, "graph_code_verbose")]
  • Updated all verbose/intermediate FX pass logs in [insert_deferred_runtime_asserts] to use the new graph_code_verbose artifact.
  • Ensured that only the final output graph is logged to the original graph_code artifact.
  • No changes to the FX pass logic or output—only logging behavior is affected.

Notes
This change is backward-compatible and does not affect the functional behavior of FX passes.
No changes to user-facing APIs.

cc @ezyang @SherlockNoMad @EikanWang @jgong5 @wenzhe-nrv @voznesenskym @penguinwu @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @jiayisunx @chenyang78 @kadeng @chauhang @amjames

Copy link

pytorch-bot bot commented May 17, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153775

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

✅ No Failures

As of commit b764a82 with merge base 996c4d8 (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

linux-foundation-easycla bot commented May 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Member

@williamwen42 williamwen42 left a comment

Choose a reason for hiding this comment

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

I think you need to make a bunch of changes to torch/_logging/_internal.py as well.

@rivtechprojects
Copy link
Contributor Author

I think you need to make a bunch of changes to torch/_logging/_internal.py as well.

I believe I made the necessary changes there, but please let me know if I missed something. I'm not sure if I took the right approach with the help message. Thanks for the feedback!

torch/_logging/_internal.py Outdated Show resolved Hide resolved
torch/_logging/_internal.py Outdated Show resolved Hide resolved
torch/_dynamo/output_graph.py Outdated Show resolved Hide resolved
@rivtechprojects
Copy link
Contributor Author

@williamwen42 had a couple lint/test errors and pushed fixes!

@rivtechprojects
Copy link
Contributor Author

rivtechprojects commented May 20, 2025

@williamwen42 ,if i am reading correctly, it looks like there are a couple tests failing that are unrelated to my changes, if i am reading correctly. i would love some help resolving these if you can.

@williamwen42
Copy link
Member

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 20, 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 the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: Apply lint suggestions

Details for Dev Infra team Raised by workflow job

@williamwen42
Copy link
Member

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: Apply lint suggestions

Details for Dev Infra team Raised by workflow job

@williamwen42
Copy link
Member

@pytorchbot merge -ic

Copy link

pytorch-bot bot commented May 21, 2025

-ic flag is deprecated, please use -i instead for the same effect.

@williamwen42
Copy link
Member

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Successfully rebased dr/move-graph-code-logging-to-verbose-artifact onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout dr/move-graph-code-logging-to-verbose-artifact && git pull --rebase)

@pytorchmergebot pytorchmergebot force-pushed the dr/move-graph-code-logging-to-verbose-artifact branch from f897355 to b764a82 Compare May 21, 2025 00:53
@pytorch-bot pytorch-bot bot removed the ciflow/trunk Trigger trunk jobs on your pull request label May 21, 2025
@williamwen42
Copy link
Member

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 21, 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 the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: Apply lint suggestions

Details for Dev Infra team Raised by workflow job

@williamwen42
Copy link
Member

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: Apply lint suggestions

Details for Dev Infra team Raised by workflow job

@rivtechprojects
Copy link
Contributor Author

@williamwen42 is there somewhere these lint suggestions can be viewed? when i click on apply lint suggestions, it says the job was skipped.

@williamwen42
Copy link
Member

@pytorchbot merge -f

Copy link

pytorch-bot bot commented May 21, 2025

❌ 🤖 pytorchbot command failed:

@pytorchbot merge: error: argument -f/--force: expected one argument

usage: @pytorchbot merge [-f MESSAGE | -i] [-ic] [-r [{viable/strict,main}]]

Try @pytorchbot --help for more info.

@williamwen42
Copy link
Member

@pytorchbot merge -f "lintrunner-autoformat test keeps getting skipped"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@rivtechprojects
Copy link
Contributor Author

@williamwen42 not to be a bother, but i see the pull request was closed instead of merged. i can see my code in the main branch but it seems this contribution is not fully recognized without the merged status. is it possible to update it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request fx Merged module: dynamo open source release notes: fx release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dynamo, logging] Move extra graph_code logging to a verbose artifact
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.