-
Notifications
You must be signed in to change notification settings - Fork 294
[scaled grouped mm] add triton kernels for float8 rowwise quantization with per-group/jagged scales #2064
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2064
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 4 New Failures, 4 PendingAs of commit d818d51 with merge base f788897 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
db30377
to
1d5b2c9
Compare
also cc @vkuzo for visibility upon return from recharge |
drisspg
reviewed
Apr 21, 2025
drisspg
reviewed
Apr 21, 2025
torchao/prototype/scaled_grouped_mm/kernels/jagged_float8_scales.py
Outdated
Show resolved
Hide resolved
drisspg
approved these changes
Apr 21, 2025
confirmed test failures are unrelated to this change |
36 tasks
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)
topic: performance
Use this tag if this PR improves the performance of a feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Next PR in stack: #2077
Motivation
offs.tolist()
on the CPU, which negatively impacts performance.Summary
This PR adds 2 Triton kernels:
_triton_fp8_row_major_jagged_rowwise_scales
: performs dynamic float8 quantization with row-wise scales for each group (as determined by the offsets), and writes the output in row-major memory layout. This kernel is to be used for quantizing left operand of the scaled grouped mm in the backward pass of the differentiable scaled grouped mm, to computegrad_weight
(see here)._triton_fp8_col_major_jagged_colwise_scales
: performs dynamic float8 quantization with row-wise scales computed over logical columns for each group (as determined by the offsets), and writes the output in col-major memory layout. This kernel is to be used for quantization of the right operand of the scaled grouped mm in the backward pass of the differentiable scaled grouped mm, to computegrad_weight
(see here).Test plan
Next steps