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

[WIP] Initial prototype of differentiable grouped_scaled_mm function for torchao #1969

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

danielvegamyhre
Copy link
Contributor

@danielvegamyhre danielvegamyhre commented Mar 26, 2025

Summary

The _grouped_scaled_mm function in torchao will do:

  • float8 rowwise quantization on inputs
  • grouped scaled mm
  • do this in a differentiable way

Test plan

  • TODO add more robust tests w/ gradient checks

@danielvegamyhre danielvegamyhre added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Mar 26, 2025
Copy link

pytorch-bot bot commented Mar 26, 2025

🔗 Helpful Links

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

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

❌ 4 New Failures

As of commit 281950c with merge base 923242e (image):

NEW FAILURES - The following jobs have failed:

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 Mar 26, 2025
@danielvegamyhre danielvegamyhre changed the title [WIP] Initial prototype of grouped_mm API for torchao [GroupedMM] Initial prototype of grouped_mm API for torchao Mar 27, 2025
@danielvegamyhre danielvegamyhre requested a review from vkuzo March 27, 2025 15:27
@danielvegamyhre danielvegamyhre changed the title [GroupedMM] Initial prototype of grouped_mm API for torchao [GroupedMM] Initial prototype of grouped_mm API for torchao (forward pass only) Mar 27, 2025
@danielvegamyhre danielvegamyhre changed the title [GroupedMM] Initial prototype of grouped_mm API for torchao (forward pass only) [GroupedMM] Initial prototype of _grouped_scaled_mm prototype function for torchao (forward pass only) Mar 27, 2025
@danielvegamyhre danielvegamyhre changed the title [GroupedMM] Initial prototype of _grouped_scaled_mm prototype function for torchao (forward pass only) [GroupedMM] Initial prototype of _grouped_scaled_mm function for torchao (forward pass only) Mar 27, 2025
@danielvegamyhre danielvegamyhre marked this pull request as draft March 27, 2025 23:44
@danielvegamyhre danielvegamyhre changed the title [GroupedMM] Initial prototype of _grouped_scaled_mm function for torchao (forward pass only) [WIP] Initial prototype of _grouped_scaled_mm function for torchao (forward pass only) Mar 27, 2025
None,
0,
-1,
-2,
Copy link
Contributor Author

@danielvegamyhre danielvegamyhre Mar 28, 2025

Choose a reason for hiding this comment

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

Note for reviewer: we need to allow expand this constraint so we can do rowwise scaling of the 2D subtensors embedded in 3D tensors.

e.g.

  • A = (M,K) and B = (B,K,N)
  • A_scale should be (M,)
  • B_scale should be (B,N) <-- because we computed rowwise scales for the (K,N) subtensors

@danielvegamyhre danielvegamyhre changed the title [WIP] Initial prototype of _grouped_scaled_mm function for torchao (forward pass only) [WIP] Initial prototype of _grouped_scaled_mm function for torchao Mar 28, 2025
@danielvegamyhre danielvegamyhre changed the title [WIP] Initial prototype of _grouped_scaled_mm function for torchao [WIP] Initial prototype of differentiable grouped_scaled_mm function for torchao Mar 28, 2025
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.

2 participants