Fix DSpark warmup without sparse index buffer (#50693)

Signed-off-by: xijiade.aihemaiti <3146335281@qq.com>
Signed-off-by: xijiaat <52128022+xijiaat@users.noreply.github.com>
Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
xijiaat
2026-08-10 15:12:19 -04:00
committed by GitHub
co-authored by Wentao Ye OpenAI Codex
parent 1482d2e015
commit d40c3e3c00
+5 -2
View File
@@ -96,8 +96,11 @@ class DeepseekV4FlashMLAAttention(DeepseekV4Attention):
// self.compress_ratio
)
M = N + self.window_size + self.max_num_batched_tokens
assert self.topk_indices_buffer is not None
top_k = 0 if swa_only else self.topk_indices_buffer.shape[-1]
if swa_only:
top_k = 0
else:
assert self.topk_indices_buffer is not None
top_k = self.topk_indices_buffer.shape[-1]
combined_topk = round_up(top_k + self.window_size, 128)
current_workspace_manager().get_simultaneous(
((self.PREFILL_CHUNK_SIZE, M, q.shape[-1]), torch.bfloat16),