Skip to content

docs(benchmarks): MoE decode gap investigation (#268) - #273

Merged
inureyes merged 1 commit into
mainfrom
perf/issue-268-moe-astype-dtype
Jun 13, 2026
Merged

inureyes merged 1 commit into
mainfrom
perf/issue-268-moe-astype-dtype

Conversation

@inureyes

@inureyes inureyes commented Jun 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Documents the root-cause investigation behind the mlxcel vs mlx-lm decode-speed work this round, as a durable report under docs/benchmark_results/ (linked from docs/benchmarks.md). It consolidates the perf sweep and the GPU-profiling analysis so a future fused-kernel effort can build on it.

What's in the report

Scope

Documentation only. Issues #268 and #269 stay open; the actual perf fix is scoped by section 5 of the report. References #266/#267 (merged).

Consolidates the perf sweep and root-cause analysis for the mlxcel vs mlx-lm decode gap across the SSM hybrid (#266/#267, fixed), MoE (#268), and dense (#269) families measured on M1 Ultra.

GPU profiling (mlxcel-gpu-profiling hooks) localizes the MoE gap: decode is ~95% GPU-bound (not FFI/dispatch), not at the memory wall (~16-20% bandwidth, GPU idle on small kernels), and mlxcel emits 773 AsType ops/token versus mlx-lm's 0. Tracing every candidate source (quantized wrappers, multiply_scalar, the bf16->f16 scale conversion, compiled activations, fallback norms) shows the dtypes are consistently f16 and the AsType are diffuse MLX-internal promotions that fuse at eval, the same class as the prior Gemma3n bf16 decode-gap investigation where removal measured only ~2.6%.

Documents the ruled-out sources and the realistic fix paths (a fused decode-MoE kernel or an AsType reduction campaign) with a validation harness. Documentation only; the perf fix itself stays open under #268.
@inureyes
inureyes force-pushed the perf/issue-268-moe-astype-dtype branch from d23b2c6 to 8fa3233 Compare June 13, 2026 16:58
@inureyes inureyes added area:models Model architectures, weights, loading, metadata type:docs Documentation improvements or additions labels Jun 13, 2026
@inureyes
inureyes merged commit 1d28278 into main Jun 13, 2026
4 checks passed
@inureyes
inureyes deleted the perf/issue-268-moe-astype-dtype branch June 13, 2026 17:09
@inureyes inureyes added this to the 0.3 milestone Jun 21, 2026
@inureyes inureyes self-assigned this Aug 31, 2026
@inureyes inureyes added the status:done Completed label Sep 6, 2026
be-free-snowboy pushed a commit to freestylejs/snowbrain-mlxcel that referenced this pull request Oct 27, 2026
Consolidates the perf sweep and root-cause analysis for the mlxcel vs mlx-lm decode gap across the SSM hybrid (lablup#266/lablup#267, fixed), MoE (lablup#268), and dense (lablup#269) families measured on M1 Ultra.

GPU profiling (mlxcel-gpu-profiling hooks) localizes the MoE gap: decode is ~95% GPU-bound (not FFI/dispatch), not at the memory wall (~16-20% bandwidth, GPU idle on small kernels), and mlxcel emits 773 AsType ops/token versus mlx-lm's 0. Tracing every candidate source (quantized wrappers, multiply_scalar, the bf16->f16 scale conversion, compiled activations, fallback norms) shows the dtypes are consistently f16 and the AsType are diffuse MLX-internal promotions that fuse at eval, the same class as the prior Gemma3n bf16 decode-gap investigation where removal measured only ~2.6%.

Documents the ruled-out sources and the realistic fix paths (a fused decode-MoE kernel or an AsType reduction campaign) with a validation harness. Documentation only; the perf fix itself stays open under lablup#268.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:models Model architectures, weights, loading, metadata status:done Completed type:docs Documentation improvements or additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant