Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#15,120 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@OnePunchMonk 已经在做这个了。

开始于 2026年10月24日。

  • #15121 来自 @OnePunchMonk —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python, pytorch

调研方向

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, commit aaf57d0
  • Python 3.12, Linux
Who can help?

@sayakpaul

主要语言
Python
星标
34.8k
派生
7.4k
平均合并
2 天 7 小时
30 天内合并 PR
54

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

huggingface/diffusers 的其他 Issue

查看 huggingface/diffusers 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。