@dataclass on quant configs breaks __eq__/__repr__/hashing, and to_json_string() raises for most configs
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 73/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, machine-learning
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- Python
- Estrellas
- 34.8k
- Forks
- 7.4k
- Merge medio
- 2 d 6 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
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
521xueweihan/HelloGitHub#4115 ·
-
get_lldp_neighbors_detail: query asks for 'max-address' (typo for 'mac-address'), so remote_chassis_id is always emptyPosiblemente ocupada @Jah-yee la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
lesson-submission pending-review
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
Ikalus1988/MisakaNet#3899 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
aws-samples/sample-per-model-bedrock#549 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100