Cherry pick four attention PRs#7315
Merged
justinchuby merged 4 commits intorel-1.19.1from Sep 22, 2025
Merged
Conversation
### Description Replace tile with repeat interleave in repeat KV in attention ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> In GQA, we need to match kv to multiple q, and previous to this PR, we used tile, which gave us [head0, head1, head0, head1] combinations. However, in torch, it uses repeat interleave ([head0, head0, head1, head1]). https://github.com/pytorch/pytorch/blob/734ce8eba9c69381f187359bf0fef1d71d84cd20/torch/nn/functional.py#L5833-L5835 --------- Signed-off-by: Ti-Tai Wang <titaiwang@microsoft.com>
… following opset 24 specs) (#7282) ### Description Force the opset to be 23 in all backtest related to Attention except 1 following opset 24 definition. ### Motivation and Context A runtime only implementing opset 23 cannot be tested otherwise (without tweaking). --------- Signed-off-by: xadupre <xadupre@microsoft.com>
### Description Fix causal mask for attention. Another unrelated change was needed to achieve that goal: when the automated backend test produces the expanded version of a test (meaning the operator can be replaced by a function), it was done without considering the opset. This could lead to a wrong model. Now, the expanded test takes the function definition coming from the same opset than the one used in the test. ### Motivation and Context Past should not be impacted by the causal mask. --------- Signed-off-by: xadupre <xadupre@microsoft.com> Signed-off-by: Xavier Dupré <xadupre@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
### Description <!-- - Describe your changes. --> ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> Signed-off-by: xadupre <xadupre@microsoft.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rel-1.19.1 #7315 +/- ##
=============================================
Coverage ? 53.77%
=============================================
Files ? 512
Lines ? 32214
Branches ? 2946
=============================================
Hits ? 17322
Misses ? 14121
Partials ? 771 ☔ View full report in Codecov by Sentry. |
gramalingam
approved these changes
Sep 22, 2025
Closed
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.
Cherry pick of