@dataclass on quant configs breaks __eq__/__repr__/hashing, and to_json_string() raises for most configs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 73/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- Python
- スター
- 34.8k
- フォーク
- 7.4k
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 54
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
huggingface/diffusers のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/diffusers#15125 ·
メンテナーはふだん 1 日以内に返信
-
`encode_video` truncates a fractional `fps`, so the video runs longer than its audio対応中かも @guptaishaan が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
huggingface/diffusers#15104 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
VaeImageProcessor.denormalize() raises AttributeError for NumPy inputs対応中かも @tonycoder-hub が 14 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/diffusers#15011 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`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`)対応中かも @Subodh-17 が 19 日前に担当しました。 オープンbug models
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/diffusers#14952 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
UniPCMultistepScheduler fails in torch.linalg.solve under a float64 default dtype: the unit entry of rks takes the default dtype対応中かも @deep1blue が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
huggingface/diffusers#14888 ·
メンテナーはふだん 1 日以内に返信
huggingface/diffusers の issue をすべて見る
似ている issue
-
request-theme
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
LizardByte/ThemerrDB#9575 ·
メンテナーはふだん 1 日以内に返信
-
author-page correction
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
acl-org/acl-anthology#10599 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zilliztech/memsearch#818 ·
メンテナーはふだん 1 日以内に返信
-
[FAQ] Commit ID for Projects対応中かも @github-actions が今日担当しました。 オープンfaq-proposal
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
DataTalksClub/faq#503 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-free対応中かも @Aaqibhafeezkhan が今日担当しました。 オープンbeginner documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BistaDinesh03/critique#164 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信