Repository navigation
[Bugfix][MRV1] Stage consistent FULL dummy metadata - #54604
Open
kyleliang-nv wants to merge 2 commits into
Open
kyleliang-nv wants to merge 2 commits into
kyleliang-nv wants to merge 2 commits into
Conversation
kyleliang-nv
force-pushed
the
agent/minimax-m3-full-dummy-metadata
branch
from
August 31, 2026 22:41
d69bdd9 to
2c28cf8
Compare
5 of 6 tasks
4 tasks done
kyleliang-nv
force-pushed
the
agent/minimax-m3-full-dummy-metadata
branch
from
September 15, 2026 22:09
2c28cf8 to
6f7022f
Compare
Derive computed lengths and absolute positions from dummy sequence metadata, clear padded rows, and keep DCP from overwriting the staged positions. Assisted-by: OpenAI Codex Signed-off-by: Kyle Liang <kylliang@nvidia.com>
Normalize the CPU sequence-length mirror before staging device metadata so short profiling overrides cannot create negative computed lengths or positions. Cover short and long profiles, padding, mixed DCP and ragged decode with CPU regressions. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Kyle Liang <kyleliang-nv@users.noreply.github.com>
kyleliang-nv
force-pushed
the
agent/minimax-m3-full-dummy-metadata
branch
from
September 21, 2026 22:45
6f7022f to
8a18005
Compare
kyleliang-nv
marked this pull request as ready for review
September 21, 2026 22:45
This branch has not been deployed
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.
Purpose
The V1 model runner's FULL CUDA-graph profiling can stage a long dummy sequence length without staging matching absolute token positions. MiniMax-M3's MSA indexer derives causal page counts from those positions, while sparse decode derives the number of entries to consume from sequence lengths. Specifically,
MiniMaxM3IndexerMSAMetadataBuilder.build()computesnum_valid_pages = positions // 128 + 1and supplies it tosparse_topk_select, which pads out-of-range selections with-1. Sparse decode instead consumesmin(topk, ceil(kv_len / 128))entries based onseq_lens. Stale short positions paired with long dummy sequence lengths therefore leave sentinels inside that consumed range.Stage the same length/position invariants used by real batches:
seq_len == num_computed_tokens + num_scheduled_tokenspositions == num_computed_tokens[req_indices] + query_posAlso clear scheduled/computed lengths for padded request rows and positions for padded tokens. The DCP helper consumes these staged positions rather than overwriting them with a second formula.
A profiling override can be shorter than the scheduled query. Normalize the CPU sequence length to at least the query length before copying it to the GPU, so both mirrors agree and computed lengths/positions cannot become negative. This changes dummy preparation only, not real-request scheduling.
For a mixed DCP batch, computed lengths remain the dummy context length. For uniform speculative decode with a ragged final request, its positions move to the causal tail, ending at
seq_len - 1.Staging is restricted to paths that build attention metadata (
force_attentionor FULL). Ordinary dummy runs without attention metadata do not launch the MiniMax-M3 indexer/attend kernels. The kernel safety boundary remains a separate change in #54597.Current-main review
Rebased onto public main
8bf051cd51adff79e1bc94e910adaea543aaa2e1on September 21, 2026. This fixes the still-supported V1 model runner, not Model Runner V2.Merged #55212 initializes MRv2 DCP-local metadata and merged #56170 changes a ROCm cumulative-length scalar upload; neither stages these V1 positions. #53671 separately bounds dummy lengths by
max_model_len. #51585 preserves CPU query offsets for a different capture failure. These changes do not replace this invariant correction.Test Plan
Five focused CPU cases exercise the real staging helper and DCP preparation without model weights:
[4092, 4093, 4094, 4095]; a short override must produce nonnegative positions.[1, 6]and a ragged uniform-decode batch with query lengths[4, 3]; verify computed lengths, position bounds and the exact active query-start slice used for slot mapping.The CPU-only tests use the existing
skip_global_cleanupmarker because they create no accelerator or distributed state. Block-table side effects are mocked; the tensor computations and DCP helper execute normally.pre-commit run --files vllm/v1/worker/gpu_model_runner.py vllm/v1/worker/cp_utils.py tests/v1/worker/test_gpu_model_runner.py VLLM_TARGET_DEVICE=cpu .venv/bin/python -m pytest --confcutdir=tests/v1/worker tests/v1/worker/test_gpu_model_runner.py tests/v1/worker/test_cp_utils.py -k 'stage_dummy_request_metadata or dcp_dummy_context_preserves_staged_request_invariants or skip_gate' -qTest Result
--confcutdirexcludes unrelated repository-wide fixtures; the real runner module, staging helper and DCP helper are imported and exercised.-3instead of0.git diff --check: passed.AI assistance
OpenAI Codex assisted with implementation, review, tests and the rebase. Ready for maintainer review; this is not a claim that the outstanding GPU validation has passed. Human submitter review and execution of the relevant tests remain required before merge. No private infrastructure or run information is included.