Repository navigation
perf(mimo): exact rectangular MTP verification by default - #1289
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 of 5 tasks
This comment has been minimized.
This comment has been minimized.
jonathan308
force-pushed
the
claude/mimo-decode-kernels-mtp
branch
from
October 1, 2026 00:31
3bbac81 to
c7021ac
Compare
jonathan308
force-pushed
the
claude/mimo-exact-rectangular-mtp
branch
from
October 1, 2026 00:31
262e064 to
9b93ddb
Compare
… MTP Pin mlx-swift-lm to the stack that enables the exact MiMo short-forward decode kernels by default and adds `CBv2MTPConfig.allowsAdaptiveSerialRounds`. - Forward the three kernel rollbacks (`DARKBLOOM_MIMO_FUSED_DECODE_NORMS`, `DARKBLOOM_MIMO_DECODE_EXPERTS`, `DARKBLOOM_MIMO_DECODE_ROUTER_GEMV`, `0`/`false`/`no`/`off`) to the launchd provider job, so an installed provider can restore the stock path. - Build every native MiMo MTP config through `nativeMiMoMTPConfig`, which keeps adaptive plans target-only under serial-target scoring. Each serial draft column costs one ordinary target forward, so those rounds could only slow decode (25-27 tok/s when the controller locked onto depth 3). MTP stays constructed and active with live assistant history; the rectangular opt-in keeps adaptive depth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin mlx-swift-lm to the exact rectangular verification stack (row-exact multi-row affine projection, fused norms inside the scalar-dense verifier, scalar-dense default with a guard against drafting through the bulk trunk). - `nativeMiMoVerificationMode` selects rectangular verification by default. A rollback of `DARKBLOOM_MIMO_RECTANGULAR_VERIFY` or of the SDK's scalar-dense switch selects serial-target scoring; the provider never selects the bulk rectangular trunk, whose reductions differ from serial decode. - The native paged profile keeps serial-target MTP independently of the contiguous default. - LaunchAgent forwards the three verification rollbacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
force-pushed
the
claude/mimo-exact-rectangular-mtp
branch
from
October 1, 2026 04:44
9b93ddb to
7257007
Compare
jonathan308
force-pushed
the
claude/mimo-decode-kernels-mtp
branch
from
October 1, 2026 04:44
c7021ac to
6f58cfa
Compare
This was referenced Oct 1, 2026
Merged
jonathan308
marked this pull request as ready for review
October 1, 2026 15:39
Contributor
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Reviewers: anthropic/claude-opus-5.5: incomplete (review unavailable); openai/gpt-6-astra: incomplete (review unavailable) Models: anthropic/claude-opus-5.5, openai/gpt-6-astra. Findings require human validation; this review never requests changes or blocks merging. |
#1282 and #1299 were squash-merged into master, so this PR's copy of #1282 conflicted. Conflicts resolved to #1289's versions of configuration.md, LaunchAgent.swift and its tests, and MiMoV26RectangularVerifyPolicyTests.swift (master changed each by exactly #1282's diff; the auto-merge had duplicated testNativeMTPConfigKeepsAdaptiveSerialPlansTargetOnly). CHANGELOG keeps master and adds this PR's section. The net diff against master is exactly #1289's reviewed change; the SDK pin stays at mlx-swift-lm main 1ee8675a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gajesh2007
approved these changes
Oct 1, 2026
This branch was successfully 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.
Summary
Make exact rectangular verification the default MTP strategy for native MiMo V2.6. With MTP on, greedy decode becomes faster than MTP off (+10% short, +9% at 4K on a 256 GiB M3 Ultra) while every output stays identical to target-only decode. This is the MTP-on speedup that serial verification could not deliver.
nativeMiMoVerificationModeselects rectangular verification by default. A rollback ofDARKBLOOM_MIMO_RECTANGULAR_VERIFYor of the SDK's scalar-dense switch (0/false/no/off) selects serial-target scoring. The provider never selects the bulk rectangular trunk, which is not output-identical.DARKBLOOM_MIMO_RECTANGULAR_VERIFY,DARKBLOOM_MIMO_RECTANGULAR_SCALAR_DENSE,DARKBLOOM_MIMO_ROW_EXACT_PROJECTION).Stacked on #1282. Media requests stay target-only; sampled requests were never MTP-eligible on MiMo and are unaffected.
Evidence
M3 Ultra (60-core GPU), 256 GiB,
EigenLabs/MiMo-V2.6-Flash-MOPD-MLX-4bit-mtp@bb37ffc7, Release build of this branch on master08653fc2(darkbloomSHA256b36596a9…, metallib38ceb8a1…), prefix cache ready. Each row is a fresh server process. Temperature 0, cold prompts. Exactness compares against the same binary with MTP off (target-only), byte for byte (content and reasoning SHA-256).Since these measurements, the stack was rebased onto master
1e4b2d88. #1286 does not touchprovider-swift, and the same stack built there produced the samedarkbloomSHA256 (b36596a9…). The SDK commits were then reformatted for the lint job: swift-format line wrapping only, token-identical apart from a trailing comma in one test's array literal.The stack was then rebased onto master
b1c14ed8(#1285, #1287, #1288, #891). The SDK PRs are now merged, and this PR pins mlx-swift-lmmain1ee8675a, which contains #206, #207 and #219 (landed through Layr-Labs/mlx-swift-lm#246) and #245. Its tree is identical to the SDK validated here. The full MiMo stack builds on that base (this stack plus #1299). Full-model requalification on it is in progress.DARKBLOOM_MIMO_RECTANGULAR_VERIFY=0)adaptive_serial_suppressed13,794; output identical on every check aboveLong context (process 2): 20K 41.78 / 40.29 / 40.52 and 50K 34.44 / 34.33 / 33.97 tok/s. MTP off on the same research stack measured 39.92 / 39.91 at 20K and 34.22 / 34.18 at 50K. The adaptive policy keeps rectangular MTP at or above target-only as the serialized attention grows.
Prefix cache (#1280 default) with exact rectangular MTP: a repeated 6K-token prompt reports 4,096 cached tokens, and its output is identical across repeats and to MTP off.
Why bulk rectangular was never shipped: on this hardware it measured 52–56 tok/s, but greedy output diverged on 10/10 prompts. MLX's
qmv_wide(2–7 rows) reduces differently from one-rowqmv_fast. The row-exact kernel keepsqmv_fastarithmetic per row and reads each weight once. The per-row fallback (one matmul per row) was exact too, but it measured 42.8–45.0 short, which is no faster than MTP off.Requalified on master
b1c14ed8(includes #1285, which pins SDK #208)Full stack: #1282 + #1289 + #1299, with SDK #206/#207/#219/#245 rebased onto SDK
maine31a1732. Fresh server per run, on the same M3 Ultra. The reference is clean masterb1c14ed8with MTP auto.Note on the concurrent row: master's own two builds differ on the same prompt, and each run produced one stable output over three concurrent repeats. This is batch composition, not a regression.
b1c14ed8, MTP autoMTP auto on the full stack: 7,659 rounds, 13,660 tokens proposed, 73.8% accepted.
Rollback
DARKBLOOM_MIMO_RECTANGULAR_VERIFY=0restores serial-target scoring. Under serial, adaptive plans stay target-only (#1282), so MTP-on decode matches the serial row above.DARKBLOOM_MIMO_ROW_EXACT_PROJECTION=0keeps exact verification with one matmul per row. All three rollbacks are forwarded to the launchd job.Test plan
swift build -c release --product darkbloom --force-resolved-versions, source-matched metallib,swift build --build-tests, metallib staged in every test bundle.MiMoV26RectangularVerifyPolicyTests(4): exact rectangular default, affirmative values, either rollback → serial, MTP off → serial.LaunchAgentEnvironmentTests|LaunchAgentServicePlistTests|LaunchAgentRestartTests|WatchdogAgentPlistTests|excludesInferenceControls(32), including the newforwardsMiMoExactVerifyRollbacksToProviderJob.MTPConfigTests(20).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.