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

Nunchaku AWQ config accepts any group_size, but the kernel only supports 64

未关闭 适合新手
#15,125 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

从 src/diffusers/quantizers/quantization_config.py 开始,阅读 AWQ 验证以及 SVDQ 组大小检查。将接受的 AWQ 配置与 AWQW4A16Linear 所述的内核约束进行比较。当不支持的组大小(如 128)被拒绝,而支持的大小 64 仍被接受时,即为完成。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

NunchakuLiteQuantizationConfig's validation for the AWQ path (src/diffusers/quantizers/quantization_config.py) only checks precision == "int4". It never checks group_size. The actual AWQ kernel call site (AWQW4A16Linear) always calls awq_gemm_w4a16_g64_int32 / passes a literal 64 to gemv, so it only ever supports group_size=64.

A checkpoint quantized with group_size=128 loads without any error and silently produces wrong output. The SVDQ path in the same config class does validate its group size against the expected value per precision, so this looks like an oversight in the AWQ branch rather than intentional.

Reproduction
from diffusers.quantizers.quantization_config import NunchakuLiteQuantizationConfig

config = NunchakuLiteQuantizationConfig(
    awq_w4a16={"precision": "int4", "group_size": 128, "targets": ["final_linear"]}
)
# No error raised here, even though the AWQ kernel only supports group_size=64.
print(config.awq_w4a16["group_size"])  # 128
System Info
  • diffusers @ main, commit aaf57d0
  • 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 天 10 小时
30 天内合并 PR
56

环境准备

从这里开始

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

huggingface/diffusers 的其他 Issue

查看 huggingface/diffusers 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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