[Feat] Add MUSA flash attention support via mate package (#2451)

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
R0CKSTAR authored and GitHub committed 2026-04-08 16:01:30 +08:00
1 parent c3c736d488
commit fb3c6bd9b1
5 files changed
+49 -6

No files matched your search

@@ -209,3 +209,13 @@ class FlashAttentionImpl(AttentionImpl):
layout="BNSD",
)
return output
def forward_musa(
self,
query: torch.Tensor,
key: torch.Tensor,
value: torch.Tensor,
attn_metadata: AttentionMetadata = None,
) -> torch.Tensor:
# XXX (MUSA): MUSA uses the same implementation as XPU (mate only provides flash_attn_varlen_func)
return self.forward_xpu(query, key, value, attn_metadata)