AutoRound: user-passed quantization_config silently overwrites checkpoint's quant settings
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Ambito
- machine-learning
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 34.8k
- Fork
- 7.4k
- Merge medio
- 2g 6h
- PR unite (30g)
- 54
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 huggingface/diffusers
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
huggingface/diffusers#15125 ·
I maintainer di solito rispondono entro 1 giorno
-
`encode_video` truncates a fractional `fps`, so the video runs longer than its audioForse già presa @guptaishaan l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
huggingface/diffusers#15104 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
VaeImageProcessor.denormalize() raises AttributeError for NumPy inputsForse già presa @tonycoder-hub l’ha presa 14 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
huggingface/diffusers#15011 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
`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`)Forse già presa @Subodh-17 l’ha presa 20 giorni fa. Apertabug models
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
huggingface/diffusers#14952 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
UniPCMultistepScheduler fails in torch.linalg.solve under a float64 default dtype: the unit entry of rks takes the default dtypeForse già presa @deep1blue l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
huggingface/diffusers#14888 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di huggingface/diffusers
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sylvainmetayer/homelab#851 ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Add `ty-pre-commit` hookAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubeflow/docs-agent#279 ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Qiskit/qiskit-ibm-runtime#3523 ·
I maintainer di solito rispondono entro 1 giorno