Skip to content

Conversation

@vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Mar 21, 2025

Stack from ghstack (oldest at bottom):

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:

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:

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

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 21, 2025

🔗 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 (image):

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.

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 21, 2025
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
@vkuzo vkuzo requested review from YUNQIUGUO, drisspg and eellison March 21, 2025 22:36
Copy link
Contributor

@YUNQIUGUO YUNQIUGUO left a comment

Choose a reason for hiding this comment

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

thanks!!

@vkuzo
Copy link
Contributor Author

vkuzo commented Mar 21, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Mar 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: inductor / linux-jammy-cpu-py3.9-gcc11-inductor / test (cpu_inductor_torchbench, 1, 2, linux.8xlarge.amx)

Details for Dev Infra team Raised 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()):
Copy link
Collaborator

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?

Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 24, 2025
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
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 25, 2025
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
YUNQIUGUO added a commit to YUNQIUGUO/pytorch that referenced this pull request Mar 25, 2025
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
pytorchmergebot pushed a commit that referenced this pull request Mar 25, 2025
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()):
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

amathewc pushed a commit to amathewc/pytorch that referenced this pull request Apr 17, 2025
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
@github-actions
Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Jun 14, 2025
@github-actions github-actions bot closed this Jul 14, 2025
@github-actions github-actions bot deleted the gh/vkuzo/10/head branch August 14, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants