-
Notifications
You must be signed in to change notification settings - Fork 25.7k
fix inductor logging for torch._scaled_mm #149769
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/149769
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (4 Unrelated Failures)As of commit bfa3c1d with merge base 23183fe ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Summary: #148800 made inductor logs throw an exception of the model contains `torch._scaled_mm` because it split a string by underscore and making some assumptions about the resulting list, and `torch._scaled_mm` has underscores which breaks those assumptions. Fixing by making the string parsing code slightly less brittle and adding a test. Test Plan: ```bash pytest test/dynamo/test_logging.py -s -k test_inductor_mm_info pytest test/dynamo/test_logging.py -s -k test_inductor_scaled_mm_info ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 7d9e184 Pull Request resolved: #149769
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!!
|
@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-jammy-cpu-py3.9-gcc11-inductor / test (cpu_inductor_torchbench, 1, 2, linux.8xlarge.amx) Details for Dev Infra teamRaised by workflow job |
| # This message is for printing overview information of inductor mm counts, shapes,etc after lowering | ||
| if log.isEnabledFor(logging.INFO): | ||
| # This message is for printing overview information of inductor mm counts, shapes, etc after lowering | ||
| if log.isEnabledFor(logging.INFO) and len(counters["aten_mm_info"].items()): |
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.
No need for item call? Check if the keys are empty is sufficient?
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.
+1
| # below is a bit brittle, but should work | ||
| parts = key.split("_") | ||
| if len(parts) < 4: | ||
| log.info(f"Unable to parse key {key}") # noqa: G004 |
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.
Just use %s logging instead of fstring to properly clear the error. Since it's already in an f statement though it's fine.
| # below is a bit brittle, but should work | ||
| parts = key.split("_") | ||
| if len(parts) < 4: | ||
| log.info(f"Unable to parse key {key}") # noqa: G004 |
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.
Just use %s logging instead of fstring to properly clear the error. Since it's already in an f statement though it's fine.
Summary: #148800 made inductor logs throw an exception of the model contains `torch._scaled_mm` because it split a string by underscore and making some assumptions about the resulting list, and `torch._scaled_mm` has underscores which breaks those assumptions. Fixing by making the string parsing code slightly less brittle and adding a test. Test Plan: ```bash pytest test/dynamo/test_logging.py -s -k test_inductor_mm_info pytest test/dynamo/test_logging.py -s -k test_inductor_scaled_mm_info ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: a6e2865 Pull Request resolved: #149769
Summary: #148800 made inductor logs throw an exception of the model contains `torch._scaled_mm` because it split a string by underscore and making some assumptions about the resulting list, and `torch._scaled_mm` has underscores which breaks those assumptions. Fixing by making the string parsing code slightly less brittle and adding a test. Test Plan: ```bash pytest test/dynamo/test_logging.py -s -k test_inductor_mm_info pytest test/dynamo/test_logging.py -s -k test_inductor_scaled_mm_info ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 425ede2 Pull Request resolved: #149769
Summary: This pr is just for recreation of the original pr: pytorch#149769 Fix for `torch._scaled_mm` op, which breaks the original parsing assumptions. Test Plan: CI Differential Revision: D71828732
Summary: This pr is just for recreation of the original pr: #149769 Fix for `torch._scaled_mm` op mm logging, which breaks the original brittle underscore parsing assumptions. Test Plan: CI Differential Revision: D71828732 Pull Request resolved: #149967 Approved by: https://github.com/vkuzo
| # This message is for printing overview information of inductor mm counts, shapes,etc after lowering | ||
| if log.isEnabledFor(logging.INFO): | ||
| # This message is for printing overview information of inductor mm counts, shapes, etc after lowering | ||
| if log.isEnabledFor(logging.INFO) and len(counters["aten_mm_info"].items()): |
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.
+1
Summary: This pr is just for recreation of the original pr: pytorch#149769 Fix for `torch._scaled_mm` op mm logging, which breaks the original brittle underscore parsing assumptions. Test Plan: CI Differential Revision: D71828732 Pull Request resolved: pytorch#149967 Approved by: https://github.com/vkuzo
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Stack from ghstack (oldest at bottom):
Summary:
#148800 made inductor logs
throw an exception of the model contains
torch._scaled_mmbecauseit split a string by underscore and making some assumptions about the resulting
list, and
torch._scaled_mmhas underscores which breaks thoseassumptions.
Fixing by making the string parsing code slightly less brittle and
adding a test.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov