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

AutoRound: user-passed quantization_config silently overwrites checkpoint's quant settings

Aperta
#15,120 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@OnePunchMonk ci sta già lavorando.

Dal 24/10/2026.

  • #15121 di @OnePunchMonk — aperta

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
Stack tecnologico
python, pytorch

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, commit aaf57d0
  • 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

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 huggingface/diffusers

Tutte le issue di huggingface/diffusers

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.