Repository navigation
qwen app: drafts from the context in the rounds of --mtp - #113
Merged
Merged
Conversation
… --mtp) With --mtp and --draft D, a round first looks for the longest match in the context. When the match has at least M tokens (default 12), the round takes up to D drafts from the tokens after the match. Otherwise the round takes MTP drafts as before. Only MTP rounds change the kept-share average. The MTP rows still run after every round, so the next MTP draft is ready. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014U9gTxfQzAEpmg4WJhYQqw
A shorter match often gives drafts that the round does not keep, and such a round costs more than the MTP round that it replaces. On the tuning prompts, matches of 12 made complete1 and write2 slower, and matches of 16 found only the repeats of the edit prompts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014U9gTxfQzAEpmg4WJhYQqw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014U9gTxfQzAEpmg4WJhYQqw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014U9gTxfQzAEpmg4WJhYQqw
The README had 538 lines. It now has 100: the models, the installation, how to run Qwen3.6-35B-A3B, the options, the tests, and a table of the documentation. The sections of the old README move to four files of docs/, with their text unchanged: - docs/usage.md: the installation, how to prepare and run a model, sessions and the prompt cache, the scripts, the Vx code and the tests, and the licenses of the models. - docs/weights.md: the fp8, Q4_0 and 6-bit formats, and the MoE model. - docs/internals.md: the prompt in chunks, long contexts, and the tokenizer. - docs/checks.md: the checks of the Vx program and of the reference. The moved links now start from docs/, and "this README" is now "the README of that time". The license of the code stays in LICENSE and THIRD_PARTY_NOTICES, not in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014U9gTxfQzAEpmg4WJhYQqw
A run that follows the benchmarking policy of the Vx repository, on an M4 with 32 GB. It measures qwen-vx at 730f1b7 without drafts, with --draft 11, with --mtp 3,5 and with --mtp 3,5 --draft 11, against llama-completion and llama-speculative-simple with ngram-mod and draft-mtp (3 tokens), llama.cpp b1b770d. Tables A and P and llama-bench too. docs/benchmarks/2026-11-25-qwen36-m4-mtp/ has the report, the scripts, the inputs, env.txt, log.txt, runs.csv, summary.md and the logs of each run. run.sh and parse.py come from the 2026-11-20 run, with the programs of the app with --mtp, an idle check that checks again after the cooling, and RERUN for the runs that another job overlapped. The README gets a short table of the speeds, and entries 16 to 19 of docs/optimizations.md get their results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014U9gTxfQzAEpmg4WJhYQqw
README: a short page, with the details in docs/
Benchmark of 2026-11-25: qwen-vx with MTP drafts against llama.cpp
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.
With
--mtpand--draft D, each round now first finds the longest match in the context. When the match has at least 16 tokens, the round drafts up to D tokens of the context after the match. Otherwise the round drafts from the MTP layer as before. Before this change,--draftand--mtpcould not run together.--draft D,Msets the shortest match to M. The default is 16, the longest match thatlongest_matchfinds. On the tuning prompts, matches of 12 to 15 tokens often gave drafts that the round did not keep, and such a round costs more than the MTP round that it replaces.docs/optimizations.md, and a paragraph in the README.The numbers come after a run that follows the benchmarking policy.
Tests
tests/generate_qwen35.vx: a new prompt with a long repeat.--mtp 3 --draft 7,2gives the same steps as plain decoding, and runs one round with 7 drafts from the context.tests/run.sh: 121 PASS, 0 FAIL.🤖 Generated with Claude Code
https://claude.ai/code/session_014U9gTxfQzAEpmg4WJhYQqw