Conversation
Adapt vllm-project/vllm#51865 (0a94d85a66499cad8297ead86a470967de5c0212) to the current target and Eagle/MTP draft paths. A K+1-token prompt tail must not replay a decode graph merely because its shape matches. Preserve dummy capture and genuine decode classification. Co-authored-by: Rahul Chalamala <22563365+rchalamala@users.noreply.github.com> Co-authored-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: Janelle Cai <janelle.cai@modal.com> Assisted-by: OpenAI Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and fix
A real prompt chunk can contain exactly
1 + num_speculative_tokenstokens. MRV2 then mistakes its shape for uniform decode and replays a FULL speculative-decode CUDA graph even though the attention metadata describes prefill. Stateful hybrid models can produce corrupted output; a genuine decode sharing that batch can also be affected.Adapt the phase-aware dispatch fix from vllm-project/vllm#51865 (0a94d85a66499cad8297ead86a470967de5c0212) to 1Cat's current MRV2 layout:
This is a narrow semantic backport, not a wholesale import of upstream's
gather_batch_req_staterefactor or its PCP/autoregressive modules, which are absent in this branch. No new setting, kernel change, or cache-retention change is introduced.Existing work
Upstream #51865 is merged but is absent from 1Cat main. 1Cat #434 addresses the older runner (
gpu_model_runner.py), not MRV2 (gpu/model_runner.py). The existing DFlash2 guard does not cover MTP or mixed batches. Searches of open 1Cat PRs for51865 in:bodyandprefill decode dispatchfound no overlapping fix. Related upstream report: vllm-project/vllm#49918.Validation
Unit and graph checks: 42 passed (39 new regressions + 3 existing graph-shape tests), in the candidate's Python environment:
For the container run, the two tests were copied to
/auditand executed separately with/opt/venv/bin/python -m pytest ... --confcutdir=/audit; pre-commit ran in the source worktree. All applicable hooks, including mypy, passed.The regressions cover fresh prompts, chunked tails, mixed batches, fully computed prompts, non-contiguous state indices, unscheduled prefills, dummy capture, non-uniform batches, and propagation of the classification into DP dispatch. Widths 1, 3, 4, 5, 7, 8 and 16 are covered. Existing MTP split/DFlash graph shapes remain valid.
GPU: 4 x V100 32 GiB, TP4, Qwen3.8 Flash-Next AWQ target + native FP8 MTP3 draft, FULL_AND_PIECEWISE, 800-token cache blocks, C2, 32 GiB RAM offload, unchanged retention interval 0.
Before the fix, a public minimal prompt (
Reply with OK.padded with space token IDs to 804 tokens) producedduct!!!!!!!!!!!!!!!!!!!!!!!at temperature 1/top_p .95/top_k 20. Greedy output instead contained repeated out-of-vocabulary ID 248320. Neighboring 803/805-token controls were clean. A previous same-process diagnostic OFF/ON/OFF/ON guard experiment on an 88,804-token prompt produced bad/good/bad/good output while keeping the cache/offload patches enabled.With this formal target+draft patch, 25/25 GPU responses passed:
OK; exact cold/warm output token parityOK, no invalid token IDs or repeated punctuationOKin all three pairsOK88,804 cold/warm completion times were 35.834/0.590 s; 99,204 were 40.750/0.596 s. Both long requests together completed in 88.795 s. These are end-to-end completion times, not a controlled performance benchmark. Long-prefill contention remains; this fix addresses correctness.
The NaN counter was zero even in the earlier broken run, so success is assessed from actual output IDs/text and sequence correctness, not that counter.
Minimal HTTP reproducer against a running model with MTP3 and 800-token block alignment:
GPU validation uses the existing production image with only these three Python source edits applied, preserving the previously deployed cache/offload fixes. It does not claim a full rebuild or model-wide qualification of the latest 1Cat main. Original incident state and production cache are preserved outside the test environment.
AI assistance
OpenAI Codex assisted with upstream research, adaptation, regression tests and V100 validation, under the maintainer's explicit direction. The evidence and test scope above describe agent-run checks; they do not assert an independent human review.