Avoid computing lse in Ragged Prefill when there's no prefix. (#5476)

Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
This commit is contained in:
Wenxuan Tan
2025-04-18 01:13:57 -07:00
committed by GitHub
co-authored by Baizhou Zhang
parent e465b08ddb
commit bfa3922451
3 changed files with 19 additions and 12 deletions
@@ -348,7 +348,7 @@ class FlashInferMLAAttnBackend(AttentionBackend):
if self.forward_metadata.use_ragged:
# ragged prefill
o, _ = self.prefill_wrapper_ragged.forward_return_lse(
o = self.prefill_wrapper_ragged.forward(
qall,
k.view(-1, layer.tp_k_head_num, layer.head_dim),
v.view(-1, layer.tp_k_head_num, layer.v_head_dim),