[Bugfix][Spec Decode] Use group geometry for FlashAttention metadata (#53002)

Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
Misha Goin
2026-08-21 17:07:19 -07:00
committed by GitHub
parent a34f2ab70a
commit 9ff7041b55
4 changed files with 70 additions and 18 deletions
+5 -1
View File
@@ -9,6 +9,7 @@ from typing import (
Any,
Literal,
Protocol,
cast,
get_args,
)
@@ -263,7 +264,10 @@ def get_num_attention_heads_from_layers(
)
if not attn_layers:
return None
heads = {layer.impl.num_heads for layer in attn_layers.values()}
heads = {
cast(Any, getattr(layer, "impl", layer)).num_heads
for layer in attn_layers.values()
}
assert len(heads) == 1, (
f"All layers in one attention group must share num_heads; "
f"got {heads} for {layer_names}."