Repository navigation
update: extend exact token-only verify to remaining MLA and dense families - #3424
Merged
Merged
Conversation
…ilies A token-only verify block (prompt lookup, a full-model drafter) still parted from single-token decode on DeepSeek V3.2, DeepSeek V2, Llama 3 (K2 Horizon), Arcee and OLMoE. Under the existing opt-in MLXCEL_MLA_ROW_INVARIANT=1 these now enter the row-invariant scope: dense projections take the row-invariant product, a verify block attends one row at a time as its decode steps do (V3.2 with each row's own indexer top-k), float experts and OLMoE's MoE run per position, and the Llama-class fused rope and compiled MLP launchers give way to the composed graph inside the scope. With the variable unset no forward enters a scope. Kimi Linear, Kimi K3 and LongCat stay out: the token-only round refuses them, so no block forms; tests pin the refusal. A per-row MLA verify block now records one path-stat entry per layer instead of one per row. Validated with tiny-model block-versus-chain tests per family (widths 2, 4, 8, 12), the survey on seven local checkpoints (Arcee and K2 Horizon equal on bf16, V2 and OLMoE equal with MLXCEL_QMV_WIDE=0), and decode ABAB against main with no regression. Closes #3421
Bilingual report for the exact token-only verify scope on the remaining MLA and dense families.
6 tasks done
…-dense-verify-scope # Conflicts: # docs/environment-variables.md
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
Extends the opt-in exact token-only verify scope (
MLXCEL_MLA_ROW_INVARIANT=1, #3420) to the families #3418 left open. With the variable unset no forward enters a row-invariant scope, so the default path is unchanged (decode ABAB below).[latent | indexer key]window with its own indexer top-k; projections (indexer included), gate and LM head row-invariant; float experts per position.Llama3Model(K2 Horizon) and Arcee: the fused QKV split goes throughrow_invariant::linear_whole_block(the layer's own forward outside a scope); inside one the fused rope and compiled MLP launchers give way to the composed graph, and a block attends one row at a time.mla::stats::as_one_call).Open points: Kimi Linear, Kimi K3 and LongCat are out. The token-only round refuses them (model-owned KDA or n-gram state without a verify rewind), so no block forms and the KDA layers never see one; the survey reports "not run" on every cell and a test per family pins the refusal. DeepSeek V2 is in: it takes the round and carries the same split.
Measurements (M3 Ultra)
Survey, engine path, widths 2/4/8 at 8/600/2100 tokens: off, every cell differs on both kernels (first difference layer 0 output). On: afm-4.5b and k2-horizon-0.9b equal on bf16 (9/9); deepseek-v2-lite and olmoe equal with
MLXCEL_QMV_WIDE=0(9/9). Decode ABAB against main, variable unset, same tokens: K2 Horizon 211.50 vs 211.80, OLMoE 410.21 (421.24 without a cold first run) vs 421.21, V2-Lite 173.28 vs 174.58 tok/s. Details indocs/benchmark_results/speculative-exactness-followup-m3ultra-2026-11-25.mdsection 3.Not done:
deepseek-v3.2-4bitnot loaded (tiny-model test only); the diagnostic names the first layer, not the op inside it; prompt-lookup throughput with the variable on was not measured for these families.Test plan
deepseek_v3_verify_block_tests.rsplus V3.2 and V2 equivalentsmodels::llama3 models::arcee models::olmoe models::deepseek_v2 models::deepseek_v32 models::deepseek_v3 models::kimi_linear models::longcat coverage_tests, coremla::stats row_invariant qkvCloses #3421