[Bugfix][Spec Decode] Use group geometry for FlashAttention metadata (#53002)
Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
@@ -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}."
|
||||
|
||||
Reference in New Issue
Block a user