AutoRound: user-passed quantization_config silently overwrites checkpoint's quant settings
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Python
- 星标
- 34.8k
- 派生
- 7.4k
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 54
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 于 4 天前认领。 未关闭
难度 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 于 20 天前认领。 未关闭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
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
scikit-learn-contrib/category_encoders#553 ·
维护者通常 1 天内回复
-
flaky-watch
难度 2/5 1-3 小时 新手友好度 88/100
btclib-org/btclib#2839 ·
维护者通常 1 天内回复
-
BarrelList constructor drops false-valued iterable contents可能已有人在做 @Gambit-Checkmate 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 19 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
vllm-project/vllm#63863 ·
维护者通常 1 天内回复