AutoRound: user-passed quantization_config silently overwrites checkpoint's quant settings
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Área
- machine-learning
Línea de trabajo
Read src/diffusers/quantizers/auto.py and inspect DiffusersAutoQuantizer.merge_quantization_configs; the reproduction in the issue shows how to trigger the overwrite. Check existing quantizer tests for coverage of merging checkpoint settings with runtime overrides, then verify that only the requested backend changes while checkpoint values such as group_size and sym remain intact. An open linked pull request already addresses this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
DiffusersAutoQuantizer.merge_quantization_configs (in src/diffusers/quantizers/auto.py) is supposed to let users override runtime-only fields like backend on an AutoRoundConfig while keeping the checkpoint's own quantization settings. Instead, it loops over every field in the user-supplied AutoRoundConfig.__dict__ and overrides any field that differs from the checkpoint's value, not just backend.
The documented call is AutoRoundConfig(backend="auto"). That object still carries the dataclass defaults bits=4, group_size=128, sym=True. So loading a checkpoint that was quantized with, say, group_size=32 silently rewrites it to group_size=128 before convert_hf_model reads it — producing a shape mismatch at best, wrong (dequantized-as-the-wrong-grouping) outputs at worst.
Reproduction
from diffusers.quantizers.auto import DiffusersAutoQuantizer
from diffusers.quantizers.quantization_config import AutoRoundConfig
# Simulates the checkpoint's own config.json quantization_config
checkpoint_config = AutoRoundConfig(bits=4, group_size=32, sym=False, backend="torch")
# The documented way to override just the runtime backend
args_config = AutoRoundConfig(backend="auto")
merged = DiffusersAutoQuantizer.merge_quantization_configs(checkpoint_config, args_config)
print(merged.backend) # "auto" - expected
print(merged.group_size) # 128 <- should be 32, the checkpoint's own value
print(merged.sym) # True <- should be False, the checkpoint's own value
System Info
diffusers@main, commitaaf57d0- Python 3.12, Linux
Who can help?
@sayakpaul
- Lenguaje dominante
- Python
- Estrellas
- 34.8k
- Forks
- 7.4k
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 54
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de huggingface/diffusers
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
huggingface/diffusers#15125 ·
Los mantenedores suelen responder en 1 día
-
`encode_video` truncates a fractional `fps`, so the video runs longer than its audioPosiblemente ocupada @guptaishaan la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
huggingface/diffusers#15104 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
VaeImageProcessor.denormalize() raises AttributeError for NumPy inputsPosiblemente ocupada @tonycoder-hub la tomó hace 14 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
huggingface/diffusers#15011 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`ModelMixin.from_pretrained` on a sharded checkpoint fails under `HF_HUB_OFFLINE=1` even when fully cached (`_get_checkpoint_shard_files` still calls `model_info`)Posiblemente ocupada @Subodh-17 la tomó hace 20 días. Abiertobug models
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
huggingface/diffusers#14952 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
UniPCMultistepScheduler fails in torch.linalg.solve under a float64 default dtype: the unit entry of rks takes the default dtypePosiblemente ocupada @deep1blue la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
huggingface/diffusers#14888 ·
Los mantenedores suelen responder en 1 día
Todos los issues de huggingface/diffusers
Issues similares
-
Link Checker ReportAbiertoautomated issue linkchecker report
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
QuantEcon/lecture-python.myst#1098 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
[Bug]: Processing errors missing from Docker logs due to incorrect console-handler detectionAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
podly-pure-podcasts/podly_pure_podcasts#279 ·
Los mantenedores suelen responder en 1 día
-
New template proposal: ljpAbiertotemplate-proposal
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
OpenShot/openshot-qt#6230 ·
Los mantenedores suelen responder en 1 día