GGUF dequant transient: numpy-fallback (IQ) types over-reserve device memory ~4x
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- numpy, python, pytorch
- Ambito
- machine-learning
Direzione di ricerca
Start in the function that computes peak_ggml_linear_dequant_transient_bytes and its _DEQUANT_INTERMEDIATE_BYTES_PER_ELEMENT table, then read GGMLTensor.get_dequantized_tensor to confirm the host fallback through gguf.quants.dequantize. Change the default for types that are neither torch-compatible nor in DEQUANTIZE_FUNCTIONS to 0 intermediates, and check the IQ4_XS and IQ4_NL estimates against the measured ratios in the issue. Done when those types report no device intermediates and the existing estimate tests still pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up from #9709 (review at 59c851290a).
peak_ggml_linear_dequant_transient_bytes gives every quantization type missing from _DEQUANT_INTERMEDIATE_BYTES_PER_ELEMENT the worst-case 8 B/element of device intermediates. Those types (the IQ family) are exactly the ones without a GPU kernel: GGMLTensor.get_dequantized_tensor decodes them through gguf.quants.dequantize on the host and then calls .to(device, dtype=compute_dtype), which casts on the CPU before the copy. On the device, the only allocation is the result.
Measured on a W7900 (torch 2.13 + ROCm 7.2), 3072×12288 weight, bf16 compute dtype:
| Type | Device intermediates | Estimate / (peak + packed) |
|---|---|---|
| IQ4_XS | 0.00 B/el | 4.16 |
| IQ4_NL | 0.00 B/el | 4.12 |
The nodes that add the term to an activation estimate (FLUX.2, Krea-2, Z-Image, Ideogram 4) therefore over-reserve by 8 B per element of the largest layer. By the FLUX.2 dev numbers in #9709, that is roughly 2.5 GiB, which is the kind of over-reservation #9709 replaced the flat bound to avoid.
Suggested fix: use 0 intermediates for any type that is neither torch-compatible nor in DEQUANTIZE_FUNCTIONS, since every such type takes the host fallback. The fallback's real cost is host RAM (the float32 numpy decode), which nothing reserves. That could be tracked separately.
- Lingua principale
- TypeScript
- Stelle
- 28.6k
- Fork
- 3k
- Merge medio
- 3g 4h
- PR unite (30g)
- 102
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 invoke-ai/InvokeAI
-
[enhancement]: Bump PyPatchMatch to latestForse già presa @dunkeroni l’ha presa 2 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
invoke-ai/InvokeAI#9826 · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
extract_audio_pcm detects "no audio stream" by matching ffmpeg's stderr text, so a wording change turns silent clips into hard errorsForse già presa @wunianze666-netizen l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
[bug]: first load after an update shows raw translation keys (service worker serves stale locales)Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
invoke-ai/InvokeAI#9908 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di invoke-ai/InvokeAI
Issue simili
-
The inspector never shows the instances field, so scaling out is unreachableForse già presa @Mrkewl l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
xevrion/breakscale#96 ·
I maintainer di solito rispondono entro 4 giorni
-
Object parameters lose their structure when resources is enabledForse già presa @asts-top l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rossant/awesome-math#199 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
jaegertracing/jaeger-ui#4618 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
mifi/lossless-cut#3125 ·
I maintainer di solito rispondono entro 1 giorno