Skip to content

Conversation

@gramalingam
Copy link
Collaborator

@gramalingam gramalingam commented Nov 5, 2025

Implement SDPA via MHA. This handles the case when earlier fusion rules do not map larger patterns containing SDPA into MHA or GQA or Attention (from ORT contrib ops). It implements SDPA via MHA.

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 60.60606% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.11%. Comparing base (d80575d) to head (aeee0fa).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
onnxscript/rewriter/ort_fusions/sdpa_test.py 42.10% 11 Missing ⚠️
onnxscript/rewriter/ort_fusions/sdpa_via_mha.py 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2683   +/-   ##
=======================================
  Coverage   70.11%   70.11%           
=======================================
  Files         224      225    +1     
  Lines       26982    27068   +86     
  Branches     2705     2721   +16     
=======================================
+ Hits        18919    18980   +61     
- Misses       7129     7148   +19     
- Partials      934      940    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
@gramalingam gramalingam changed the title [DRAFT] Implement SDPA via MHA Implement SDPA via MHA Nov 5, 2025
@gramalingam gramalingam marked this pull request as ready for review November 5, 2025 22:31
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
@gramalingam gramalingam merged commit 70e751a into main Nov 7, 2025
32 of 33 checks passed
@gramalingam gramalingam deleted the rama/sdpa-impl branch November 7, 2025 18:34
@github-project-automation github-project-automation bot moved this from Todo to Done in ONNX Script Review Board Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants