Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

GGUF dequant transient: numpy-fallback (IQ) types over-reserve device memory ~4x

Aperta
#9,718 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@wunianze666-netizen ci sta già lavorando.

Dal 15/10/2026.

  • #9862 di @wunianze666-netizen — aperta

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

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di invoke-ai/InvokeAI

Tutte le issue di invoke-ai/InvokeAI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.