-
Notifications
You must be signed in to change notification settings - Fork 286
[float8] Prevent quantize_affine_float8/dequantize_affine_float8 decomposed on inductor #2379
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2379
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. |
Hi @shiyang-weng! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
This comment was marked as resolved.
This comment was marked as resolved.
39870b7
to
ca662f3
Compare
torchao/utils.py
Outdated
@@ -179,7 +179,7 @@ def find_multiple(n: int, *args: int) -> int: | |||
return n + k - (n % k) | |||
|
|||
|
|||
def _register_custom_op(lib): | |||
def _register_custom_op(lib, decomposed=True): |
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.
nit: can be more explicit, e.g. inductor_decomposed
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.
Done
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@@ -2270,6 +2270,7 @@ def _expand_scale_to_tensor_shape( | |||
return expanded_scale | |||
|
|||
|
|||
@_register_custom_op(quant_lib, False) |
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.
we can probably make quantize_affine_float8
and choose_qparams_affine_float8
public as well since it's used in inductor lowering. cc @jainapurva @drisspg
The two ci errors are irrelevant. Not find the errors on pt2.7.1 |
Fix #2228
Need to prevent q/dq decomposed both on fp8 and int8.
Based on discussion on #2299
Create this PR to prevent fp8 q/dq decomposed firstly.
On this PR,