Skip to content

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Sep 26, 2025

Summary:

Deletes the custom op dispatch logic in MXTensor and switches to the
general one in AOBaseTensor.

To enable this, we move the mx ops to the same file as MXTensor. This
is to avoid the need for callsites to separately import mx_ops.py.

Note that there are a couple of custom mx ops which could instead use
the general implementation, leaving that for future PRs to keep this one
small.

Test Plan:

pytest test/prototype/mx_formats -s -x

Reviewers:

Subscribers:

Tasks:

Tags:

[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 Sep 26, 2025

Copy link

pytorch-bot bot commented Sep 26, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 3467ee3 with merge base b3b545f (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla meta-cla 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 Sep 26, 2025
vkuzo added a commit that referenced this pull request Sep 26, 2025
Summary:

Deletes the custom op dispatch logic in `MXTensor` and switches to the
general one in `AOBaseTensor`.

To enable this, we move the mx ops to the same file as `MXTensor`. This
is to avoid the need for callsites to separately import `mx_ops.py`.

Note that there are a couple of custom mx ops which could instead use
the general implementation, leaving that for future PRs to keep this one
small.

Test Plan:

```
pytest test/prototype/mx_formats -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 1d27ad4
ghstack-comment-id: 3338749802
Pull Request resolved: #3080
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Sep 26, 2025
Summary:

Deletes the custom op dispatch logic in `MXTensor` and switches to the
general one in `AOBaseTensor`.

To enable this, we move the mx ops to the same file as `MXTensor`. This
is to avoid the need for callsites to separately import `mx_ops.py`.

Note that there are a couple of custom mx ops which could instead use
the general implementation, leaving that for future PRs to keep this one
small.

Test Plan:

```
pytest test/prototype/mx_formats -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 994257e
ghstack-comment-id: 3338749802
Pull Request resolved: #3080
@vkuzo vkuzo added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Sep 26, 2025
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo vkuzo requested a review from jerryzh168 September 26, 2025 18:58
[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 vkuzo changed the base branch from gh/vkuzo/126/head to main September 26, 2025 19:38
implements = MXTensor.implements


@implements([aten.detach.default, aten.alias.default])
Copy link
Contributor

Choose a reason for hiding this comment

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

these are defined in TorchAOBaseTensor as well I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, we can move in future PRs if needed, I wanted to minimize changes in this PR

@vkuzo vkuzo merged commit a53a4db into main Sep 27, 2025
50 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: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants