Skip to content

[NPUW] Make Whisper cross-attention passes tolerate decomposed SDPA - #37402

Draft
parthmah14 wants to merge 1 commit into
openvinotoolkit:masterfrom
parthmah14:parthmah/whisper-decomposed-sdpa
Draft

[NPUW] Make Whisper cross-attention passes tolerate decomposed SDPA#37402
parthmah14 wants to merge 1 commit into
openvinotoolkit:masterfrom
parthmah14:parthmah/whisper-decomposed-sdpa

Conversation

@parthmah14

@parthmah14 parthmah14 commented Aug 12, 2026

Copy link
Copy Markdown

Fixes the CVS-179287 crash: NPUW's Whisper transformation passes assumed cross-attention is always a single fused SDPA node. Once cross-attention SDPA is decomposed, the encoder KV-cache state's reader count/type changes, breaking a hardcoded assert and a port-index key/value heuristic. This makes those passes (and the attention-mask injection) handle both the fused and decomposed shapes.

Part 1 of 3 for CVS-184242

Tickets:

The NPUW-specific Whisper transformation passes (KV-cache state exposure
and attention-mask injection) assumed cross-attention SDPA is still a
single fused ScaledDotProductAttention node. Once GenAI decomposes
cross-attention SDPA for word-level timestamps, the encoder-attn
ReadValue/consumer shapes change (the key branch gains a ShapeOf reader
and the value branch's consumer type changes), which crashed the
rv_readers.size() == 2 assertion (CVS-179287) or silently misclassified
key/value.

Classify encoder-attn KV-cache states by consumer type instead of a fixed
SDPA port index, and inject the cross-attention mask at the decomposed
"QK scaled scores" node (identified by its tensor name) when no fused
SDPA node exists. Both passes now handle the fused and decomposed shapes
uniformly, since decomposition only happens when word_timestamps is
requested.

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

Labels

category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin ExternalIntelPR External contributor from Intel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants