[Bugfix] Fix tensor shape mismatch in sparse attention with speculative decoding (#39542)

Signed-off-by: Santino Ramos <santinor@inferact.ai>
This commit is contained in:
Santino Ramos
2026-04-13 08:57:38 -07:00
committed by GitHub
parent 10d9872d3a
commit 4d042ed85f
@@ -213,7 +213,7 @@ def sparse_attn_indexer(
) )
torch.ops._C.persistent_topk( torch.ops._C.persistent_topk(
logits, logits,
decode_metadata.seq_lens, seq_lens,
topk_indices, topk_indices,
topk_workspace, topk_workspace,
topk_tokens, topk_tokens,
@@ -250,7 +250,7 @@ def sparse_attn_indexer(
topk_indices.reshape(batch_size, -1, topk_indices.shape[-1]), topk_indices.reshape(batch_size, -1, topk_indices.shape[-1]),
decode_lens, decode_lens,
) )
topk_indices_buffer[:num_decode_tokens, : topk_indices.shape[-1]] = ( topk_indices_buffer[: topk_indices.shape[0], : topk_indices.shape[-1]] = (
topk_indices topk_indices
) )