Repository navigation
Add MLX inference for ParoQuant and supported quantization formats - #3134
Merged
Merged
Conversation
Qubitium
force-pushed
the
codex/mlx-methods-20260925
branch
from
September 25, 2026 11:55
6b3bc47 to
4c12fbb
Compare
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.
Changes
Accuracy and regression coverage
git diff --checkpass. The separatetests/test_mlx.pyintegration test requires a model under/monster/data/model/...and could not run here.Performance versus main
Apple M5 Ultra, MLX 0.32.2, Torch 2.14.0, FP16 inputs, group size 128. Each value is the median of 11 timed forwards after one warmup with inputs resident on device; Torch MPS and MLX are synchronized. The baseline classes are the unchanged Torch fallbacks from main. Weights and inputs are deterministic synthetic data. These are isolated projection latencies, excluding checkpoint conversion and end-to-end generation.
ParoQuant's nonidentity case uses eight valid pairwise rotation stages with angle 0.01 and channel scale 1.01. The QQQ benchmark uses uniform packed codes, while the independent Qwen QQQ tests use a varied pattern. GGUF uses Q4_0 blocks; other supported qtypes have separate small-shape numerical tests.
ParoQuant, identity stage: all nine projections at 1, 16, and 128 rows
ParoQuant, eight nonidentity stages: all nine projections at 1, 16, and 128 rows
QQQ: all nine projections at 1, 16, and 128 rows
GGUF Q4_0: all nine projections at 1, 16, and 128 rows
Reproduce:
PYTHONPATH=. python tests/benchmark_mlx_qwen38_27b.py --repeats 11,PYTHONPATH=. python tests/benchmark_mlx_qwen38_27b.py --krot 8 --rotate --repeats 11, andPYTHONPATH=. python tests/benchmark_mlx_qwen38_qqq_gguf.py --method qqq --repeats 11(or--method gguf).