Repository navigation
Fix gather_qmm NAX kernel name mismatch - #3632
Conversation
gather_qmm_nax builds kernel names with bk = 32, but the gather qmm NAX kernels are only instantiated with bk = 64 (bk only enters the name), so the lookup always failed with "Unable to load kernel ..._bk32...". Use bk = 64 to match the instantiations and add a regression test that runs matrix-size gather_qmm in half precision against a float32 reference. Signed-off-by: Bvicii <yizhanhuang2002@gmail.com>
|
Confirming this on an M5 Pro (macOS 27 beta, Metal NAX active) - we hit the Symptom: any transposed because the dispatcher builds the name with Where it bites: quantized MoE / switch layers. Single-token AR decode Rebuilt MLX from source with +1 to merging, thanks! |
Signed-off-by: Bvicii <yizhanhuang2002@gmail.com> (cherry picked from commit 3f788b1)
Proposed changes
gather_qmm_naxbuilds the NAX kernel name withbk = 32, but the gather qmm NAX kernels are only instantiated with_bk64_names. On NAX devices this makes the matrix-sizegather_qmmpath (taken for half-precision inputs, or float32 with tf32 enabled) fail during kernel lookup with anUnable to load kernel ..._bk32...error.This changes the
gather_qmm_naxkernel-name construction to usebk = 64, matching the existing instantiations. In this pathbkis only part of the kernel name; the dispatch geometry is unchanged.The PR also adds a regression test for matrix-size half-precision
gather_qmmcovering bothaffineandmxfp4, checked against a float32 reference.Tested with:
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes