-
Notifications
You must be signed in to change notification settings - Fork 345
[CPU] [FP8 SDPA] Enable FP8 SDPA pattern match #3076
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/3076
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: ✅ No FailuresAs of commit 1ad747c with merge base 233cfc1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
7fc9ea4
to
1ad747c
Compare
@mingfeima Please help take a look at the PR, thanks! |
self.q_out_scale = 1.5 | ||
self.k_out_scale = 1.5 | ||
self.attn_weights_scale = 1.5 | ||
self.v_out_scale = 1.5 | ||
self.attn_out_scale = 1.5 | ||
self.qk_out_scale = 1.5 |
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.
any particular reason we use the magic number 1.5
? and FP8QDQLinear is using 2.0
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.
These values are just randomly selected.
if qtype == torch.uint8: | ||
assert zp is not None, "Zero point must be provided for uint8 dequantization" | ||
return CallFunction( | ||
torch.ops.quantized_decomposed.dequantize_per_tensor.default, |
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.
this is still using the old op, what is the e2e for quantized sdpa?
Support the FP8 SDPA pattern match.
Depend on #2565.