Skip to content

enforce that MXTensor scale dimensions are consistent with data #2506

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

Merged
merged 27 commits into from
Jul 9, 2025

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Jul 8, 2025

Summary:

Ensures that if the data dims are (M, K) then scale dims are (M, K //
block_size). Previously the scale dims were (M, K // block_size, 1).

No logic change in surrounding code, but this is definitely more
correct.

Test Plan:

pytest test/prototype/mx_formats
./test/prototype/mx_formats/test_mx_dtensor.sh

Reviewers:

Subscribers:

Tasks:

Tags:

vkuzo added 26 commits June 20, 2025 07:10
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo
Copy link
Contributor Author

vkuzo commented Jul 8, 2025

Copy link

pytorch-bot bot commented Jul 8, 2025

🔗 Helpful Links

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

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

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

vkuzo added a commit that referenced this pull request Jul 8, 2025
Summary:

Ensures that if the data dims are (M, K) then scale dims are (M, K //
block_size).  Previously the scale dims were (M, K // block_size, 1).

No logic change in surrounding code, but this is definitely more
correct.

Test Plan:

```
pytest test/prototype/mx_formats
./test/prototype/mx_formats/test_mx_dtensor.sh
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 50e45ce
ghstack-comment-id: 3049035188
Pull Request resolved: #2506
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 8, 2025
@vkuzo vkuzo added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Jul 8, 2025
@vkuzo vkuzo requested review from drisspg and danielvegamyhre July 8, 2025 13:46
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/92/head to main July 9, 2025 11:38
vkuzo added a commit that referenced this pull request Jul 9, 2025
Summary:

Ensures that if the data dims are (M, K) then scale dims are (M, K //
block_size).  Previously the scale dims were (M, K // block_size, 1).

No logic change in surrounding code, but this is definitely more
correct.

Test Plan:

```
pytest test/prototype/mx_formats
./test/prototype/mx_formats/test_mx_dtensor.sh
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 50e45ce
ghstack-comment-id: 3049035188
Pull Request resolved: #2506
@vkuzo vkuzo merged commit c1e84cc into main Jul 9, 2025
33 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants