Repository navigation
docs(benchmarks): MoE decode gap investigation (#268) - #273
Merged
Merged
Conversation
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
force-pushed
the
perf/issue-268-moe-astype-dtype
branch
from
June 13, 2026 16:58
d23b2c6 to
8fa3233
Compare
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.
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
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 fromdocs/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).