SDPA: use exp_u20 for the softmax exponential (#22082) - #22082
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22082
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Cancelled Job, 1 Unrelated Failure, 13 Unclassified FailuresAs of commit a8cac3c with merge base 2287a8b ( NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
CANCELLED JOB - The following job was cancelled. Please retry:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pssrawat has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117198987. |
Summary: Switch the softmax exponential in the flash-attention custom SDPA kernel (`op_sdpa_impl.h`) from `Vectorized::exp()` to `Vectorized::exp_u20()`. The file already carried this as a TODO. This is not bit-exact. `exp_u20` is a ULP-20 approximation, so it differs from `exp` outright, and fourteen autoregressive layers on that is enough to flip a near-tie argmax. Differential Revision: D117198987
a8cac3c to
08329b3
Compare
This PR needs a
|
Summary:
Switch the softmax exponential in the flash-attention custom SDPA
kernel (
op_sdpa_impl.h) fromVectorized::exp()toVectorized::exp_u20(). The file already carried this as a TODO.This is not bit-exact.
exp_u20is a ULP-20 approximation, so it differsfrom
expoutright, and fourteen autoregressive layers on that is enoughto flip a near-tie argmax.
Differential Revision: D117198987