M5 Ultra: decode drift and repetition loops when M5_PARALLEL_FULL_FFN and M5_ROUTER_PROJECT_SELECT_FUSE are both enabled
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 43/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c, macos
- Ambito
- machine-learning, performance
Direzione di ricerca
Start by locating the implementations of M5_PARALLEL_FULL_FFN and M5_ROUTER_PROJECT_SELECT_FUSE, then trace their interaction on the M5 Ultra Metal decode path. Reproduce with the supplied ds4 command and compare --decode-consistency 16 results with each flag disabled in turn. Done means the default configuration matches the consistent 0.723 max_abs and 0.122 rms baseline across repeated runs without decode drift.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On an M5 Ultra, DeepSeek V4 Flash Q2 decode drifts badly from a fresh prefill and often degenerates into repetition loops. It only happens when M5_PARALLEL_FULL_FFN and M5_ROUTER_PROJECT_SELECT_FUSE are both enabled (the default). Disabling either one fixes it. Results vary run to run under greedy decoding, so it looks like a missing barrier between the fused router select and the parallel FFN.
Repro
ds4 -p "Explain Redis streams in one paragraph." --nothink --decode-consistency 16
Sample degenerate output from a default run (thinking on, default sampling):
###. Redis streams are one paragraph explanation. Let's think about Redis streams. [...] They have "a" "b" "c" "d" "e" "f" [...] "x" "y" "z" "z" "a" "b" "c" [...]
Results
--decode-consistency 16, two runs per config:
| Config | max_abs | rms |
|---|---|---|
| Default | 22.63 / 8.23 | 4.78 / 1.58 |
DS4_METAL_DISABLE_M5_PARALLEL_FULL_FFN=1 |
0.723 / 0.723 | 0.122 / 0.122 |
DS4_METAL_DISABLE_M5_ROUTER_PROJECT_SELECT_FUSE=1 |
0.723 / 0.723 | 0.122 / 0.122 |
All 13 DS4_METAL_DISABLE_M5_* set |
0.723 | 0.122 |
Bisect details
- All 13 M5 paths disabled except one, for each of the 13: every run gives 0.723 / 0.122, bit-identical. No single path breaks on its own.
- Default with exactly one M5 path disabled: only
PARALLEL_FULL_FFNandROUTER_PROJECT_SELECT_FUSEbring drift down to 0.723 / 0.122. The other 11 stay in the 8-24 max_abs range. - Other toggles that did not help (single run each, max_abs):
DS4_METAL_DISABLE_METAL4=113.2,DS4_METAL_MATH_SAFE=116.7,DS4_METAL_KV_RAW_F32=118.3,DS4_METAL_HC_STABLE=013.3. --metal-graph-prompt-testagrees with CPU on the prompt (same top token, top logit 39.06 vs 39.03), so prefill looks fine.
Workaround: export DS4_METAL_DISABLE_M5_ROUTER_PROJECT_SELECT_FUSE=1 (64.4 -> 63.9 t/s generation).
Environment
- Apple M5 Ultra, 96 GB, macOS 27.2 (26B123),
iogpu.wired_limit_mb=90112 - ds4 0.0.20261102.1026 (Homebrew,
temikus/tap/ds4) DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-0731.gguf, SHA-256 matches HF (ca22ae2f...)- Default drift-patch flags:
hc_stable=on norm_unify=on kv_raw_f32=off rope_exp2_log2=off math_safe=off tensor_matmul=on
- Lingua principale
- C
- Stelle
- 24.4k
- Fork
- 2.4k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 antirez/ds4
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
antirez/ds4#1189 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
antirez/ds4#1173 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
antirez/ds4#1032 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
awslabs/aws-c-common#1319 ·
-
editor/integration
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DeusData/codebase-memory-mcp#3130 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 13 giorni
-
DBMS_UTILITY.FORMAT_ERROR_STACK exceeds the 2000-byte limitForse già presa @coder999o l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
zephyrproject-rtos/zephyr#127560 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni