Repository navigation
metal: port Muse Glimmer NAX quantized GEMM/QMV kernels - #79
Open
GumbiiDigital wants to merge 3 commits into
Open
GumbiiDigital wants to merge 3 commits into
GumbiiDigital wants to merge 3 commits into
Conversation
Advance Source/Cmlx/mlx from 72dffa2d to ce27c709 (head of Layr-Labs/mlx#73) and regenerate the matching mlx-generated Metal headers and JIT sources for quantized_nax and fp_quantized_nax: - quantized_nax: add qmm_t_nax_staged_ksplit_impl (splits BK=64 across all 4 simdgroups when M <= SM in qmm_t_nax_staged_impl for 16-bit affine transposed GEMM and split-K on M5+ NAX). - fp_quantized_nax: add double-buffered Ws NVFP4 NAX GEMM loader and M <= 8 peeled-prefetch QMV with LUT-backed dequantize_fp4_x4_scaled, hardened with threadgroup-uniform K/alignment/sizeof(T) guards. Intentionally excluded from mlxfast-muse-glimmer-30b-engine (4a28444e): - steel_gemm_fused_nax.{h,cpp} and steel_gemm_splitk_nax.{h,cpp} early-return hunks (divergent threadgroup barrier UB before mlx::steel::gemm_loop). - gather_front.cpp (dead contest-only cbv2_array_backing helper; mlx-swift-lm#580 uses public mlx_array_get_buffer_info / mlx_array_data_uint8). Add Tests/MLXTests/NAXQuantizedKernelTests.swift covering small-M affine quantizedMM, NVFP4 quantizedMM/QMV, unaligned/sliced fallback, and NVFP4 globalScale parity, and document the pin + test in fork.yaml. Stacked on Layr-Labs/mlx#73; companion to Layr-Labs/mlx-swift-lm#580.
Address adversarial review findings (H1, M1, M2, L1, L4): - Advance Source/Cmlx/mlx from ce27c709 to 979ad5da (head of Layr-Labs/mlx#73), regenerate mlx-generated/{quantized_nax,fp_quantized_nax}.{h,cpp}, and sync Source/Cmlx/include-framework/mlx-utils.h (adds env::nax_ksplit()). - Gate qmm_t_nax_staged_ksplit_impl via Metal function constant 203 (use_ksplit), controlled by MLX_NAX_KSPLIT (default 1) and automatically disabled when MLX_QMV_BATCH_INVARIANT=1 is set. - Rewrite Tests/MLXTests/NAXQuantizedKernelTests.swift so every shape routes to its target M5 NAX kernel path: - Affine K-split split-K (N=K=2048, M=8..16, biases present) and direct staged qmm_nax (N=K=4160 = 65*64, M=13..16), plus bitwise M=13/16 vs M=17 parity when MLX_NAX_KSPLIT=0 or MLX_QMV_BATCH_INVARIANT=1. - Unbatched (M=512, N=1024) and batched (B=2, M=64, aligned N=128 and unaligned N=96) double-buffered NVFP4 fp_qmm_t_nax. - Peeled fp_qmv_nax (K=N=2048, 6 <= M <= 8 and M=9). - NVFP4 MoE gather (fp_gather_qmm_t_nax and fp_gather_qmm_rhs_nax). - Genuinely misaligned 4B weight / 1B scale offset fallback with bitwise sameBytes parity against the aligned fast paths. - NVFP4 globalScale GEMM route (M=512, N=1024, K=128). - Update fork.yaml with the 979ad5da pin, accurate NVFP4 blast radius (including MoE gather paths), and updated test coverage description.
GumbiiDigital
marked this pull request as ready for review
December 4, 2026 14:40
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
jonathan308
reviewed
Dec 4, 2026
jonathan308
left a comment
There was a problem hiding this comment.
The vendored headers and JIT sources match mlx#73 exactly (only include paths differ), so this is a real pin. My concerns are sequencing:
- This pins
979ad5da, which exists only on the unmerged mlx#73 branch. mlx#73 hasn't run CI yet (no runner picked up its jobs), and a rebase there will orphan this SHA. Please land #73 first (withMLX_NAX_KSPLITdefaulting to 0, see my comment there), then re-pin to the merged commit on mlxmain. - Until that's done, this inherits #73's default-on K-split. That changes M5 output bits for affine bf16/fp16 at 8–16 rows.
Once it's re-pinned to merged mlx with K-split off by default, I'm happy to approve. CI here is green.
Advance Source/Cmlx/mlx from 979ad5da to 4ef15bc7d43527e2018596a23445aa4f0c698662 (merged Layr-Labs/mlx#73 on Layr-Labs/mlx main, including 500c5d7e's opt-in MLX_NAX_KSPLIT=0 default, allow_ksplit plumbing for #71 coordination, and the main empty-CPU-reduction fix from #54): - Sync Source/Cmlx/include-framework/mlx-utils.h so env::nax_ksplit() matches mlx/utils.h (default 0, != 0). - Update Tests/MLXTests/NAXQuantizedKernelTests.swift so unset MLX_NAX_KSPLIT asserts bitwise parity (default disabled), while explicit MLX_NAX_KSPLIT=1 exercises K-split unless MLX_QMV_BATCH_INVARIANT=1 is set. - Verified Source/Cmlx/mlx-generated/ matches 4ef15bc7 (zero Metal kernel header diff vs 979ad5da; check-generated-metal-sources.py passes). - Update fork.yaml with the 4ef15bc7 pin and opt-in default.
This branch has not been deployed
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.
Branch
muse-glimmer/challenge-kernels@7581e61e(3 commits onmain@25c482f4). Pinned to merged Layr-Labs/mlx#73 (merge commit4ef15bc7d4onLayr-Labs/mlxmain, including500c5d7e's opt-inMLX_NAX_KSPLIT=0default,allow_ksplitplumbing for#71, andmain's empty-CPU-reduction fix from#54). Companion to Layr-Labs/mlx-swift-lm#580 (ports the production-safe Metal NAX kernel subset from the 9Vendor/mlx-swift/files inLayr-Labs/mlxfast-muse-glimmer-30b-enginecommits772ed549..4a28444e/5b816f3aexcluded from#580). None ofjonathan308's branches or PRs are touched.Summary
Advances
Source/Cmlx/mlxfrom72dffa2dto4ef15bc7d4(merged Layr-Labs/mlx#73 onLayr-Labs/mlxmain), regenerates the matching Metal JIT sources and copied headers underSource/Cmlx/mlx-generated/, syncsSource/Cmlx/include-framework/mlx-utils.h(env::nax_ksplit(), opt-in default0), adds M5-routed Swift quantized/MoE/misaligned-fallback parity tests, and updatesfork.yaml.Source/Cmlx/mlx-cstays at2ac897e3;.gitmodulesis unchanged.Ported vs. omitted / dropped audit (all 9 challenge
Vendor/mlx-swift/files)mlxfast-muse-glimmer-30b-engine4a28444e)mlx-generated/metal/quantized_nax.hLayr-Labs/mlx#73+ regenerated)qmm_t_nax_staged_ksplit_impl: whenM <= SM(M <= 16; reachable for8 <= M <= 16viaqmm_splitk_naxand12/13 <= M <= 16via directqmm_nax), splitsBK=64into four 16-col slices across all 4 simdgroups, reducing FP32 partials inWs(12,288 <= 18,432bytes) with uniform barrier participation. Gated by Metal function constantuse_ksplit(index203) via opt-inMLX_NAX_KSPLIT(default0), plumbed withallow_ksplitfor#71coordination, and disabled automatically underMLX_QMV_BATCH_INVARIANT=1.mlx-generated/quantized_nax.cppquantized_nax.h.mlx-generated/metal/fp_quantized_nax.hLayr-Labs/mlx#73+ regenerated)FPQuantizedNAXBlockLoader::fetch_nvfp4/store_nvfp4, double-bufferedWs(kDoubleBuf, 18 KiB) infp_qmm_t_impl/fp_qmm_t_nax, and bit-manipulationdequantize_fp4_x4_scaled+M <= 8(6 <= M <= 8host-routed) peeled 1-ahead prefetch infp_qmv_nax. Hardened with threadgroup-uniform(K > 0) && ((K & 31) == 0)and 16-bytewl/ 2-bytescalesalignment guards, plusif (kn < K)around the final peeled prefetch shift.sizeof(T) == 2/sizeof(Wtype) == 2checks the 16-bit threadgroup tile storage width (Wtype = bfloatacross transposed/gather kernels for all activation dtypes; activationTinfp_qmm_n_impl).mlx-generated/fp_quantized_nax.cppfp_quantized_nax.h.mlx-generated/metal/steel_gemm_fused_nax.hreturnonsgp_sm <= 0 || sgp_sn <= 0beforemlx::steel::gemm_loop(...)(steel/gemm/gemm_nax.h:54), which executesthreadgroup_barrier(mem_flags::mem_none)everykk0iteration — divergent threadgroup barrier UB (same class of NAX inactive-simdgroup hang already reverted inLayr-Labs/mlxfork.yaml).gemm_loopalready skips inactive simdgroups safely after the barrier.mlx-generated/steel_gemm_fused_nax.cppsteel_gemm_fused_nax.h.mlx-generated/metal/steel_gemm_splitk_nax.hreturnbeforemlx::steel::gemm_loop(...)UB assteel_gemm_fused_nax.h.mlx-generated/steel_gemm_splitk_nax.cppsteel_gemm_splitk_nax.h.mlx/mlx/backend/metal/kernels/gather_front.cpp(cbv2_array_backing)CBv2ParameterResidency.swift) uses publicmlx_array_get_buffer_info+mlx_array_data_uint8with zero references tocbv2_array_backing.Additional files in this PR
Source/Cmlx/mlx— submodule pin72dffa2d->4ef15bc7d4(merged Metal NAX: port Muse Glimmer small-M K-split affine GEMM and double-buffered NVFP4 GEMM/QMV mlx#73 onLayr-Labs/mlxmain; includes500c5d7e's opt-inMLX_NAX_KSPLIT=0default andallow_ksplitparameter, plusmain's empty-CPU-reduction guard from#54).Source/Cmlx/include-framework/mlx-utils.h— addsenv::nax_ksplit()defaulting to0(!= 0), matchingmlx/utils.h.Tests/MLXTests/NAXQuantizedKernelTests.swift— 4 XCTests whose shapes matchQuantizedMatmul::eval_gpuM5 NAX routing:N=K=2048, biases present,M in {8, 12, 16, 17}) and direct stagedqmm_nax(N=K=4160 = 65*64,M in {13, 16, 17}), asserting bitwisesameBytesparity (M=13/16vsM=17) whenever K-split is disabled (defaultMLX_NAX_KSPLIT=0orMLX_QMV_BATCH_INVARIANT=1), and verifying opt-inMLX_NAX_KSPLIT=1.M=512, N=1024, K=256) and batched (B=2, M=64, N in {128, 96}, K=128) double-buffered NVFP4fp_qmm_t_nax, plus genuinely misaligned 4-bytew/ 1-bytescalesoffset fallback asserting bitwisesameBytesparity against the aligned fast path.fp_qmv_nax(K=N=2048, M in {6, 7, 8, 9}) and NVFP4 MoE gather (fp_gather_qmm_t_naxforsortedIndices: false,fp_gather_qmm_rhs_naxforsortedIndices: true) with 4B/1B misaligned bitwisesameBytesparity.QuantizedLinear(..., globalScale:)GEMM route (M=512, N=1024, K=128->fp_qmm_t_nax_..._hgs,kDoubleBuf=false).fork.yaml— documents themlxpin advance (72dffa2d->4ef15bc7),mlx-utils.h(env::nax_ksplit()default0), full NVFP4 blast radius, andNAXQuantizedKernelTests.Placeholders / pending rollout items
allow_ksplit = (ref_rows <= 0)inqmm_splitk->qmm->qmm_naxonce [Metal] Prefill-row invariance scope: prompt chunks round like the reference rows (opt-in, per thread) mlx#71 / GPU.withPrefillRowInvariance(rows:_:): prompt chunks round like the reference rows (opt-in) #78 land so opt-inMLX_NAX_KSPLIT=1is also suppressed insideGPU.withPrefillRowInvariance(theallow_ksplitparameter is already plumbed in4ef15bc7d4).Blast Radius / What This Could Affect
Shared seams touched
Source/Cmlx/mlx(quantized_nax.h,quantized.cpp,mlx/utils.h) +mlx-generated/quantized_nax.{h,cpp}+include-framework/mlx-utils.hqmm_t_nax_staged_ksplit_implsplitsBK=64across 4 simdgroups whenM <= 16(reachable for8 <= M <= 16viaqmm_splitk_naxand12/13 <= M <= 16viaqmm_nax). Opt-in only (off by default); when enabled (MLX_NAX_KSPLIT=1), changes FP32 K-reduction summation order (~1 ULP / possible KV-hash delta vs. stock staged andM >= 17).MLX_NAX_KSPLIT=1: 16-bit (bf16/fp16) affine-quantized models running8 <= M <= 16on M5+ NAX (batched decode, spec-verify, MTP): Muse Glimmer, Qwen, GLM5-Next, Nemotron, Gemma 4, Inkling 2, MiMo. Zero behavior change under defaultMLX_NAX_KSPLIT=0.metal::is_nax_available()+use_ksplitFC 203 (allow_ksplit && env::nax_ksplit() && !env::qmv_batch_invariant(); defaults tofalse).Source/Cmlx/mlx(fp_quantized_nax.h) +mlx-generated/fp_quantized_nax.{h,cpp}uint4/uchar2loads, bit-manipulationhalf2E2M1 dequantization, and 18 KiB double-bufferedWsinfp_qmm_t_nax(kDoubleBuf = truefor non-hgsNVFP4). 0-ULP bit-identical output (confirmed on M5 Maxapplegpu_g17s).float,fp16,bf16):fp_qmm_t_nax(double-buffered),fp_gather_qmm_t_nax(MoE gather, single-buffered fast path),fp_gather_qmm_rhs_nax(nt/nnsorted MoE hot path, viaload_unsafe()), andfp_qmm_n_nax(16-bitTwhen instantiated; not host-routed today).metal::is_nax_available(),bits == 4 && group_size == 16 && !has_global_scale,K > 0 && (K & 31) == 0, 16Bwl& 2Bscalesalignment.Source/Cmlx/mlx(fp_quantized_nax.h:fp_qmv_nax+dequantize_fp4_x4_scaled) +mlx-generated/fp_quantized_nax.{h,cpp}half2dequantization + 1-ahead peeled prefetch forM <= 8(6 <= M <= 8host-routed viaqmv_mma). 0-ULP bit-identical output.6 <= M <= 8(N >= 2048) on M5+ NAX (Muse Glimmer 30B NVFP4 and other NVFP4 models).metal::is_nax_available(),bits == 4 && group_size == 16,6 <= M <= 8;MLX_QMV_BATCH_INVARIANT=1bypassesqmv_mma.Source/Cmlx/mlx(mlx/backend/cpu/reduce.cpp)initon empty CPU reductions (fromLayr-Labs/mlx#54onmain).x.size() == 0guard.Non-interference
MLX_NAX_KSPLITdefaults to0(opt-in).metal::is_nax_available() == false).bits == 4 && group_size == 16excludesgroup_size == 32).has_global_scaleNVFP4 (kDoubleBuf = false),M > 16affine NAX GEMM, andmlx-c(2ac897e3) are unaffected.Rollback / fail-closed profile
MLX_NAX_KSPLIT=0) and also suppressed wheneverMLX_QMV_BATCH_INVARIANT=1is set.Source/Cmlx/mlxto72dffa2dand the priormlx-generated/files.Before and After
flowchart LR subgraph Before["Before (main @ 25c482f4 / mlx @ 72dffa2d)"] B1["NAX affine qmm_t_nax_staged_impl (8 <= M <= 16)"] --> B2["Only sgid 0 computes; 3 of 4 simdgroups idle"] B3["NAX NVFP4 fp_qmm_t_nax / gather / fp_qmv_nax"] --> B4["Single-buffered Ws; scalar load_unsafe; non-peeled QMV"] end subgraph After["After (7581e61e / mlx @ 4ef15bc7d4)"] A1["NAX affine qmm_t_nax_staged_impl (8 <= M <= 16)"] --> A2{"use_ksplit FC 203<br/>(allow_ksplit && MLX_NAX_KSPLIT=1 && !MLX_QMV_BATCH_INVARIANT)"} A2 -->|opt-in true| A3["qmm_t_nax_staged_ksplit_impl: 4 simdgroups split BK=64 + Ws FP32 reduction"] A2 -->|default false| B2 A4["NAX NVFP4 GEMM / MoE gather / QMV"] --> A5["Aligned fast_nvfp4 (double-buffered Ws in fp_qmm_t_nax, bit-manip dequant in gather/QMV) + scalar fallback"] endBefore any rollout
72dffa2d(including attributing theM=32latency cliff) and benchmark end-to-end real-checkpoint Muse Glimmer 30B prefill + decode throughput and KV-hash / greedy-token parity on M5 Max with Muse Glimmer 30B: port production-safe challenge inference optimizations (4a28444e) mlx-swift-lm#580.allow_ksplit = (ref_rows <= 0)when [Metal] Prefill-row invariance scope: prompt chunks round like the reference rows (opt-in, per thread) mlx#71 / GPU.withPrefillRowInvariance(rows:_:): prompt chunks round like the reference rows (opt-in) #78 merge before enablingMLX_NAX_KSPLIT=1in production.Validation
1. Apple M4 Max (
m4-max-1, macOS 27.2.1, Swift 6.4.2, Metal 410) on current head7581e61e(mlx @ 4ef15bc7d4)python3 scripts/test-check-generated-metal-sources.pypython3 scripts/check-generated-metal-sources.py(--allalso checked)03b61445...);--all: 112 copied, 53 JIT PASSfork.yamlgateuv run --with pyyaml python3 scripts/check_forkdiff.pyxcrun swift-format lint --strict --configuration .swift-format Tests/MLXTests/NAXQuantizedKernelTests.swiftmlx.metallibbuild/installswift build --build-tests+scripts/build-metallib.shNAXQuantizedKernelTests(default,MLX_NAX_KSPLITunset ->0)env -u MLX_NAX_KSPLIT -u MLX_QMV_BATCH_INVARIANT swift test --skip-build --filter NAXQuantizedKernelTestsM=13/16vsM=17verified)NAXQuantizedKernelTests(MLX_NAX_KSPLIT=1)MLX_NAX_KSPLIT=1 swift test --skip-build --filter NAXQuantizedKernelTestsNAXQuantizedKernelTests(MLX_QMV_BATCH_INVARIANT=1)MLX_QMV_BATCH_INVARIANT=1 swift test --skip-build --filter NAXQuantizedKernelTestsNAXQuantizedKernelTests(MLX_NAX_KSPLIT=1 MLX_QMV_BATCH_INVARIANT=1)MLX_NAX_KSPLIT=1 MLX_QMV_BATCH_INVARIANT=1 swift test --skip-build --filter NAXQuantizedKernelTests(fp8_e4m3, fp4_e2m1)pairs (bf16+fp16)2. Apple M5 Max (
applegpu_g17s,arch_gen=17, 40 GPU cores,metal::is_nax_available() == true, macOS 27.2.1, Swift 6.4.2, Metal 4) — verified on identical Metal kernel sources (979ad5da/ceea81fd; zero.hkernel diff to4ef15bc7d4)mlx.metallibinstallswift build --build-tests+scripts/build-metallib.sh install mlx.metallib(215 MiB, 1,176 NAX symbols)NAXQuantizedKernelTests(MLX_NAX_KSPLIT=1)MLX_NAX_KSPLIT=1 swift test --skip-build --filter NAXQuantizedKernelTestsNAXQuantizedKernelTests(MLX_NAX_KSPLIT=0)MLX_NAX_KSPLIT=0 swift test --skip-build --filter NAXQuantizedKernelTestsM=13/16vsM=17verified)NAXQuantizedKernelTests(MLX_QMV_BATCH_INVARIANT=1)MLX_QMV_BATCH_INVARIANT=1 swift test --skip-build --filter NAXQuantizedKernelTests--filter QuantizedregressionQuantizationTests(8/8),QuantizedBiasAccumulatorTests(3/3),QuantizedConstantCastTests(2/2),SortedGatherQuantizedTailTests(4/4),QuantizedLayerTests(MLX_ENABLE_TF32=0: 17/17),generated: QuantizationLayr-Labs/mlx#73#73+#79+#579+#580stack (mlx-swift-lm)TF32=0, 26) +KSPLIT=0(18) +BATCH_INVARIANT=1(18)--no-parallel)Pre-existing upstream M5 TF32 note (not from
#73/#79): On M5 (arch_gen >= 17), upstream MLX defaultsMLX_ENABLE_TF32=1(mlx/utils.h:269), routing float32 matrix products through NAX TF32 (~1e-3rounding). An independent control build on clean basemlx-swift c633d22/mlx 72dffa2dreproduced the identical 6/17 float32QuantizedLayerTeststolerance failures with TF32 on and 17/17 pass withMLX_ENABLE_TF32=0. Production Muse Glimmer loads weights and runs all matmuls/SDPA inbf16, so TF32 does not apply in production.M5 Max (
applegpu_g17s) NAX Microbenchmarks (bf16,transpose=true, host wall-clock alternatingKS1→KS0→KS1→KS0)(N×K)Mbits=4, gs=64,KS=1vs0)2048×614433.51vs37.80 µs) / 1.06x / 1.06x / 1.05xbits=4, gs=64,KS=1vs0)2048×204816.88vs18.54 µs) / 1.02x / 1.01xbits=4, gs=64,KS=1vs0)6144×614448.33vs51.92 µs) / 1.04x / 1.04x / 1.03xbits=4, gs=64,KS=1vs0)4160×4160bits=8, gs=64,KS=1vs0)2048×6144bits=8, gs=64,KS=1vs0)4160×4160bits=8, gs=64,KS=1vs0)6144×61440.99x / 1.00x / 1.00x, ~6% run variance)bits=4, gs=16, absolute on#73, no72dffa2dA/B yet)6144×614429.1 µs) / 538 GB/s cache-warm (39.8 µs) / 9.5 TF (255.1 µs) / 45.7 TF (105.8 µs) / 53.8 TF (718.7 µs)bits=8, gs=32, absolute on#73, no72dffa2dA/B yet)6144×614447.7 µs) / 829 GB/s cache-warm (47.2 µs) / 9.3 TF (259.3 µs) / 42.6 TF (113.3 µs) / 50.5 TF (764.9 µs)Skipped / Ignored
pre-commit run --all-fileslocally (ranxcrun swift-format lint --strict,check-generated-metal-sources.py, andcheck_forkdiff.pydirectly; GitHub Actions CI Lint triggered on7581e61e).500c5d7edefault-to-0re-pin (zero Metal kernel.hdiff between979ad5daand4ef15bc7d4; bothMLX_NAX_KSPLIT=0andMLX_NAX_KSPLIT=1modes already passed on M5 Max).Not proven
72dffa2dandM=32cliff attribution: NVFP4/MXFP8 microbenchmarks above are absolute measurements on#73with no side-by-side72dffa2dbaseline run yet.#73+#79+#579+#580stack — 254/254 test executions — and M5 NAX microbenchmarks are proven, while real-weight end-to-end tok/s and long-context KV-hash comparison remain).Checklist
pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes (ranxcrun swift-format lint --strict,check-generated-metal-sources.py, andcheck_forkdiff.pydirectly)fork.yaml)AI usage
use_ksplitgate, hardening guards, M5-routed unit tests, mergedmlx#73(4ef15bc7d4) re-pin, and this PR description, and ran local M4 Max (m4-max-1) and M5 Max (applegpu_g17s) validation checks at the user's request.Reviewer Notes
Source/Cmlx/mlxpin (4ef15bc7d4, mergedLayr-Labs/mlx#73) andSource/Cmlx/include-framework/mlx-utils.h(env::nax_ksplit()opt-in default0).Tests/MLXTests/NAXQuantizedKernelTests.swiftagainstQuantizedMatmul::eval_gpu(Source/Cmlx/mlx/mlx/backend/metal/quantized.cpp) and verify default (MLX_NAX_KSPLITunset ->0) bitwise parity assertion.Source/Cmlx/mlx-generated/metal/quantized_nax.h(use_ksplitFC 203 gate) andSource/Cmlx/mlx-generated/metal/fp_quantized_nax.h(guard comments and alignment fallback).