Repository navigation
perf: run B=1 MTP by default for all targets (incl. batch-capable 31B) - #159
Merged
Merged
Conversation
The singleton (B=1) MTP burst was declined by default for batch-capable targets (e.g. Gemma 4 31B) behind MLXCEL_ENABLE_MTP_B1, from an earlier "B=1 is slower" calibration. Apple Silicon (M5 Max) measurement shows B=1 MTP is profitable there with byte-identical output at temperature 0: ~1.2-1.4x on the 31B + bf16 assistant and ~1.87x on the 12B Unified pair. Flip mtp_b1_burst_enabled() to default-on (opt out with MLXCEL_ENABLE_MTP_B1=0) and drop the supports_batching() gate from the scheduler decline, so B=1 MTP runs by default for every MTP target. The batched B>1 path stays off by default (unchanged greedy-parity gap). Add a Gemma 4 MTP speculative-decoding report (12B Unified, 31B, and the external H100/vLLM reference numbers) and update the env-var docs.
be-free-snowboy
pushed a commit
to freestylejs/snowbrain-mlxcel
that referenced
this pull request
Oct 27, 2026
lablup#159) The singleton (B=1) MTP burst was declined by default for batch-capable targets (e.g. Gemma 4 31B) behind MLXCEL_ENABLE_MTP_B1, from an earlier "B=1 is slower" calibration. Apple Silicon (M5 Max) measurement shows B=1 MTP is profitable there with byte-identical output at temperature 0: ~1.2-1.4x on the 31B + bf16 assistant and ~1.87x on the 12B Unified pair. Flip mtp_b1_burst_enabled() to default-on (opt out with MLXCEL_ENABLE_MTP_B1=0) and drop the supports_batching() gate from the scheduler decline, so B=1 MTP runs by default for every MTP target. The batched B>1 path stays off by default (unchanged greedy-parity gap). Add a Gemma 4 MTP speculative-decoding report (12B Unified, 31B, and the external H100/vLLM reference numbers) and update the env-var docs.
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
Run the singleton (B=1) MTP speculative-decoding burst by default for every MTP target, including batch-capable ones such as Gemma 4 31B. Previously B=1 MTP was declined by default for batch-capable targets and gated behind
MLXCEL_ENABLE_MTP_B1, based on an earlier "B=1 is slower" calibration.Why
Apple Silicon (M5 Max) measurement shows B=1 MTP is profitable, with byte-identical output at
temperature 0:gemma4)gemma-4-31B-it-assistant-bf16gemma4_unified)gemma-4-12B-it-assistant-4bitThe gain is smaller than the ~3x reported on an idle H100 (Apple Silicon decode is bandwidth-bound), but it is consistently above 1.0x.
Change
mtp_b1_burst_enabled()now defaults to on;MLXCEL_ENABLE_MTP_B1=0(orfalse/no/off) opts out, for lower-bandwidth Apple Silicon where the B=1 verify forward may not pay for itself.supports_batching()gate from the scheduler decline, so the decline fires only when B=1 MTP is explicitly disabled.Verification (real models, M5 Max)
MLXCEL_ENABLE_MTP_B1=0: declines to classic → 26.6 tok/s; 1.38x, output byte-identical.cargo fmt/clippy --lib/checkclean; release build links.Docs
docs/benchmark_results/gemma4-mtp-speculative-decoding.md(12B Unified, 31B, and external H100/vLLM reference numbers, with the hardware analysis).docs/environment-variables.md(MLXCEL_ENABLE_MTP_B1is now default-on / opt-out) anddocs/benchmarks.md.