Repository navigation
perf: per-hardware default for the B=1 MTP burst (M1 Ultra measurements) - #216
Merged
Merged
Conversation
be-free-snowboy
pushed a commit
to freestylejs/snowbrain-mlxcel
that referenced
this pull request
Oct 27, 2026
…ts) (lablup#216) * perf: per-hardware default for the B=1 MTP burst (M1 Ultra measurements) * docs: qualify the 26B-A4B default with the per-hardware policy
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.
Closes #165
Measurements (Apple M1 Ultra, 128 GB)
Block size 4, temperature 0, 160 decode tokens, streamed through the release server. Decode tok/s =
(N - 1) / (T_N - T_1): the MTP burst path emits tokens in lumps, so inter-token client timing is unusable there; a 1-token request (T_1) absorbs the prefill cost identically in both modes.31B + bf16 assistant (
gemma-4-31b-it-4bit+gemma-4-31B-it-assistant-bf16): consistent regression.12B Unified + 4-bit assistant: still profitable (~1.1 to 1.4x on prompts with stable prose; this local checkpoint produces degenerate output on some prompts, which were excluded).
The issue hypothesized memory bandwidth as the discriminator, but the M1 Ultra has datacenter-class bandwidth (~800 GB/s) and still regresses: the real discriminator is GPU compute generation. The drafter forward plus the K-wide verify forward do not pay for themselves on pre-M5 GPU cores.
Change: per-hardware default
mtp_b1_burst_enablednow takes the target's batching capability and defaults per hardware (pure decision coremtp_b1_default, unit-tested as a decision table):hardware::get_hardware().has_neural_acceleratorgeneration signal); pre-M5 falls back to classic decode.MLXCEL_ENABLE_MTP_B1remains an explicit override in BOTH directions (any non-0/false/no/offvalue forces on; those values force off).Live verification on this M1 Ultra with the new build, no env set: the 31B serves at classic speed (18.7 to 19.2 tok/s, decline log fires), the 12B Unified keeps MTP speed (45.5 / 38.1 tok/s).
Byte-identity note
Temperature-0 outputs on M1 Ultra are NOT always byte-identical between classic and MTP (several word-choice-level divergences). This is the evaluation-path fp jitter documented during #203: the MTP verify computes logits through a
[1, K]forward while classic uses[1, 1]steps, and near-tie argmaxes flip more readily on this GPU class (the same runs were byte-identical on M5 Max). Documented in the benchmark page; output quality is unaffected.Docs
docs/benchmark_results/gemma4-mtp-speculative-decoding.md: new M1 Ultra section (methodology, tables, default policy, jitter note), summary-table defaults updated.docs/environment-variables.md:MLXCEL_ENABLE_MTP_B1entry rewritten for the per-hardware default.Acceptance criteria
MLXCEL_ENABLE_MTP_B1remains an explicit override: yes, both directions, covered by the decision-table unit test.