Repository navigation
perf(models): default MLXCEL_FUSED_XIELU on after M5 Max validation - #417
Merged
Merged
Conversation
Flip MLXCEL_FUSED_XIELU to default-on with `0`/`false`/`off`/`no` as the case-insensitive opt-out, mirroring the MLXCEL_FUSED_MOE default-on convention (#282). #409 (PR #414) shipped the fused single-launch Metal xIELU kernel for the Apertus MLP activation default-off, explicitly pending M5 Max validation; this completes that follow-up. M5 Max (Apple M5 Max, 128GB), Apertus-8B-Instruct-2509-4bit, mlxcel-bench-decode, 12 interleaved off/on rounds of 256-token greedy decode: off (elementwise): 112.0 tok/s on (fused): 114.2 tok/s delta: +1.9% mean (+2.05% median), 11/12 paired wins, paired t ~ 8.9 Greedy temp-0 decode is byte-identical between the two paths on M5 Max (end-to-end sha256 match over a full generation, plus the committed bit-for-bit unit test over the full activation domain). With the documented M1 Ultra result (+2.7%), the fused path is a byte-identical, positive-throughput, no-regression win on both validated Apple Silicon generations. Apertus-only; non-Metal back-ends keep the equivalent elementwise fallback. Set MLXCEL_FUSED_XIELU=0 to force the elementwise path. Adds fused_xielu_enabled_from() as a pure, unit-tested opt-out decision and updates docs/environment-variables.md.
be-free-snowboy
pushed a commit
to freestylejs/snowbrain-mlxcel
that referenced
this pull request
Oct 27, 2026
…ablup#417) Flip MLXCEL_FUSED_XIELU to default-on with `0`/`false`/`off`/`no` as the case-insensitive opt-out, mirroring the MLXCEL_FUSED_MOE default-on convention (lablup#282). lablup#409 (PR lablup#414) shipped the fused single-launch Metal xIELU kernel for the Apertus MLP activation default-off, explicitly pending M5 Max validation; this completes that follow-up. M5 Max (Apple M5 Max, 128GB), Apertus-8B-Instruct-2509-4bit, mlxcel-bench-decode, 12 interleaved off/on rounds of 256-token greedy decode: off (elementwise): 112.0 tok/s on (fused): 114.2 tok/s delta: +1.9% mean (+2.05% median), 11/12 paired wins, paired t ~ 8.9 Greedy temp-0 decode is byte-identical between the two paths on M5 Max (end-to-end sha256 match over a full generation, plus the committed bit-for-bit unit test over the full activation domain). With the documented M1 Ultra result (+2.7%), the fused path is a byte-identical, positive-throughput, no-regression win on both validated Apple Silicon generations. Apertus-only; non-Metal back-ends keep the equivalent elementwise fallback. Set MLXCEL_FUSED_XIELU=0 to force the elementwise path. Adds fused_xielu_enabled_from() as a pure, unit-tested opt-out decision and updates docs/environment-variables.md.
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.
Follow-up to #409 (implemented in PR #414): the M5 Max validation it explicitly deferred.
Summary
Flip
MLXCEL_FUSED_XIELUto default-on, with0/false/off/noas thecase-insensitive opt-out, mirroring the
MLXCEL_FUSED_MOEdefault-on convention(#282). #409 (PR #414) shipped the fused single-launch Metal xIELU kernel for the
Apertus MLP activation default-off, explicitly pending M5 Max validation. This PR
completes that follow-up.
M5 Max benchmark
Apple M5 Max (128GB),
apertus-8b-instruct-2509-4bit,mlxcel-bench-decode,12 interleaved off/on rounds (order alternated per round, paired to cancel thermal
drift) of 256-token greedy decode, under
caffeinate:Delta +2.14 tok/s (+1.9% mean, +2.05% median), 11/12 paired wins, paired
t ~ 8.9. No regression.
Behavioral check of the flip on the rebuilt binary (default vs explicit env):
default
112.3~ on(=1)112.9> off(=0)109.4, confirming that unsetroutes through the fused path and
=0opts out.Parity
Greedy temp-0 decode is byte-identical between the elementwise and fused paths on
M5 Max: an end-to-end full-generation
sha256matches, and the committedfused_xielu_matches_elementwise_bit_for_bittest passes over the full activationdomain. Every intermediate stays in bf16 and the kernel reproduces MLX's
expm1f.Cross-generation
Changes
src/models/apertus.rs:fused_xielu_enabled()is default-on via a new pure,unit-tested
fused_xielu_enabled_from()opt-out helper. Addsfused_xielu_gate_defaults_on_with_opt_out.docs/environment-variables.md: updated theMLXCEL_FUSED_XIELUrow (defaulton, opt-out semantics, M5 Max number).
Apertus-only; non-Metal back-ends keep the equivalent elementwise fallback.