Conversation
Execute the checkpoint's shared MTP head through the existing engine and scheduler. Verify up to four candidates, commit matching Conv/GDN states without target replay, and reclaim request resources on stop or failure. Reuse column-parallel vocabulary projection, Marlin FP8 packing and PagedCompiler draft capture. Bound recurrent rows independently from KV pages and make exact-prompt snapshots opt-in. Wire MTP through the CLI, benchmark and service entrypoints; retain three core MTP test modules. Validated NVIDIA A6000 TP1/TP2, graph recapture, forced acceptance lengths, real 27B FP8 batching/cancellation, and ordinary Qwen2 pre-transpose. Runtime support: InfiniTensor/InfiniCore#1565; graphs also require #1560.
big-hip
marked this pull request as draft
September 19, 2026 13:22
Keep ordinary short-prefill dispatch, preserve live KV during graph recapture, and defer cleanup until a timed-out worker exits. Retain opt-in MTP acceleration features and cover ordinary projection, recapture, shutdown and remote-release contracts.
big-hip
marked this pull request as ready for review
September 19, 2026 15:57
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.
Summary
Add opt-in text-only greedy decoding through Qwen's built-in MTP head. Draft 1–4 candidates, verify with the target model, and commit the accepted Conv/GDN checkpoint without replaying the target after rejection. Reuse the existing scheduler, paged cache, linear layers, weight loader and graph facilities.
csrc/models/qwen3_5/, shared recurrent logic inqwen3_next, and request orchestration inllm/model_runner/mtp_runner.py.Review boundary: NVIDIA single-request TP1/TP2 results pass. New 5090 controlled cancel/re-admit testing has an unresolved exact-token mismatch despite successful cleanup. Resolve it or explicitly narrow the accepted service scope before merge.
Motivation and ordinary-inference impact
The existing model path discards MTP weights. Hybrid speculation additionally needs Conv and GDN state committed at the accepted token boundary; attention KV rollback alone is insufficient.
MTP is opt-in, but vocabulary-parallel projection, corrected norm/tied-weight loading and checkpoint-configured FP32 recurrent state also affect ordinary Qwen inference. FP32 doubles that state component versus BF16, not total model memory. Ordinary short GDN Prefill retains chunked dispatch; checkpointed verification uses per-token recurrence. Graph recapture preserves active KV; timed-out shutdown retains in-flight resources until cleanup. Ordinary numerical/lifecycle checks passed; performance is not certified unchanged for every model/backend.
Type of Change
feat— optional model-head speculation and service integration.fix— required weight-layout, state-ownership and lifecycle correctness.Test Results of Involved Models on Supported Platforms (Please attach screenshots)
Source head remains
86208ae1. Core runtime/graph prerequisites are now together in InfiniTensor/InfiniCore#1566; the former #1560 dependency is included there. No Mamba scan dependency.Raw A6000 checks, source/build details and ordinary-path audit; 5090 conditions, raw results and unresolved failures.
Benchmark / Performance Impact
Current-head 2×5090 (32607 MiB/device), SM120, driver 610.43.02, CUDA 13.3, PyTorch
2.13.0a0+8145d630e8.nv26.06; SYS topology without CUDA P2P. Text, greedy, TP2/PP1, batch=1, prefix reuse off, 80×64-token pages, FP32 recurrent state, FP8 weights/BF16 compute (Marlin W8A16). Prompt Prefill stays eager; 64 output tokens, EOS ignored for fixed-work timing, three repeats after warmup. Median rate(N-1)/(wall-TTFT)includes CPU/scheduler, excludes loading/Prefill.Against the faster ordinary eager/graph mode per case, K2 gains +69.7%/+85.5%/+65.5%. Ordinary eager/graph differ below 1%; K1 draft graphs show no consistent extra gain. Nsight confirms 62 actual ordinary graph launches for 31 steps ×2 ranks. Warm-cache native FP8 probes do not establish an InfiniLM W8A8 integration or justify replacing Marlin for short verification.
100 ms sampled device peaks: ordinary 23766/23774 MiB; K2 24394/24398; K4 24774/24766. Three K1 graph recaptures during active requests and state-pool rebuild preserve exact continuations, peak 24382/24380 MiB; no observed growth above initial load. Brief peaks may be missed; this is not a long-duration leak test. Separate profiling identifies GDN chunk Prefill (~83% of the 1023-token initial step) and rank-wait imbalance as follow-up targets.
Archived TP2 A6000 (48 GiB/device, PCIe, same quantization/precision, 40×64 pages, two repeats): ordinary graph→K2 eager 33.91→49.57, 33.48→53.29, 30.03→48.61 tok/s for 63/127/1023-token prompts (64/64/55 output, last ends at EOS). Those are pre-cleanup measurements using aggregate rate; current-head 5090 medians above are separate evidence. TP2 draft batching remains disabled after inconsistent benefit.
vLLM ordinary native FP8 measures about 73.3 tok/s on the 5090 setup. Its K2 output differs from its own ordinary baseline at the first token; isolated 143.66 tok/s is failed-validation diagnostic only. No validated vLLM MTP speedup comparison; its different cache budget also prevents a capacity-matched memory claim.
Dependencies, scope and review
InfiniLM-v0.2.9c. Runtime prerequisite: issue/1565 fix(runtime): support Qwen MTP and recurrent graph replay InfiniCore#1566, including graph ownership/replay. There is no separate #1560 dependency and no dependency on Mamba scan #1562.CI / ChatOps
Unchanged LM head
86208ae1: fork format and Ruff passed; fork hardwareciwas skipped. Upstream CI and Ruff areaction_required. Maintainer approval/retest must use the matching Core dependency; formatting success is not hardware coverage. Ready for code review, subject to the stated correctness boundary, required CI and maintainer approval before merge.Checklist
Title, Branch, and Commits
feat(nvidia): …,fix(cuda/gemm): …).<type>/xxx-yyyy-zzzzwhere<type>matches the PR title's Conventional Commits type and words are joined with hyphens (seeCONTRIBUTING.md§Branches).CONTRIBUTING.md§Pull Requests).InfiniLM-v0.2.9c(270feb3e).fixup!/squash!/wipcommits remain.Scope and Design
CONTRIBUTING.md§Code/General).printf/std::cout/print(...)left behind, orTODOwithout an owner and issue link.General Code Hygiene (applies to all languages)
CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).the `seqlens_k` tensor) (CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General; §Python).C++ Specific (if C++ files changed)
CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).new/delete; RAII / smart pointers / existing allocators are used.scripts/format.py.csrc/models/llama_legacy/.Python Specific (if Python files changed)
CONTRIBUTING.md§Python).CONTRIBUTING.md§Python).scripts/format.py.python/infinilm/auto_config.py.Testing
examples/test_infer.py), or specify the reason for skipping.examples/bench.py), or specify the reason for skipping.test/bench/test_benchmark.py), or specify the reason for skipping.python/infinilm/server/inference_server.py+scripts/test_perf.py), or specify the reason for skipping.Build, CI, and Tooling
/retestwas requested.Documentation
README.md,CONTRIBUTING.md, or inline docs updated when behavior, build flags, or developer workflow changed.Security and Safety