[Fix] DSA: size cudagraph page_table to req_to_token width (#29379)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jackey Hua
2026-06-26 12:17:34 -07:00
committed by GitHub
co-authored by Claude Opus 4.8
parent be1930133a
commit ee77a7d330
@@ -1003,11 +1003,11 @@ class DeepseekSparseAttnBackend(
max_bs + 1, dtype=torch.int32, device=self.device
),
# fake page_table for sparse_prefill
# Add extra columns for speculative draft tokens to avoid
# overflow during target_verify when max_seqlen_k = seq_len + num_draft_tokens
# Match req_to_token's width exactly. It is over-allocated beyond
# context_len because spec decoding lets seq_len transiently overshoot.
"page_table": torch.zeros(
max_num_tokens,
self.max_context_len + (self.speculative_num_draft_tokens or 0),
self.req_to_token.shape[1],
dtype=torch.int32,
device=self.device,
),