@dataclass on quant configs breaks __eq__/__repr__/hashing, and to_json_string() raises for most configs
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 73/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, machine-learning
Direzione di ricerca
Start by reading src/diffusers/quantizers/quantization_config.py, especially the dataclass declarations and to_json_string() implementation. Reproduce the equality, representation, hashing, and JSON serialization failures described in the issue, then inspect the existing config tests for where those behaviors are covered. Done means the affected configs preserve their parameters in equality and representation, have the expected hashing behavior, and serialize to JSON without raising.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Every quantization config subclass in src/diffusers/quantizers/quantization_config.py is decorated with @dataclass, but each has a custom __init__ and declares no dataclass fields beyond the inherited quant_method. @dataclass still generates __eq__/__repr__ from the declared fields it sees, so:
GGUFQuantizationConfig(compute_dtype=torch.float16) == GGUFQuantizationConfig(compute_dtype=torch.bfloat16)isTrue.- The configs are unhashable.
repr()hides every real parameter for GGUF, BFL, Nunchaku, Quanto, ModelOpt, and AutoRound configs.
Separately, to_json_string() calls self.to_diff_dict(), which only BitsAndBytesConfig defines — every other config raises AttributeError when to_json_string() is called (which is the default use_diff=True path).
Reproduction
import torch
from diffusers.quantizers.quantization_config import GGUFQuantizationConfig, QuantoConfig
a = GGUFQuantizationConfig(compute_dtype=torch.float16)
b = GGUFQuantizationConfig(compute_dtype=torch.bfloat16)
print(a == b) # True - should be False
print(repr(a)) # "GGUFQuantizationConfig(quant_method=<QuantizationMethod.GGUF: 'gguf'>)" - compute_dtype is missing
hash(a) # TypeError: unhashable type: 'GGUFQuantizationConfig'
QuantoConfig(weights_dtype="int8").to_json_string()
# AttributeError: 'QuantoConfig' object has no attribute 'to_diff_dict'
Logs
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: unhashable type: 'GGUFQuantizationConfig'
Traceback (most recent call last):
File ".../diffusers/src/diffusers/quantizers/quantization_config.py", line 144, in to_json_string
config_dict = self.to_diff_dict()
^^^^^^^^^^^^^^^^^
AttributeError: 'QuantoConfig' object has no attribute 'to_diff_dict'
System Info
diffusers@main, commitaaf57d0- Python 3.12, Linux
Who can help?
(leaving blank — no specific quantization reviewer listed in the template's tag guide)
- 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 3 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 19 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 6 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
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-freeForse già presa @Aaqibhafeezkhan l’ha presa oggi. Apertabeginner documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BistaDinesh03/critique#164 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug IO
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MrNeRF/LichtFeld-Studio#3824 ·
I maintainer di solito rispondono entro 1 giorno
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-webui/open-webui#33200 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Lychee link check failedAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkForse già presa @ocelotl l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
open-telemetry/opentelemetry-python#5825 ·
I maintainer di solito rispondono entro 2 giorni