Pull Request已成功合入, 合并人@ascend-robot
(感谢 anreywmh 的贡献)Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/msmodelslim | ✅ joejoezhou, rookie_hongchuan (2/2) | ✅ joejoezhou (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


问题/功能描述
本次PR旨在提升模型量化工具对复杂模型架构(特别是多模态模型)的兼容性与自动化程度,并增强其健壮性。主要解决了两个核心问题:1)量化多模态模型(如Qwen-VL、LLaVA)时,因结构复杂导致无法自动识别和适配量化子图(如LayerNorm-Linear结构)的问题;2)当用户提供的模型适配器未实现特定量化接口时,原处理流程会抛出异常导致中断,影响了工具的鲁棒性和向后兼容性。
修改方案描述
修改方案主要包括功能新增与兼容性优化两部分。首先,新增了迭代平滑(iter_smooth)预处理步骤,并实现了一个默认的模型适配器。该适配器利用前向钩子技术,在虚拟前向传播中动态检测并构建“norm-linear”类型的子图适配配置,从而自动适配多模态模型的语言模型部分。其次,为SmoothQuant、Flex Smooth Quantization和Iterative Smooth Quantization处理器增加了降级处理逻辑:当适配器未实现特定接口时,将异常抛出改为记录警告,并回退到基于默认钩子机制的自动检测模式,确保了流程的平滑过渡和向后兼容。


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: joejoezhou.
Reviewers who wrote a comment of /lgtm are: joejoezhou, rookie_hongchuan.


【msmodelslim】【feature】支持默认结构的离群值抑制