Repository navigation
llama : MTP draft context keeps the catch-up graph on a second scheduler - #348
Open
Nathanw1014 wants to merge 1 commit into
Open
Nathanw1014 wants to merge 1 commit into
Nathanw1014 wants to merge 1 commit into
Conversation
The K/V-only MTP catch-up over the verified rows (no outputs) and the one-token draft step evict each other from the context's one scheduler, so both MTP graphs are rebuilt every round. Batches of <= 64 tokens without outputs on an MTP context now run on a second scheduler with their own graph result, and the context's own scheduler is back in place after each ubatch. LLAMA_MTP_GRAPH_SLOT=0 turns it off. LLAMA_GRAPH_TIMING lines gain alt=0|1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nathanw1014
force-pushed
the
hb/mtp-graph-slot
branch
from
December 6, 2026 01:02
804aa7e to
6ca21b5
Compare
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.
MTP decode on Qwen4 is 6.6% faster on Vulkan (Strix Halo, Qwen4-35B-A3B UD-Q4_K_XL + Q8_0 MTP,
--spec-draft-n-max 1,-np 1): 62.62 vs 58.76 t/s, ABBA, same binary with the knob on and off.Each MTP round runs two draft-context graphs: the K/V-only catch-up over the verified rows (no outputs) and the one-token draft step. One scheduler holds one allocated graph, so the two evicted each other and both were rebuilt and re-allocated every round. That host time grows when the CPU clocks down under load.
LLAMA_MTP_GRAPH_SLOT=0turns it off.LLAMA_GRAPH_TIMINGlines gainalt=0|1.Flash-Next (Qwen3.8-Flash-Next UD-Q4_K_XL + Q8_0 MTP, Vulkan,
--spec-draft-n-max 3, same binary, knob on vs off, 3 reps each):Graph reuse in the draft context goes from about 0 to 991 of 1035 graphs. Cost: one more compute buffer, +16 MiB GTT on Qwen4.
No change without a draft. Greedy text is identical with the slot on and off (Qwen4 56/56 requests, Flash-Next 4/4 prompts, same draft acceptance).
Tested:
ctest -L main(CPU build). Not tested: ROCm,-np> 1, GPUs other than gfx1151.AI usage: ASSISTED. Written with Claude, tested by me.
🤖 Generated with Claude Code