feat(native-mtp): prototype Qwen3-Next native MTP path - #36112
Open
ntny wants to merge 1 commit into
Open
Conversation
ntny
requested review from
Qiaolin-Yu,
Ying1123,
hnyls2002 and
merrymercy
as code owners
August 23, 2026 22:05
ntny
force-pushed
the
feat-qwen3-next-prototype-native-MTP-speculative-path-
branch
7 times, most recently
from
August 24, 2026 23:38
1769aef to
0e968e2
Compare
This moves the draft MTP block into the target model initialization path, so the MTP weights can be loaded together with the target model instead of through a separate speculative draft model. Signed-off-by: Anton Pechenin <ntny1986@gmail.com>
ntny
force-pushed
the
feat-qwen3-next-prototype-native-MTP-speculative-path-
branch
from
August 25, 2026 17:13
0e968e2 to
a4dc2b2
Compare
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.
This is an early prototype to discuss the native Qwen3-Next MTP direction with the community.
The goal is to keep the MTP block inside the target model, load its weights with the target checkpoint, and reuse the existing EAGLE v2 orchestration with minimal changes.
Motivation
Prototype native Qwen3-Next MTP: keep the MTP block inside the target model and load its weights with the target checkpoint.
This avoids a separate draft model loading path and makes MTP initialization/debugging simpler. Draft KV stays separate to avoid corrupting target KV.
Modifications
--enable-native-mtp.Prototype Limitation
Draft CUDA graph capture is intentionally disabled at this prototype stage. Native MTP currently runs draft decode/extend through eager execution.
So current performance numbers should not be treated as final.
The main risk with enabling CUDA graph capture is correctness around static graph buffers and KV writes: the existing EAGLE graph path was built around a separate draft runner, while this prototype uses an embedded MTP block exposed through a lightweight runner
facade. Before enabling graphs, we need to verify that draft decode/extend writes only to draft KV and produces logits matching the separate draft model path.
Startup Check
Both the baseline separate-draft flow and the native MTP prototype start successfully and handle a
/generaterequest.From the startup logs:
Qwen3NextForCausalLM74.31 GBQwen3NextForCausalLMMTP2.12 GBQwen3NextForCausalLM75.84 GBSo on
tp=2, native MTP avoids the second draft model load and saves about:74.31 GB + 2.12 GB - 75.84 GB = 0.59 GBThis is expected because native MTP shares target
embed_tokensandlm_headinstead of keeping separate draft copies.Accuracy Tests
In progress. This is currently a prototype for validating the native MTP direction.
Speed Tests and Profiling
In progress. Performance numbers will be collected after the prototype path is validated.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #32876597305
Latest PR Test (Extra): ❌ Run #32876597058
Latest PR Test (AMD ROCm 7.2): ❌ Run #32876597273