Skip to content

perf: validate B=1 MTP default-on on lower-bandwidth Apple Silicon (M1/M2) #165

Closed

Description

@inureyes

Validate the B=1 MTP default-on decision (#159) on lower-bandwidth Apple Silicon (M1 / M2 / base M-series), and add a per-hardware safeguard if the default regresses there.

Background

#159 flipped MLXCEL_ENABLE_MTP_B1 to on by default for all MTP targets, based on Apple M5 Max measurements (~1.2-1.4x on the 31B, ~1.87x on the 12B Unified, byte-identical at temperature 0). The guard that previously declined B=1 MTP cited earlier "B=1 is slower than classic decode" measurements, which were likely taken on lower-bandwidth Apple Silicon.

B=1 speculative decoding pays off only when the target verify forward has spare bandwidth/compute to absorb the extra draft positions. On a lower-bandwidth chip (M1 / M2 / base M-series) the single target forward is closer to bandwidth-saturated, so B=1 MTP may be break-even or slower than classic decode, i.e. the new default could be a regression there. MLXCEL_ENABLE_MTP_B1=0 opts out, but the default should be correct per hardware.

Goal

Measure B=1 MTP (12B Unified + 4-bit assistant, and 31B + bf16 assistant) on M1 / M2-class hardware, classic vs B=1 MTP at temperature 0 (byte-identical expected). Then either:

  • confirm B=1 MTP is still beneficial there and keep the unconditional default-on, or
  • add a per-hardware / heuristic default (e.g. gate the default-on a memory-bandwidth or compute estimate, or a runtime micro-probe) so lower-bandwidth chips fall back to classic by default while M5 Max-class chips keep the speedup. Keep MLXCEL_ENABLE_MTP_B1 as the override either way.

Touchpoints

  • src/server/batch/speculative_burst.rs — mtp_b1_burst_enabled() (currently env-only default-on, M5 Max rationale in the doc comment).
  • src/server/batch/scheduler.rs — the singleton B=1 decline guard.
  • docs/benchmark_results/gemma4-mtp-speculative-decoding.md / docs/environment-variables.md — document per-hardware behavior.

Acceptance criteria

  • B=1 MTP measured on at least one M1/M2-class chip for the 12B Unified and 31B pairs (classic vs MTP tok/s, temperature-0 byte-identity).
  • If B=1 MTP is not beneficial there, the default adapts per hardware (no silent regression for lower-bandwidth chips); if it is beneficial, the unconditional default-on is confirmed and documented.
  • MLXCEL_ENABLE_MTP_B1 remains an explicit override.

Metadata

Metadata

Assignees

Labels

area:modelspriority:mediumstatus:donetype:performance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions