[Spec Decode] Structured output under concurrency on a PP shape

Ports upstream vLLM PRs #54442 and #56802 (issue #54437): never sample from an
unmasked row, and key draft-token hand-off snapshots by scheduler step so an
alternating PP microbatch cannot overwrite the slot.

Co-Authored-By: Hinata <hinata@idihore.id>
Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
2026-10-09 19:43:58 +07:00
co-authored by Hinata
parent 03c8ebae34
commit 17c1c70447
12 changed files with 262 additions and 43 deletions
+2 -1
View File
@@ -4821,7 +4821,8 @@ class GPUModelRunner(
bt.block_table.gpu.copy_(saved_gpu)
bt.block_table.cpu.copy_(saved_cpu)
def take_draft_token_ids(self) -> DraftTokenIds | None:
def take_draft_token_ids(self, step_id: int | None = None) -> DraftTokenIds | None:
del step_id # V2-only identity; V1 keeps a single proposal slot.
if not self.num_spec_tokens or not self._draft_token_req_ids:
return None
draft_token_ids, req_ids = self._get_draft_token_ids_cpu()