Skip to content

Fix GroupQueryAttentionFusion crash on ONNX-domain RotaryEmbedding#29707

Open
namgyu-youn wants to merge 1 commit into
microsoft:mainfrom
namgyu-youn:pr/28604-gqa-fusion-fix
Open

Fix GroupQueryAttentionFusion crash on ONNX-domain RotaryEmbedding#29707
namgyu-youn wants to merge 1 commit into
microsoft:mainfrom
namgyu-youn:pr/28604-gqa-fusion-fix

Conversation

@namgyu-youn

@namgyu-youn namgyu-youn commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

GroupQueryAttentionFusion matches GQA input producers by OpType() == "RotaryEmbedding" without a domain check, and reads InputDefs()[2]/[3] assuming the contrib signature (input, position_ids, cos_cache, sin_cache). The ONNX-domain opset-23 op is (X, cos_cache, sin_cache, position_ids?), so a spec-valid 3-input node reads out of bounds — aborting session init on builds with _GLIBCXX_ASSERTIONS (e.g. nightly wheels), silent UB otherwise.

Fix: require Domain() == kMSDomain, so the fusion skips ONNX-domain graphs instead of misreading them. Adds a regression test that aborts without the fix.

Motivation and Context

Fixes #28604 (repro and analysis: #28604 (comment)). #29524/#29552 concern a different defect in this function and are not changed here.

Developed with AI assistance (Claude Code); reviewed by the author.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion failure in graph optimizer Level2 after MatmulTransposeFusion on large MoE model

1 participant