-
Notifications
You must be signed in to change notification settings - Fork 209
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
Move fpx to tensor subclass #1603
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1603
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 4 PendingAs of commit 77167eb with merge base 0fae693 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left one minor comment
@@ -456,6 +462,53 @@ class FloatxTensorCoreLayout(Layout): | |||
mbits: int | |||
|
|||
|
|||
class FloatxTensor(AffineQuantizedTensor): | |||
""" | |||
Floatx quantized tensor subclass which inherits AffineQuantizedTensor class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be helpful for new users/developers to add a short sentence to the docstring explaining the difference between floatx and float8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto Daniels comment
55dee0e
to
9213cf5
Compare
9fc0f48
to
249987f
Compare
This reverts commit 70be245.
Make a new FpxTensor subclass, for fpx (float1-float7) quantizations.
Motivation: Fpx, has it's own implementation of choose_qparams_and_quantize_affine_fpx, quantization and dequantization for floatx quantization, hence a new tensor-subclass improves the code-quality. It reduces re-directions in AQT, and improves readability.
Future goals: Remove the AQT abstraction and make it independent tensor-subclass
Test Plan : Green CI