Qualcomm AI Engine Direct - fp16a8w quantization crashes on layer_norm

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

崩溃发生在 htp_rules.py 中的 LayerNorm 标注器里,它在 get_fp16a8w_qnn_ptq_config 将 input_activation 设为 None 的情况下读取 input_act_qspec.dtype。使用 make_quantizer(quant_dtype=QuantDtype.use_fp16a8w) 和 prepare_pt2e,以 Linear 后接 LayerNorm 的方式复现。完成标准是:运行时不再出现 AttributeError,且该标注与同一文件中 MatMul 标注器使用的现有 None 判断保持一致。

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

描述

get_fp16a8w_qnn_ptq_config sets input_activation=None, and the LayerNorm annotator in htp_rules.py reads input_act_qspec.dtype, so prepare_pt2e fails with AttributeError: 'NoneType' object has no attribute 'dtype'. Repro: Linear + LayerNorm with make_quantizer(quant_dtype=QuantDtype.use_fp16a8w).

Guarding it like MatMul does (if input_act_qspec is not None and input_act_qspec.dtype == torch.int32:) fixes annotation, verified with per-tensor and per-channel weights.

主要语言
Python
星标
5.2k
派生
1.2k
平均合并
1 天 22 小时
30 天内合并 PR
675

环境准备

从这里开始

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

pytorch/executorch 的其他 Issue

查看 pytorch/executorch 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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