[DSv4 Perf] Optimize workspace reuse for eager break, 3.9% E2E TTFT improvement. (#49236)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Wentao Ye
2026-07-31 08:45:58 -07:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 5233368dac
commit df71917cf1
15 changed files with 354 additions and 30 deletions
@@ -745,6 +745,9 @@ class DeepseekV4FlashInferSM120Attention(DeepseekV4Attention):
attn_metadata.block_table[:num_decodes],
block_size,
is_valid,
output_buffers=self._global_topk_output_buffers(
self.topk_indices_buffer[:num_decode_tokens]
),
)
)
extra_sparse_indices = global_indices.view(num_decode_tokens, 1, -1)
@@ -834,6 +837,7 @@ class DeepseekV4FlashInferSM120Attention(DeepseekV4Attention):
attn_metadata.block_table,
block_size,
swa_metadata.is_valid_token[prefill_token_slice],
output_buffers=self._global_topk_output_buffers(local_topk_indices),
)
)