Skip to content
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

MX: hook up mxfp8 and mxfp4 CUTLASS kernels to MXLinear #1713

Merged
merged 15 commits into from
Feb 14, 2025
Merged

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Feb 14, 2025

Summary:

  1. add a kernel choice setting to MXLinearConfig to choose between
    emulated gemm and CUTLASS gemm
  2. respect the setting in the torch.mm op override
  3. numerical tests to match emulated vs real e2e
    activations/weights/grads

Test Plan:

pytest test/prototype/mx_formats/ -s -x

Reviewers:

Subscribers:

Tasks:

Tags:

vkuzo added 11 commits January 29, 2025 20:32
[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 Feb 14, 2025

Stack from ghstack (oldest at bottom):

Copy link

pytorch-bot bot commented Feb 14, 2025

🔗 Helpful Links

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

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.

@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 Feb 14, 2025
vkuzo added a commit that referenced this pull request Feb 14, 2025
Summary:

1. add a kernel choice setting to `MXLinearConfig` to choose between
   emulated gemm and CUTLASS gemm
2. respect the setting in the torch.mm op override
3. numerical tests to match emulated vs real e2e
   activations/weights/grads

Test Plan:

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

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 1d12e235c90ad3f46335654d62d3376efc035d84
ghstack-comment-id: 2657958104
Pull Request resolved: #1713
vkuzo added a commit that referenced this pull request Feb 14, 2025
Summary:

1. add a kernel choice setting to `MXLinearConfig` to choose between
   emulated gemm and CUTLASS gemm
2. respect the setting in the torch.mm op override
3. numerical tests to match emulated vs real e2e
   activations/weights/grads

Test Plan:

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

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 1d12e235c90ad3f46335654d62d3376efc035d84
ghstack-comment-id: 2657958104
Pull Request resolved: #1713
@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 Feb 14, 2025
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Feb 14, 2025
Summary:

1. add a kernel choice setting to `MXLinearConfig` to choose between
   emulated gemm and CUTLASS gemm
2. respect the setting in the torch.mm op override
3. numerical tests to match emulated vs real e2e
   activations/weights/grads

Test Plan:

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

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 9234dba200094da88c2d13bc20e198aa7ffb5af6
ghstack-comment-id: 2657958104
Pull Request resolved: #1713
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Feb 14, 2025
Summary:

1. add a kernel choice setting to `MXLinearConfig` to choose between
   emulated gemm and CUTLASS gemm
2. respect the setting in the torch.mm op override
3. numerical tests to match emulated vs real e2e
   activations/weights/grads

Test Plan:

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

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 55f72a0e0d18898c2f02fb2d88c537b382ed5a67
ghstack-comment-id: 2657958104
Pull Request resolved: #1713
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/26/head to main February 14, 2025 23:47
vkuzo added a commit that referenced this pull request Feb 14, 2025
Summary:

1. add a kernel choice setting to `MXLinearConfig` to choose between
   emulated gemm and CUTLASS gemm
2. respect the setting in the torch.mm op override
3. numerical tests to match emulated vs real e2e
   activations/weights/grads

Test Plan:

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

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 55f72a0e0d18898c2f02fb2d88c537b382ed5a67
ghstack-comment-id: 2657958104
Pull Request resolved: #1713
@vkuzo vkuzo merged commit 8fc49fe into main Feb 14, 2025
16 of 26 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.

3 participants