[Bug] Fix sparse attention issue for GLM5.2 non-torch compile path (#47083)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Jun 29, 2026 at 18:45 UTC
75698e60b3b0db7f443f8bf19d5d3a20ddc4ce0a
1 file changed
+4
-4
vllm/models/deepseek_v32/nvidia/attention.py
+4
-4
@@ -467,10 +467,6 @@ class DeepseekV32Attention(MLAAttention):
467
index_rope_interleave=self._index_rope_interleave,
468
)
469
470
- if attn_metadata is None:
471
- output.zero_()
472
- return
473
-
470
if self.indexer is not None:
471
sparse_attn_indexer(
472
q_c,
@@ -492,6 +488,10 @@ class DeepseekV32Attention(MLAAttention):
488
True, # skip_topk_buffer_clear (fused_norm_rope already did it)
489
)
490
491
+ if attn_metadata is None:
492
+ output.zero_()
493
+ return
494
+
495
num_actual = attn_metadata.num_actual_tokens # type: ignore[attr-defined]
496
kv_cache = self.kv_cache
497
if self._fp8_kv_needs_view: