已合并
【msmodelslim】【feature】支持默认结构的离群值抑制 #142
【msmodelslim】【feature】支持默认结构的离群值抑制 #142
已合并
anreywmh创建于 2月24日
anreywmh成员
2月24日

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

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 anreywmh 的贡献)
ascend-robot
ascend-robot成员
2月24日 评论:

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 /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
ascend-robotascend-robot成员
2月24日 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
2月24日 评论:

问题/功能描述

本次PR旨在提升模型量化工具对复杂模型架构(特别是多模态模型)的兼容性与自动化程度,并增强其健壮性。主要解决了两个核心问题:1)量化多模态模型(如Qwen-VL、LLaVA)时,因结构复杂导致无法自动识别和适配量化子图(如LayerNorm-Linear结构)的问题;2)当用户提供的模型适配器未实现特定量化接口时,原处理流程会抛出异常导致中断,影响了工具的鲁棒性和向后兼容性。

修改方案描述

修改方案主要包括功能新增与兼容性优化两部分。首先,新增了迭代平滑(iter_smooth)预处理步骤,并实现了一个默认的模型适配器。该适配器利用前向钩子技术,在虚拟前向传播中动态检测并构建“norm-linear”类型的子图适配配置,从而自动适配多模态模型的语言模型部分。其次,为SmoothQuant、Flex Smooth Quantization和Iterative Smooth Quantization处理器增加了降级处理逻辑:当适配器未实现特定接口时,将异常抛出改为记录警告,并回退到基于默认钩子机制的自动检测模式,确保了流程的平滑过渡和向后兼容。

likedislike
ascend-robot
ascend-robot成员2月24日进行代码检视2
msmodelslim/processor/anti_outlier/default/dummy_input_forward.py
已过期
@@ -0,0 +86,4 @@
86+ >>> # lineage[0] is vlm_model
87+ >>> # lineage[1] is vlm_model.language_model
88+ """
89+ # always prioritize model.model.langauge_model
ascend-robot
ascend-robot2月24日评论:

拼写错误: 第90行注释中的'langauge_model'拼写错误,应为'language_model'。虽然这只是注释,但会影响代码的可读性和专业性。

问题类型: 拼写错误
文件路径: msmodelslim/processor/anti_outlier/default/dummy_input_forward.py
行号: 89
问题代码:

    # always prioritize model.model.langauge_model

修改建议:

将注释中的'langauge_model'更正为'language_model'。

此评论由代码审查工具自动生成

likedislike
System
系统消息系统
2月27日 评论:

changed this line on dba13490 view diff detail

此处折叠了59条消息 查看更多
ascend-robotascend-robot成员
3月3日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
3月3日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
3月3日 评论:
流水线 PR-pipeline_msmodelslim#477 已完成
阶段 任务名 状态 详情
编译构建 Build_msmodelslim >>>
恶意代码检查 Antipoison_MindStudio-ModelSlim >>>
编码安全与规范检查 CodeCheck_MindStudio-ModelSlim >>>
开源片段检查 SCA_MindStudio-ModelSlim >>>
开发者测试 UT_msmodelslim >>>
PreSmoke_msmodelslim >>>
流水线 PR-pipeline_msmodelslim >>>
likedislike
ascend-robot
ascend-robot成员
3月3日 评论:

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.

likedislike
ascend-robotascend-robot成员
3月3日 合入了pull request