Skip to content

Conversation

aorenste
Copy link
Contributor

@aorenste aorenste commented Apr 22, 2025

Teach the graph printer how to allow overriding printing SymTypes (SymInt, SymFloat, SymBool) and then use that to reuse the fast SymNode printing from torch._inductor.utils.sympy_str() to make computing the cache key faster.

On my computer the repro from #151823 goes from 480s -> 80s (still terrible... but better).

Fixes #151823

Stack from ghstack (oldest at bottom):

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

Copy link

pytorch-bot bot commented Apr 22, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 5 Unrelated Failures

As of commit c9e0ad7 with merge base d57bf53 (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

aorenste added a commit that referenced this pull request Apr 22, 2025
ghstack-source-id: fb7a44f
Pull Request resolved: #151928
@aorenste aorenste added the topic: not user facing topic category label Apr 22, 2025
@aorenste aorenste requested a review from laithsakka April 23, 2025 15:08
@aorenste aorenste marked this pull request as ready for review April 24, 2025 01:37
Copy link
Contributor

@laithsakka laithsakka left a comment

Choose a reason for hiding this comment

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

looks good just one comment about pushing the override logic inside print_readable to make it easier to replicate this on other places and reduce code repetition

Teach the graph printer how to allow overriding printing SymTypes (`SymInt`, `SymFloat`, `SymBool`) and then use that to reuse the fast SymNode printing from `torch._inductor.utils.sympy_str()` to make computing the cache key faster.

On my computer the repro from #151823 goes from 480s -> 80s (still terrible... but better).

Fixes #151823 




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

[ghstack-poisoned]
@aorenste aorenste requested a review from bdhirsh as a code owner May 5, 2025 20:02
aorenste added a commit that referenced this pull request May 5, 2025
ghstack-source-id: e14d5bb
Pull Request resolved: #151928
@aorenste
Copy link
Contributor Author

aorenste commented May 6, 2025

test_modules_can_be_imported looks unrelated (appears in several different PRs)
@pytorchbot merge -i

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 6, 2025
@github-actions github-actions bot deleted the gh/aorenste/224/head branch June 17, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fx Merged module: inductor release notes: fx release notes category topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants