SSD streaming: LRU cache behaves pathologically during prefill
I maintainer di solito rispondono entro 6 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- performance
Direzione di ricerca
Look at the SSD streaming and LRU cache implementation, likely in files handling weight loading and caching. The issue describes a specific pathological behavior during prefill where the cache hit rate drops to 0%. Start by understanding the current cache allocation and eviction logic. The proposed fix is to freeze cache allocations after the first prefill batch. Test the change by measuring prefill throughput before and after, as the user did with the GLM-5.3 Flash model.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
During prefill, the activated weights per batch may be larger than the expert cache. When this happens I see a flat 0% hit rate, because the LRU replacement policy always evicts an expert between its allocation and its next use. Prefill is disk-bound as a result.
I did some experiments, and a simple trick that helps quite a bit is to temporarily freeze cache allocations after the first prefill batch. For remaining batches you still query the cache, still use cached experts, but anything not in the cache is filled from disk and immediately discarded after use. This avoids the pathological LRU cycling and ensures you get to hit the cached experts. Enabling cache allocations for the first batch is still useful for cache warming, especially when prefilling from 0 with a cold cache.
This trick increased my prefill from ~110 t/s to ~400 t/s running the Q2 quant of GLM-5.3 Flash on an RTX Pro 6000 using CUDA 13.1. I can provide a patch if it's interesting but I think there's enough info here to have an agent evaluate the idea.
Other issues: I looked at #503 which sounded related from the title, but on closer inspection it seems to be a problem with different cache arenas for different quantisation types, and not about this more general LRU problem.
- 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 6 giorni
-
ds4-eval: strict grader marks correct answer INCOMPLETE when output ends with "</think>E" (no "Answer:" line)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
antirez/ds4#1189 · 2 commenti ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
antirez/ds4#1173 · 1 commento ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
antirez/ds4#1032 · 1 commento ·
I maintainer di solito rispondono entro 6 giorni
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
Revivedx/SavageWindRecomp#1358 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
ossc-db/pg_hint_plan#255 ·
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
awslabs/aws-c-common#1319 ·