Filter post-boundary speculative tokens before commit#8
Conversation
Represent skipped DFlash drafts as an empty tensor so the V1 runner preserves its tensor invariant while returning no drafts for structured-output requests. Co-authored-by: GPT-5.5 <gpt-5.5@cursor.ai> Signed-off-by: Simon Mo <simon@inferact.ai>
Keep a full-width placeholder tensor when DFlash is skipped for structured-output requests under async scheduling, while returning empty draft lists to the scheduler. Co-authored-by: GPT-5.5 <gpt-5.5@cursor.ai> Signed-off-by: Simon Mo <simon@inferact.ai>
When async DFlash is skipped for structured-output batches, cache the single sampled token that the proposer would normally prepare so bookkeeping remains on the async spec path. Co-authored-by: GPT-5.5 <gpt-5.5@cursor.ai> Signed-off-by: Simon Mo <simon@inferact.ai>
Restore DFlash drafting for structured-output/tool-call requests so the branch can fix the underlying grammar/spec-decode interaction without disabling acceleration. Co-authored-by: GPT-5.5 <gpt-5.5@cursor.ai> Signed-off-by: Simon Mo <simon@inferact.ai>
Keep DFlash/speculative decoding enabled for structured output while preventing unconstrained post-reasoning bonus tokens from entering the response stream. The scheduler now validates the post-boundary suffix before commit and rewinds token accounting for rejected grammar tokens. Co-authored-by: GPT-5.5 <gpt-5.5@cursor.ai> Signed-off-by: Simon Mo <simon@inferact.ai>
|
The agent also investigated some ongoing PRs Here’s the handoff summary. Current findingThe original-like issue is reproducible with public models:
This suggests the root is not simply “DFlash + structured output is incompatible.” Simple JSON/tool-call cases can still have high acceptance. The bad case is complex grammar-constrained generation with reasoning parser active, where DFlash drafts are unconstrained but target verification is grammar/reasoning constrained. Existing PRsvLLM PR vllm-project#36138“Grammar was ignored when reasoning ended within speculated tokens.”
vLLM PR vllm-project#43424“structured_output × spec-decode: pre-commit grammar filter for boundary-step bonus tokens.”
vLLM PR vllm-project#40898“Add Sliding Window Attention support to DFlash drafter.”
Local branch changesBranch: Net diff against base is now only:
Earlier incorrect skip-DFlash mitigation was reverted. Proposed/local changeAdd a pre-commit grammar filter:
This preserves DFlash instead of skipping it. What this fixesCorrectness issue:
Validated locally:
What this does not fixIt does not solve the full low-acceptance slowdown. The clean repro still shows:
So the remaining issue likely needs one of:
Recommended next steps
|
Purpose
Mitigate DFlash performance collapse on structured-output/tool-guided requests by disabling DFlash draft proposal for scheduled batches with active structured-output grammar. DFlash drafts are currently unconstrained while the target logits are grammar-constrained, so draft work can be repeatedly invalidated or rejected for tool-call/JSON-style outputs. Both model runner paths now return empty draft-token lists for this unsupported combination and log a one-time warning.
Why this is not duplicating an existing PR: searched open PRs for
DFlash structured output,dflash tool call, andspeculative structured output. Related PRs exist for structured-output speculative decoding correctness and a prototype grammar-aware spec decode path, but none specifically mitigate DFlash by suppressing unconstrained DFlash drafts on structured-output batches.AI assistance was used to investigate the bug report and prepare this change.
Test Plan
.venv/bin/pre-commit run ruff-check --files vllm/v1/spec_decode/utils.py vllm/v1/worker/gpu/spec_decode/utils.py vllm/v1/worker/gpu_model_runner.py vllm/v1/worker/gpu/model_runner.py tests/v1/spec_decode/test_mtp_structured_output.py.venv/bin/python -m pytest tests/v1/spec_decode/test_mtp_structured_output.py -qTest Result
17 passed, 25 warnings in 30.57s.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.