Quantized matmul: opt-in mode where a batched row matches M=1
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, machine-learning
- Ambito
- machine-learning
Direzione di ricerca
Start in mlx/backend/metal/quantized.cpp at QuantizedMatmul::eval_gpu, use_qmv_wide, and qmm_nax_k_partitions, since they control M-based dispatch and split-K selection. Trace the M=1 and batched quantized-matmul paths, then reproduce the issue by comparing each unequal batched row with the same row run alone. Done means an opt-in flag can force the row-exact route while leaving the default fast path unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- I understand it is strictly prohibited to use AI to write issues.
AI usage disclosure: drafted with AI assistance from measurements we already had. The line numbers below are from current main.
Could quantized matmul grow an opt-in mode where a row inside a batch matches that same row run at M=1?
The Metal dispatch picks the kernel from M.
use_qmv_wide(mlx/backend/metal/quantized.cpp, around line 543) runs when M is at least 2. M=1 stays onqmv.QuantizedMatmul::eval_gpucompares M withget_qmv_batch_limit(around line 2183) and sends larger M throughqmv_mma,qmm_splitk_nax, orqmm_splitk.qmm_nax_k_partitions(around line 1290) sets the split count from M, because the tile count isceildiv(M, 64).
A different kernel is a different reduction order, so the result changes with the batch.
What we measured: 16 unequal rows in one forward, against the same rows run alone, flipped 30 to 38 of 256 greedy tokens. That was Qwen3-30B-A3B and a 27B. Grouped short prefill had 12 of 126 rows differ.
oMLX carries a hand patch for the row-exact route: omlx/patches/row_exact_qmv.py. vLLM documents the same property as a feature, docs/features/batch_invariance.md, behind VLLM_BATCH_INVARIANT.
The change we run locally turns qmv_wide and split-K off for every call. That costs throughput, so it has to be a flag. Making it the default would slow the fast path for everyone.
Augustas from Malibu
- Lingua principale
- C++
- Stelle
- 29.1k
- Fork
- 2.4k
- Merge medio
- 3g 16h
- PR unite (30g)
- 109
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ml-explore/mlx
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ml-explore/mlx#4832 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG] `mx.expand_dims` docs: the Args section names `axes`, but the parameter is `axis`Forse già presa @Redempt1onzzZZ l’ha presa 2 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
ml-explore/mlx#4829 ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG] `mx.qqmm` docs: the Args section names `global_scale`, but the parameter is `global_scale_x`Forse già presa @XXXXRT666 l’ha presa 5 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
ml-explore/mlx#4815 ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG] FP4 quantization on CPU rounds ties toward zero while Metal rounds to evenForse già presa @projekt11th l’ha presa 6 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ml-explore/mlx#4753 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
ml-explore/mlx#4837 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di ml-explore/mlx
Issue simili
-
bug javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement third-party
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pocoproject/poco#5656 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Qiskit/qiskit-aer#2525 ·
I maintainer di solito rispondono entro 1 giorno