Repository navigation
qwen35 cuda: MT2 attention for 2-16 rows through 131,071 cached tokens - #4149
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/qwen35-mt2-131k
branch
from
November 20, 2026 04:24
042c42e to
ab6e6c6
Compare
Owner
Author
|
Measured at this PR's exact head (ab6e6c6) on an RTX 5090 under WSL2 (Ubuntu 24.04), one executable with the MT2 tile switched off and on (
All four runs give the same 2,048 token ids in both arms (8,192 of 8,192 compared, no first difference). The off arm also turns off the one-row MT2 path main already has, so the gain over main is at most this; one-row steps are rare in drafted decoding at this length.
|
This was referenced Nov 20, 2026
The MT2 row tile took 2-16-row decode windows only below 65,536 cached tokens. It now takes them through 131,071; one-row decode keeps MT2 at every length from 8,192 as before, and windows of 17 or more rows never take it. On the RTX 5090, Qwen3.8-27B, a 129K-token drafted long-context run: 237.5 -> 250.8 tok/s (27.6 -> 26.6 ms a round, +5.6%), all 2,048 token ids equal to the same build without the change and to plain decoding. test-qwen35-shapes-host now also runs the MT2 envelope test, which no step ran before.
ashhart
force-pushed
the
lead/qwen35-mt2-131k
branch
from
November 20, 2026 15:44
ab6e6c6 to
daac147
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.
The MT2 row tile took 2-16-row decode windows only below 65,536 cached tokens. It now takes them through 131,071 cached tokens. One-row decode keeps MT2 at every length from 8,192, as before, and windows of 17 or more rows never take it.
Measured on an RTX 5090 with Qwen3.8-27B, drafted decoding over a 129K-token prompt, same executable with and without the change: 237.5 -> 250.8 tok/s (27.6 -> 26.6 ms a round, +5.6%). All 2,048 token ids are equal to the run without the change and to plain decoding. Short prose takes the same path as before.
Tests:
test-qwen35-shapes-hostnow also runs the MT2 envelope test, which no build step ran before: 21/21 pass. As a control, a version without the 16-row limit fails that test.