Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado
#9,718 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@wunianze666-netizen ya está trabajando en esto.

Desde el 15/10/2026.

  • #9862 de @wunianze666-netizen — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
numpy, python, pytorch

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
28.8k
Forks
3.1k
Merge medio
3 d 1 h
PR fusionados (30 d)
143

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de invoke-ai/InvokeAI

Todos los issues de invoke-ai/InvokeAI

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.