| [refactor] 重构既有调优策略的敏感层分析模型适配 Co-authored-by: joejoezhou<zhourongchen1@huawei.com> # message auto-generated for no-merge-commit merge: !527 merge refactor/tune-strategy-sensitivity-interface into master [refactor] 重构既有调优策略的敏感层分析模型适配 Created-by: joejoezhou Commit-by: joejoezhou Merged-by: ascend-robot Description: ## 1. 影响面评估 - **接口变更(按需):** 无 - **输出件变更(按需):** 无 - **非兼容变更(按需):** 移除 StandingHighInterface;StandingHighWithExperienceInterface 仅保留 load_model;移除 AnalyzePipelineInterface - **SIG 评审结论(按需):** 无 --- ## 2. 修改描述 - **修改背景(可选):** standing_high / standing_high_with_experience 原先重复声明敏感层分析相关接口 - **修改目的:** 移除非必要协议方法,简化自动调优策略模型适配复杂度 - **修改内容:** - core/analysis_service:导出 LayerSensitivityAnalysisModelInterface(PipelineInterface 别名) - core/tune_strategy/standing_high:移除 StandingHighInterface 与策略侧 load_model 预加载 - core/tune_strategy/standing_high_with_experience:精简接口,校验 LayerSensitivityAnalysisModelInterface - model/interface_hub:移除 AnalyzePipelineInterface - docs:同步自动调优模型适配说明(standing_high / SHWE) - [x] **涉及代码双合**(关联 PR 链接):后续策略见 MR !528 --- ## 3. 功能验证 - [x] **功能自验** - [ ] **本地自验用例截图**(请勿包含个人信息;可附复现命令) --- ## 4. 自检(请逐项确认,不适用标 N/A) **典型安全编码问题** - [x] **是否已校验外部数据** — N/A - [x] **是否未采集或打印敏感信息** — N/A - [x] **是否已正确设置文件权限** — N/A - [x] **是否充分考虑浮点运算溢出、除零等异常场景** — N/A - [x] **是否已对正则表达式做 ReDos 检查** — N/A **DT** - [x] **是否具备 UT 测试用例看护**(路径:test/cases/core/tune_strategy/standing_high/、standing_high_with_experience/) - [ ] **是否需要添加冒烟:** 否 See merge request: Ascend/msmodelslim!527 | 3 个月前 |
| 【docs】资料架构重构,并将资料托管至readthedocs。 Co-authored-by: keith_wa<keith_wwa@163.com> # message auto-generated for no-merge-commit merge: !109 merge pr_docs_re_copy into master 【docs】资料架构重构,并将资料托管至readthedocs。 Created-by: keith_wa Commit-by: keith_wa Merged-by: ascend-robot Description: 1. 动机 (Motivation) 内容上: 优化导航结构:原目录结构逻辑不清晰、目录层级深且链接复杂。 提升阅读体验:原 traditional_quantization_v0 目录下存在 20+ 个零散文档,内容分布碎片化,用户难以快速建立完整的技术全景认知。 消除内容冗余:多个文档之间存在重复的依赖说明、操作流程及参数介绍,增加了维护成本及版本不一致的风险。 呈现上: 提供专业资料托管:原docs/目录结构不清晰、目录名/文档名不直观(英文),跳转繁琐且无搜索功能。 2. 修改点 (Changes) 2.1 重新梳理目录结构  2.2. 文档整合与重构 V0及传统量化核心文档合并:将 20 多个零散文档按功能维度深度整合为 10篇核心指南: # V0框架文档导航(已停止演进) 本目录文档按模型类型与任务场景重排,便于按需求快速定位。 ## 一、传统模型量化与校准 - [传统模型量化与校准](traditional_model_quantization_and_calibration.md) - 包含 PyTorch/ONNX/MindSpore 训练后量化与 QAT。 ## 二、大模型量化与压缩 - [大模型量化与校准](foundation_model_quantization_and_calibration.md) - 包含低显存量化、混合校准数据集、FA3 量化。 - [压缩与结构优化(大模型为主)](foundation_model_compression.md) - 包含稀疏量化与权重压缩、长序列压缩、权重压缩流程、低秩分解。 ## 三、训练加速与模型改造 - [训练加速与模型改造](pruning_and_distillation.md) - 包含重要性剪枝、Transformer 剪枝、Sparse tool、模型蒸馏。 - [稀疏加速训练](sparse_acceleration_training.md) - 包含宽度扩增与深度扩增模型的稀疏训练加速流程。 ## 四、工具与生态适配 - [辅助工具与专项指导](compression_utils.md) - 包含量化权重格式说明与 MindSpeed 适配器。 - [伪量化精度测试工具](fake_quantization_accuracy_testing_tool.md) - 包含 Precision Tool 使用方式与测试流程。 - [多模态生成模型推理优化](inference_optimization_for_multimodal_generative_model.md) - 包含 DiT 缓存优化与自适应采样优化流程。 - [常见代码示例](quantization_and_sparse_quantization_scenario_import_code_examples.md) - 包含常见量化/稀疏量化场景导入代码样例。 2.3 配置readthedocs文档托管: https://modelslim.readthedocs.io/zh-cn/latest/ 2.4 配置deepwiki: https://deepwiki.com/Keithwwa/ModelSlim 3. 验证: 3.1. gimini代码检视: https://github.com/Keithwwa/ModelSlim/pull/1 See merge request: Ascend/msmodelslim!109 | 6 个月前 |
| [docs] fix doc tools scan problem Co-authored-by: zhongzhoutan<1710115119@bjmu.edu.cn> # message auto-generated for no-merge-commit merge: !344 merge docs/fix-lint-master into master [docs] fix doc tools scan problem Created-by: tangxuanya Commit-by: zhongzhoutan Merged-by: ascend-robot Description: 感谢您贡献的Pull Request! 在提交之前,请务必阅读 [CONTRIBUTING.md](https://gitcode.com/Ascend/msmodelslim/blob/master/CONTRIBUTING.md)。 Thanks for sending a pull request! BEFORE SUBMITTING, PLEASE READ [CONTRIBUTING.md](https://gitcode.com/Ascend/msmodelslim/blob/master/CONTRIBUTING.md). ## PR描述 (What this PR does / why we need it?) - 请明确说明您提交PR的变更内容。本部分旨在概述所做的变更,以及此PR是如何解决该问题的。请尽可能地提供有助于评审人员更高效、更快速完成检视审查的实用说明。 - 请说明为何需要这些更改,例如具体的使用场景或bug描述。 - 关联issue号(如果有)。 - Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. If possible, please consider writing useful notes for better and faster reviews in your PR. - Please clarify why the changes are needed. For instance, the use case and bug description. - Related issue number (if any) ## 面向用户的变更 (Does this PR introduce _any_ user-facing change)? - 请注意,这里指的是**任何**面向用户的变更,包括但不限于API、用户界面或其他使用方式上的变更。 - Note that it means *any* user-facing change including all aspects such as API, interface or other behavior changes. ## 功能验证 (How was this patch tested?) 请确认CI已通过增量及存量的单元测试用例。 如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤(最好提供完整的可复现的操作路径及关键截图),以便Committer能够快速复现验证,也便于后续的维护。 如果未添加测试,请说明未添加的原因,以及为何难添加测试。 - [_] 功能自验 - [_] 本地自验截图(涉及个人标识符等敏感信息请注意脱敏) - [_] 新增/变更内容是否已新增/适配UT测试用例看护 CI passed with new added/existing test. If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future. If tests were not added, please describe why they were not added and/or why it was difficult to add. - [_] Self-verification of the feature. - [_] Screenshot of local self-verification (please anonymize any sensitive information such as personal identifiers) - [_] Have new or modified unit test (UT) cases been added or adapted to cover the newly added or changed content? See merge request: Ascend/msmodelslim!344 | 4 个月前 |
| [Feature] add ceil_x quantization method for MXFP4 Co-authored-by: rookie_hongchuan<hongchuan6@h-partners.com> # message auto-generated for no-merge-commit merge: !446 merge support_cx_algorithm into master [Feature] add ceil_x quantization method for MXFP4 Created-by: rookie_hongchuan Commit-by: rookie_hongchuan Merged-by: ascend-robot Description: # 提交前请阅读 [CONTRIBUTING.md](https://gitcode.com/Ascend/msmodelslim/blob/master/docs/zh/appendix/CONTRIBUTING.md),开发者文档:[模型接入指南](https://msmodelslim.readthedocs.io/zh-cn/latest/zh/developer_guide/integrating_models/) **PR 标题前缀:** [Feature] | [Bugfix] | [Doc] | [Test](与 CONTRIBUTING 一致) --- ## 1. 影响面评估 - **接口变更(按需):** YAML qconfig.weight.ext 新增 ceil_x_value / enable_search / search_min/max/step 配置项 - **输出件变更(按需):** 无 - **非兼容变更(按需):** 无 - **SIG 评审结论(按需):** 无 --- ## 2. 修改描述 - **修改背景(可选):** 传统 MXFP4 per-block 量化使用 s = floor(log2(max(|x|))) 计算 shared exponent,缩放后数值范围为 [4, 8),超出 MXFP4 的表示上限 6.0,导致大值截断引入量化误差。 - **修改目的:** 新增 ceil_x 量化方法,通过可配置除数 c + ceil 操作将 shared exponent 下移,使缩放后数值范围落入 MXFP4 可表示区间,减少截断误差。 - **修改内容:** **变化列表**: - core/算法:新增 MXWeightPerBlockCeilX 量化器,注册为 mxfp4_per_block_sym + ceil_x,支持 enable_search 模式在 [6.0, 12.0] 范围内搜索 MSE 最优除数 - core/算法:新增 ceil_x_qparam() 计算函数,公式 s = ceil(log2(max(|x|)/c + eps)) - emax - core/算法:新增 ceil_x_search_best() 步进搜索函数 - infra/配置:新增 CeilXExtConfig Pydantic 配置模型,含字段取值范围校验 - docs:新增 docs/zh/quantization_algorithms/ceil_x.md 算法说明文档 - [ ] **涉及代码双合**(关联 PR 链接):无 --- ## 3. 功能验证 > 冒烟由 CI 门禁检查,无需在此填写「冒烟是否通过」。 - [x] **功能自验** - [x] **本地自验用例截图**(请勿包含个人信息;可附复现命令) **复现步骤:** bash # UT 验证 pytest test/cases/quantizer/impl/test_ceil_x.py -v # 单元测试覆盖:配置解析、ceil_x_qparam 计算、_quantize 流程、enable_search 搜索、数值正确性 --- ## 4. 自检(请逐项确认,不适用标 N/A) **典型安全编码问题** - [x] **是否已校验外部数据** — CeilXExtConfig 各字段有 Field(ge/le/gt) 校验 + model_validator - [x] **是否未采集或打印敏感信息** - [x] **是否已正确设置文件权限** - [x] **是否充分考虑浮点运算溢出、除零等异常场景** — max_val/clamp 防护、search_step>0 校验 - [x] **是否已对正则表达式做 ReDos 检查** — N/A **DT** - [x] **是否具备 UT 测试用例看护**(路径:test/cases/quantizer/impl/test_ceil_x.py) - [x] **是否需要添加冒烟:** 是;ceil_x 算法说明文档已补充 See merge request: Ascend/msmodelslim!446 | 3 个月前 |
| 【doc】【issue】analysis doc fix Co-authored-by: xyxin_006<xyxin_hit@163.com> # message auto-generated for no-merge-commit merge: !502 merge analysis_doc_fix into master 【doc】【issue】analysis doc fix Created-by: xyxin_006 Commit-by: xyxin_006 Merged-by: ascend-robot Description: 感谢您贡献的Pull Request! 在提交之前,请务必阅读 [CONTRIBUTING.md](https://gitcode.com/Ascend/msmodelslim/blob/master/CONTRIBUTING.md)。 Thanks for sending a pull request! BEFORE SUBMITTING, PLEASE READ [CONTRIBUTING.md](https://gitcode.com/Ascend/msmodelslim/blob/master/CONTRIBUTING.md). ## PR描述 (What this PR does / why we need it?) - 请明确说明您提交PR的变更内容。本部分旨在概述所做的变更,以及此PR是如何解决该问题的。请尽可能地提供有助于评审人员更高效、更快速完成检视审查的实用说明。 - 请说明为何需要这些更改,例如具体的使用场景或bug描述。 - 关联issue号(如果有)。 - Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. If possible, please consider writing useful notes for better and faster reviews in your PR. - Please clarify why the changes are needed. For instance, the use case and bug description. - Related issue number (if any) ## 面向用户的变更 (Does this PR introduce _any_ user-facing change)? - 请注意,这里指的是**任何**面向用户的变更,包括但不限于API、用户界面或其他使用方式上的变更。 - Note that it means *any* user-facing change including all aspects such as API, interface or other behavior changes. ## 功能验证 (How was this patch tested?) 请确认CI已通过增量及存量的单元测试用例。 如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤(最好提供完整的可复现的操作路径及关键截图),以便Committer能够快速复现验证,也便于后续的维护。 如果未添加测试,请说明未添加的原因,以及为何难添加测试。 - [_] 功能自验 - [_] 本地自验截图(涉及个人标识符等敏感信息请注意脱敏) - [_] 新增/变更内容是否已新增/适配UT测试用例看护 CI passed with new added/existing test. If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future. If tests were not added, please describe why they were not added and/or why it was difficult to add. - [_] Self-verification of the feature. - [_] Screenshot of local self-verification (please anonymize any sensitive information such as personal identifiers) - [_] Have new or modified unit test (UT) cases been added or adapted to cover the newly added or changed content? See merge request: Ascend/msmodelslim!502 | 3 个月前 |
| 【feature】【doc】敏感层分析资料优化 Co-authored-by: xyxin_006<xyxin_hit@163.com> # message auto-generated for no-merge-commit merge: !383 merge doc/analysis_based_mse into master 【feature】【doc】敏感层分析资料优化 Created-by: xyxin_006 Commit-by: xyxin_006 Merged-by: ascend-robot Description: 感谢您贡献的Pull Request! 在提交之前,请务必阅读 [CONTRIBUTING.md](https://gitcode.com/Ascend/msmodelslim/blob/master/CONTRIBUTING.md)。 Thanks for sending a pull request! BEFORE SUBMITTING, PLEASE READ [CONTRIBUTING.md](https://gitcode.com/Ascend/msmodelslim/blob/master/CONTRIBUTING.md). ## PR描述 (What this PR does / why we need it?) - 请明确说明您提交PR的变更内容。本部分旨在概述所做的变更,以及此PR是如何解决该问题的。请尽可能地提供有助于评审人员更高效、更快速完成检视审查的实用说明。 - 请说明为何需要这些更改,例如具体的使用场景或bug描述。 - 关联issue号(如果有)。 - Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. If possible, please consider writing useful notes for better and faster reviews in your PR. - Please clarify why the changes are needed. For instance, the use case and bug description. - Related issue number (if any) ## 面向用户的变更 (Does this PR introduce _any_ user-facing change)? - 请注意,这里指的是**任何**面向用户的变更,包括但不限于API、用户界面或其他使用方式上的变更。 - Note that it means *any* user-facing change including all aspects such as API, interface or other behavior changes. ## 功能验证 (How was this patch tested?) 请确认CI已通过增量及存量的单元测试用例。 如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤(最好提供完整的可复现的操作路径及关键截图),以便Committer能够快速复现验证,也便于后续的维护。 如果未添加测试,请说明未添加的原因,以及为何难添加测试。 - [_] 功能自验 - [_] 本地自验截图(涉及个人标识符等敏感信息请注意脱敏) - [_] 新增/变更内容是否已新增/适配UT测试用例看护 CI passed with new added/existing test. If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future. If tests were not added, please describe why they were not added and/or why it was difficult to add. - [_] Self-verification of the feature. - [_] Screenshot of local self-verification (please anonymize any sensitive information such as personal identifiers) - [_] Have new or modified unit test (UT) cases been added or adapted to cover the newly added or changed content? See merge request: Ascend/msmodelslim!383 | 4 个月前 |