Update Int4PreshuffledTensor to align with implementation details of the Float8Tensor#2738
Merged
jerryzh168 merged 1 commit intomainfrom Aug 12, 2025
Merged
Update Int4PreshuffledTensor to align with implementation details of the Float8Tensor#2738jerryzh168 merged 1 commit intomainfrom
jerryzh168 merged 1 commit intomainfrom
Conversation
…the Float8Tensor Summary: similar to #2687, we updated Int4PreshuffledTensor to align the implementation details, also used TorchAOBaseTensor to simplify some of the implementations Note: This is just refactoring Int4PreshuffledTensor, no BC related changes in this PR Test Plan: python test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py Reviewers: Subscribers: Tasks: Tags: stack-info: PR: #2738, branch: jerryzh168/stack/20
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2738
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 12 PendingAs of commit 1073ced with merge base 7c13cde ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
jerryzh168
added a commit
that referenced
this pull request
Aug 11, 2025
…the Float8Tensor Summary: similar to #2687, we updated Int4PreshuffledTensor to align the implementation details, also used TorchAOBaseTensor to simplify some of the implementations Test Plan: python test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py Reviewers: Subscribers: Tasks: Tags: stack-info: PR: #2738, branch: jerryzh168/stack/20
b45aca0 to
584723f
Compare
This was referenced Aug 11, 2025
Merged
jerryzh168
added a commit
that referenced
this pull request
Aug 12, 2025
…the Float8Tensor Summary: similar to #2687, we updated Int4PreshuffledTensor to align the implementation details, also used TorchAOBaseTensor to simplify some of the implementations Note: This is just refactoring Int4PreshuffledTensor, no BC related changes in this PR Test Plan: python test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py Reviewers: Subscribers: Tasks: Tags: stack-info: PR: #2738, branch: jerryzh168/stack/20
584723f to
9b72101
Compare
jerryzh168
added a commit
that referenced
this pull request
Aug 12, 2025
…the Float8Tensor Summary: similar to #2687, we updated Int4PreshuffledTensor to align the implementation details, also used TorchAOBaseTensor to simplify some of the implementations Note: This is just refactoring Int4PreshuffledTensor, no BC related changes in this PR Test Plan: python test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py Reviewers: Subscribers: Tasks: Tags: stack-info: PR: #2738, branch: jerryzh168/stack/20
9b72101 to
986ce18
Compare
vkuzo
approved these changes
Aug 12, 2025
4edb547 to
2005be0
Compare
jerryzh168
added a commit
that referenced
this pull request
Aug 12, 2025
…the Float8Tensor Summary: similar to #2687, we updated Int4PreshuffledTensor to align the implementation details, also used TorchAOBaseTensor to simplify some of the implementations Note: This is just refactoring Int4PreshuffledTensor, no BC related changes in this PR Test Plan: python test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py Reviewers: Subscribers: Tasks: Tags: stack-info: PR: #2738, branch: jerryzh168/stack/20
986ce18 to
c0b8f24
Compare
jerryzh168
commented
Aug 12, 2025
| # dynamically quantizes activation to fp8 | ||
| assert weight_tensor.row_scale is not None | ||
| row_scale = weight_tensor.row_scale.contiguous() | ||
| xq, x_scale = quantize_fp8_row(input_tensor) |
Contributor
Author
There was a problem hiding this comment.
btw @vkuzo, we didn't use _choose_quant_func_and_quantize_tensor and float8 quant args yet, but we can add that if there are multiple choices of float8 activation quant in the future. please let me know if you have different thoughts here.
c0b8f24 to
1073ced
Compare
liangel-02
pushed a commit
that referenced
this pull request
Aug 25, 2025
…the Float8Tensor (#2738) Summary: similar to #2687, we updated Int4PreshuffledTensor to align the implementation details, also used TorchAOBaseTensor to simplify some of the implementations Note: This is just refactoring Int4PreshuffledTensor, no BC related changes in this PR Test Plan: python test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py Reviewers: Subscribers: Tasks: Tags:
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked PRs:
optional_tensor_namesin TorchAOBaseTensor #2710Update Int4PreshuffledTensor to align with implementation details of the Float8Tensor
Summary:
similar to #2687, we updated Int4PreshuffledTensor to align
the implementation details, also used TorchAOBaseTensor to simplify some of the implementations
Note: This is just refactoring Int4PreshuffledTensor, no BC related changes in this PR
Test Plan:
python test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py
Reviewers:
Subscribers:
Tasks:
Tags: