已合并
[Doc][master] 修改26.1.0下链接跳转到master的问题 #729
[Doc][master] 修改26.1.0下链接跳转到master的问题 #729
已合并
tanxiangyuu创建于 7月15日
16 个文件变更+73-73
@@ -18,14 +18,14 @@
18 18 
19- [good-first-issue](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%9C%80%E8%BF%91%E5%88%9B%E5%BB%BA%22%257D,%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:22797,%22name%22:%22good-first-issue%22%257D%255D,%22label%22:%22good-first-issue%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1)19- [good-first-issue](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%9C%80%E8%BF%91%E5%88%9B%E5%BB%BA%22%257D,%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:22797,%22name%22:%22good-first-issue%22%257D%255D,%22label%22:%22good-first-issue%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1)
20- [help-wanted](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%9C%80%E8%BF%91%E5%88%9B%E5%BB%BA%22%257D,%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:22796,%22name%22:%22help-wanted%22%257D%255D,%22label%22:%22help-wanted%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1)20- [help-wanted](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%9C%80%E8%BF%91%E5%88%9B%E5%BB%BA%22%257D,%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:22796,%22name%22:%22help-wanted%22%257D%255D,%22label%22:%22help-wanted%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1)
21-- 除了上述两个新手友好issue外,我们也提供了其他的[issue模板](https://gitcode.com/Ascend/msmodelslim/tree/master/.gitcode/ISSUE_TEMPLATE)来作为参考。21+- 除了上述两个新手友好issue外,我们也提供了其他的[issue模板](../../../.gitcode/ISSUE_TEMPLATE)来作为参考。
22- 此外,您也可以通过 [RFC](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%9C%80%E8%BF%91%E5%88%9B%E5%BB%BA%22%257D,%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:25328,%22name%22:%22rfc%22%257D%255D,%22label%22:%22rfc%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1) 和 [Roadmap](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:22807,%22name%22:%22roadmap%22%257D%255D,%22label%22:%22roadmap%22%257D,%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%8E%92%E5%BA%8F%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1)来了解开发计划与规划。22- 此外,您也可以通过 [RFC](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%9C%80%E8%BF%91%E5%88%9B%E5%BB%BA%22%257D,%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:25328,%22name%22:%22rfc%22%257D%255D,%22label%22:%22rfc%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1) 和 [Roadmap](https://gitcode.com/Ascend/msmodelslim/issues?categorysearch=%255B%257B%22field%22:%22labels%22,%22value%22:%255B%257B%22id%22:22807,%22name%22:%22roadmap%22%257D%255D,%22label%22:%22roadmap%22%257D,%257B%22field%22:%22order_by_sort%22,%22value%22:%22created_at_desc%22,%22label%22:%22%E6%8E%92%E5%BA%8F%22%257D%255D&state=all&order_by=created_at&sort=desc&scope=all&page=1)来了解开发计划与规划。
23 23 
24## 2. Pull Requests 与 Code Reviews24## 2. Pull Requests 与 Code Reviews
25 25 
26感谢您提交 PR!为优化审查流程,请遵循以下指南:26感谢您提交 PR!为优化审查流程,请遵循以下指南:
27 27 
28-遵循我们的 Pull Request [模板与规范](https://gitcode.com/Ascend/msmodelslim/blob/master/.gitcode/PULL_REQUEST_TEMPLATE.md)28+遵循我们的 Pull Request[模板与规范](../../../.gitcode/PULL_REQUEST_TEMPLATE.md)》。
29 29 
30参考开发者文档 《[LLM 大模型接入指南](../development_guide/integrating_models.md)》。30参考开发者文档 《[LLM 大模型接入指南](../development_guide/integrating_models.md)》。
31 31 
@@ -18,7 +18,7 @@ flowchart LR
18 18 
19## IFormat 协议接口19## IFormat 协议接口
20 20 
21-定义于 [`msmodelslim/format/interface.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/interface.py):21+定义于 [`msmodelslim/format/interface.py`](../../../msmodelslim/format/interface.py):
22 22 
23| 方法 | 是否必须实现 | 职责 |23| 方法 | 是否必须实现 | 职责 |
24|------|-------------|------|24|------|-------------|------|
@@ -38,7 +38,7 @@ flowchart LR
38 38 
39### QuantFormatBase(推荐基类)39### QuantFormatBase(推荐基类)
40 40 
41-继承 [`QuantFormatBase`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/base.py) 可自动获得:41+继承 [`QuantFormatBase`](../../../msmodelslim/format/base.py) 可自动获得:
42 42 
43- 模块树遍历(`named_modules` + `processed_modules` 去重)43- 模块树遍历(`named_modules` + `processed_modules` 去重)
44- `WrapperIR` 原子/非原子处理44- `WrapperIR` 原子/非原子处理
@@ -75,7 +75,7 @@ class MyQuantFormatConfig(QuantFormatConfig):
75 part_file_size: int = 475 part_file_size: int = 4
76```76```
77 77 
78-参考:[`CompressedTensorsQuantFormatConfig`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/compressed_tensors_format/compressed_tensors.py)78+参考:[`CompressedTensorsQuantFormatConfig`](../../../msmodelslim/format/compressed_tensors_format/compressed_tensors.py)
79 79 
80### 步骤 2:实现 IFormat 子类80### 步骤 2:实现 IFormat 子类
81 81 
@@ -125,11 +125,11 @@ class MyQuantFormat(QuantFormatBase):
125 self.safetensors_writer.write(name, param.detach())125 self.safetensors_writer.write(name, param.detach())
126```126```
127 127 
128-参考:[`CompressedTensorsQuantFormat`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/compressed_tensors_format/compressed_tensors.py)128+参考:[`CompressedTensorsQuantFormat`](../../../msmodelslim/format/compressed_tensors_format/compressed_tensors.py)
129 129 
130### 步骤 3:注册格式绑定130### 步骤 3:注册格式绑定
131 131 
132-在 [`msmodelslim/format/registry.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/registry.py) 中注册:132+在 [`msmodelslim/format/registry.py`](../../../msmodelslim/format/registry.py) 中注册:
133 133 
134```python134```python
135class QuantFormatFactory:135class QuantFormatFactory:
@@ -148,7 +148,7 @@ register_quant_format(MyQuantFormatConfig, MyQuantFormat)
148 148 
149### 步骤 4:加入 YAML 联合类型149### 步骤 4:加入 YAML 联合类型
150 150 
151-在 [`QuantFormatConfigUnion`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/registry.py) 中加入新 Config 类,使 Pydantic 能按 `type` 字段反序列化:151+在 [`QuantFormatConfigUnion`](../../../msmodelslim/format/registry.py) 中加入新 Config 类,使 Pydantic 能按 `type` 字段反序列化:
152 152 
153```python153```python
154QuantFormatConfigUnion = Annotated[154QuantFormatConfigUnion = Annotated[
@@ -206,7 +206,7 @@ def build_module_handler_map(self):
206 206 
207## 测试与验证207## 测试与验证
208 208 
209-参考 [`test/cases/format/compressed_tensors_format/`](https://gitcode.com/Ascend/msmodelslim/tree/master/test/cases/format/compressed_tensors_format/):209+参考 [`test/cases/format/compressed_tensors_format/`](../../../test/cases/format/compressed_tensors_format):
210 210 
2111. 实现 `MockSafetensorsWriter` 内存 writer2111. 实现 `MockSafetensorsWriter` 内存 writer
2122. 构造最小 QIR 模型(W8A8 Static / Dynamic)2122. 构造最小 QIR 模型(W8A8 Static / Dynamic)
@@ -217,12 +217,12 @@ def build_module_handler_map(self):
217 217 
218| 组件 | 路径 |218| 组件 | 路径 |
219|------|------|219|------|------|
220-| IFormat 协议 | [`msmodelslim/format/interface.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/interface.py) |220+| IFormat 协议 | [`msmodelslim/format/interface.py`](../../../msmodelslim/format/interface.py) |
221-| QuantFormatBase | [`msmodelslim/format/base.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/base.py) |221+| QuantFormatBase | [`msmodelslim/format/base.py`](../../../msmodelslim/format/base.py) |
222-| 注册表 | [`msmodelslim/format/registry.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/format/registry.py) |222+| 注册表 | [`msmodelslim/format/registry.py`](../../../msmodelslim/format/registry.py) |
223-| 保存处理器 | [`msmodelslim/processor/save/processor.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/processor/save/processor.py) |223+| 保存处理器 | [`msmodelslim/processor/save/processor.py`](../../../msmodelslim/processor/save/processor.py) |
224-| compressed-tensors 实现 | [`msmodelslim/format/compressed_tensors_format/`](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/format/compressed_tensors_format) |224+| compressed-tensors 实现 | [`msmodelslim/format/compressed_tensors_format/`](../../../msmodelslim/format/compressed_tensors_format) |
225-| 单元测试 | [`test/cases/format/compressed_tensors_format/`](https://gitcode.com/Ascend/msmodelslim/tree/master/test/cases/format/compressed_tensors_format) |225+| 单元测试 | [`test/cases/format/compressed_tensors_format/`](../../../test/cases/format/compressed_tensors_format) |
226 226 
227## 相关文档227## 相关文档
228 228 
@@ -13,7 +13,7 @@ msModelSlim认识到量化机制和算法都有适用范围和局限性,而新
13 13 
14* 接口在量化机制和算法等组件中定义,描述了对应组件对模型的诉求,接口定义和使用请参考对应组件的文档和代码14* 接口在量化机制和算法等组件中定义,描述了对应组件对模型的诉求,接口定义和使用请参考对应组件的文档和代码
15* 仅当使用到对应组件时才需要实现对应接口15* 仅当使用到对应组件时才需要实现对应接口
16-* 接口汇总:[`msmodelslim/model/interface_hub.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/interface_hub.py)16+* 接口汇总:[`msmodelslim/model/interface_hub.py`](../../../msmodelslim/model/interface_hub.py)
17 17 
18### 模型适配器18### 模型适配器
19 19 
@@ -23,15 +23,15 @@ msModelSlim认识到量化机制和算法都有适用范围和局限性,而新
23 23 
24## 模型接入24## 模型接入
25 25 
26-以下内容将以 [`Qwen3-32B`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3/model_adapter.py) W8A8动态量化场景(简称“场景示例”)的模型接入为例:26+以下内容将以 [`Qwen3-32B`](../../../msmodelslim/model/qwen3/model_adapter.py) W8A8动态量化场景(简称“场景示例”)的模型接入为例:
27 27 
28### 新建模型适配器`py`文件28### 新建模型适配器`py`文件
29 29 
30-建议放在[`msmodelslim/model/`](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/model) 下,命名如 `qwen3.py`。30+建议放在[`msmodelslim/model/`](../../../msmodelslim/model) 下,命名如 `qwen3.py`。
31 31 
32### 理清量化过程涉及的组件,以组件接口组合定义适配器类32### 理清量化过程涉及的组件,以组件接口组合定义适配器类
33 33 
34-模型适配器类必须继承自[`BaseModelAdapter`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/base.py)。34+模型适配器类必须继承自[`BaseModelAdapter`](../../../msmodelslim/model/base.py)。
35 35 
36根据经验,W8A8动态量化的精度损失很小,无需搭配离群值抑制算法,也很少需要回退;因此,在场景示例中,我们仅需支持量化调度,无需支持离群值量化、敏感层分析等额外功能。需要接入其他算法可以参考《[`算法总览`](../user_guide/quantization_algorithms/README.md)》。36根据经验,W8A8动态量化的精度损失很小,无需搭配离群值抑制算法,也很少需要回退;因此,在场景示例中,我们仅需支持量化调度,无需支持离群值量化、敏感层分析等额外功能。需要接入其他算法可以参考《[`算法总览`](../user_guide/quantization_algorithms/README.md)》。
37 37 
@@ -90,7 +90,7 @@ class Qwen3ModelAdapter(TransformersModel,
90 90 
91### 注册模型91### 注册模型
92 92 
93-在配置文件 [`config.ini`](https://gitcode.com/Ascend/msmodelslim/blob/master/config/config.ini) 中注册模型名称,便于同一系列的模型复用一个模型适配器。93+在配置文件 [`config.ini`](../../../config/config.ini) 中注册模型名称,便于同一系列的模型复用一个模型适配器。
94 94 
95```ini95```ini
96# 在ModelAdapter中的qwen3系列注册Qwen3-32B模型,qwen3对应下面的Qwen3ModelAdapter模型适配器96# 在ModelAdapter中的qwen3系列注册Qwen3-32B模型,qwen3对应下面的Qwen3ModelAdapter模型适配器
@@ -1069,7 +1069,7 @@ class Wan2_2BaseModelAdapter(
1069 sub.bind_module(module)1069 sub.bind_module(module)
1070 adapters[expert_name] = sub1070 adapters[expert_name] = sub
1071 self._expert_adapters = adapters1071 self._expert_adapters = adapters
1072- 1072+ 
1073 def _create_expert_sub_adapter(self, expert_name: str) -> Wan2_2ExpertSubAdapter:1073 def _create_expert_sub_adapter(self, expert_name: str) -> Wan2_2ExpertSubAdapter:
1074 """1074 """
1075 工厂方法:按 expert_name 返回子适配器实例。1075 工厂方法:按 expert_name 返回子适配器实例。
@@ -1230,7 +1230,7 @@ class Wan2_2BaseModelAdapter(
1230 1230 
1231### 注册模型名1231### 注册模型名
1232 1232 
1233-在 [`config/config.ini`](https://gitcode.com/Ascend/msmodelslim/blob/master/config/config.ini) 中注册模型。多模态生成建议 **按场景拆分为独立 `model_type`**,与适配器子类的 `scene_task` 一一对应,**不要**在 YAML 里用 `task` 切换 T2V / I2V / TI2V。1233+在 [`config/config.ini`](../../../config/config.ini) 中注册模型。多模态生成建议 **按场景拆分为独立 `model_type`**,与适配器子类的 `scene_task` 一一对应,**不要**在 YAML 里用 `task` 切换 T2V / I2V / TI2V。
1234 1234 
1235```ini1235```ini
1236[ModelAdapter]1236[ModelAdapter]
@@ -1262,7 +1262,7 @@ hunyuan_video = msmodelslim.model.hunyuan_video.loader:HunyuanVideoAdapterLoader
1262 1262 
1263校准数据由 YAML 的 `dataset` 字段指定,可写为:1263校准数据由 YAML 的 `dataset` 字段指定,可写为:
1264 1264 
1265-- **短名称**:在 [`lab_calib`](https://gitcode.com/Ascend/msmodelslim/tree/master/lab_calib) 下查找对应目录或文件;1265+- **短名称**:在 [`lab_calib`](../../../lab_calib) 下查找对应目录或文件;
1266- **绝对路径 / 相对路径**:指向自定义校准集。1266- **绝对路径 / 相对路径**:指向自定义校准集。
1267 1267 
1268多模态生成复用 `VlmCalibSample` 加载逻辑,常见为 **`index.json` / `index.jsonl`**,每条样本至少包含非空 **`text`**(Prompt)。字段约定与理解模型类似,详见[一键量化使用说明 — dataset 校准数据路径配置](../user_guide/feature_guide/quick_quantization_v1/usage.md#dataset---校准数据路径配置)。1268多模态生成复用 `VlmCalibSample` 加载逻辑,常见为 **`index.json` / `index.jsonl`**,每条样本至少包含非空 **`text`**(Prompt)。字段约定与理解模型类似,详见[一键量化使用说明 — dataset 校准数据路径配置](../user_guide/feature_guide/quick_quantization_v1/usage.md#dataset---校准数据路径配置)。
@@ -1285,7 +1285,7 @@ dataset: wan2_2_t2v # 对应 lab_calib 下的校准集短名称
1285 1285 
1286### 准备量化配置1286### 准备量化配置
1287 1287 
1288-创建量化配置文件(YAML)。Wan2.2 T2V 官方示例见 [`wan2_2_w8a8f8_mxfp_t2v.yaml`](https://gitcode.com/Ascend/msmodelslim/blob/master/lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_t2v.yaml);HunyuanVideo 可参考 [`hunyuan_video_w8a8f8_mxfp.yaml`](https://gitcode.com/Ascend/msmodelslim/blob/master/lab_practice/hunyuan_video/hunyuan_video_w8a8f8_mxfp.yaml)。1288+创建量化配置文件(YAML)。Wan2.2 T2V 官方示例见 [`wan2_2_w8a8f8_mxfp_t2v.yaml`](../../../lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_t2v.yaml);HunyuanVideo 可参考 [`hunyuan_video_w8a8f8_mxfp.yaml`](../../../lab_practice/hunyuan_video/hunyuan_video_w8a8f8_mxfp.yaml)。
1289 1289 
1290```yaml1290```yaml
1291# 量化配置(Wan2.2-T2V-A14B,W8A8 MXFP8 + QuaRot + FA3)1291# 量化配置(Wan2.2-T2V-A14B,W8A8 MXFP8 + QuaRot + FA3)
@@ -1361,7 +1361,7 @@ spec:
1361| `save` | 多模态生成默认 `mindie_format_saver`,输出 MindIE-SD 格式 |1361| `save` | 多模态生成默认 `mindie_format_saver`,输出 MindIE-SD 格式 |
1362| `multimodal_sd_config.inference_config` | **推理参数桥接**(Pydantic 校验),字段须与原 Wan2.2 推理仓 CLI 一致;`task` 须与当前 `model_type` 对应(T2V 为 `t2v-A14B`) |1362| `multimodal_sd_config.inference_config` | **推理参数桥接**(Pydantic 校验),字段须与原 Wan2.2 推理仓 CLI 一致;`task` 须与当前 `model_type` 对应(T2V 为 `t2v-A14B`) |
1363 1363 
1364-`process`、`save`、`multimodal_sd_config` 的完整说明见 [multimodal_sd_modelslim_v1 配置详解](../user_guide/feature_guide/quick_quantization_v1/usage.md#53-multimodal_sd_modelslim_v1-配置详解)。I2V / TI2V 请改用 [`wan2_2_w8a8f8_mxfp_i2v.yaml`](https://gitcode.com/Ascend/msmodelslim/blob/master/lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_i2v.yaml)、[`wan2_2_w8a8f8_mxfp_ti2v.yaml`](https://gitcode.com/Ascend/msmodelslim/blob/master/lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_ti2v.yaml),并匹配对应的 `model_type` 与 `dataset`。1364+`process`、`save`、`multimodal_sd_config` 的完整说明见 [multimodal_sd_modelslim_v1 配置详解](../user_guide/feature_guide/quick_quantization_v1/usage.md#63-multimodal_sd_modelslim_v1-配置详解)。I2V / TI2V 请改用 [`wan2_2_w8a8f8_mxfp_i2v.yaml`](../../../lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_i2v.yaml)、[`wan2_2_w8a8f8_mxfp_ti2v.yaml`](../../../lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_ti2v.yaml),并匹配对应的 `model_type` 与 `dataset`。
1365 1365 
1366### 执行量化1366### 执行量化
1367 1367 
@@ -1391,7 +1391,7 @@ msmodelslim quant \
1391 1391 
1392请注意`trust_remote_code``True`时可能执行浮点模型权重中的代码文件,请确保浮点模型来源安全可靠。其中 `${MODEL_PATH}` 为原始浮点权重路径,`${SAVE_PATH}` 为用户自定义的量化权重保存路径,model_type对应配置为注册的模型名称,`${CONFIG_PATH}` 为YAML配置文件路径。1392请注意`trust_remote_code``True`时可能执行浮点模型权重中的代码文件,请确保浮点模型来源安全可靠。其中 `${MODEL_PATH}` 为原始浮点权重路径,`${SAVE_PATH}` 为用户自定义的量化权重保存路径,model_type对应配置为注册的模型名称,`${CONFIG_PATH}` 为YAML配置文件路径。
1393 1393 
1394-- 更多命令示例见《[Wan2.2 量化使用说明](https://gitcode.com/Ascend/msmodelslim/blob/master/example/multimodal_sd/Wan2_2/README.md)》。1394+- 更多命令示例见《[Wan2.2 量化使用说明](../../../example/multimodal_sd/Wan2_2/README.md)》。
1395 1395 
1396## 常见问题与排障1396## 常见问题与排障
1397 1397 
@@ -1444,9 +1444,9 @@ msmodelslim quant \
1444 1444 
1445## 参考实现1445## 参考实现
1446 1446 
1447-- **多模态生成量化服务**:[quant_service.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quant_service/multimodal_sd_v1/quant_service.py)1447+- **多模态生成量化服务**:[quant_service.py](../../../msmodelslim/core/quant_service/multimodal_sd_v1/quant_service.py)
1448-- **Pipeline 接口**:[pipeline_interface.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quant_service/multimodal_sd_v1/pipeline_interface.py)、[legacy_pipeline_interface.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quant_service/multimodal_sd_v1/legacy_pipeline_interface.py)1448+- **Pipeline 接口**:[pipeline_interface.py](../../../msmodelslim/core/quant_service/multimodal_sd_v1/pipeline_interface.py)、[legacy_pipeline_interface.py](../../../msmodelslim/core/quant_service/multimodal_sd_v1/legacy_pipeline_interface.py)
1449-- **配置校验**:[quant_config.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quant_service/multimodal_sd_v1/quant_config.py)(`validate_inference_config`、`resolve_inference_raw`)1449+- **配置校验**:[quant_config.py](../../../msmodelslim/core/quant_service/multimodal_sd_v1/quant_config.py)(`validate_inference_config`、`resolve_inference_raw`)
1450-- **单网络 DiT**:[msmodelslim/model/hunyuan_video](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/model/hunyuan_video)1450+- **单网络 DiT**:[msmodelslim/model/hunyuan_video](../../../msmodelslim/model/hunyuan_video)
1451-- **双专家 DiT**:[msmodelslim/model/wan2_2](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/model/wan2_2)1451+- **双专家 DiT**:[msmodelslim/model/wan2_2](../../../msmodelslim/model/wan2_2)
1452-- **YAML 示例**:[hunyuan_video_w8a8f8_mxfp.yaml](https://gitcode.com/Ascend/msmodelslim/blob/master/lab_practice/hunyuan_video/hunyuan_video_w8a8f8_mxfp.yaml)、[wan2_2_w8a8f8_mxfp_t2v.yaml](https://gitcode.com/Ascend/msmodelslim/blob/master/lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_t2v.yaml)1452+- **YAML 示例**:[hunyuan_video_w8a8f8_mxfp.yaml](../../../lab_practice/hunyuan_video/hunyuan_video_w8a8f8_mxfp.yaml)、[wan2_2_w8a8f8_mxfp_t2v.yaml](../../../lab_practice/wan2_2/wan2_2_w8a8f8_mxfp_t2v.yaml)
@@ -50,7 +50,7 @@ flowchart TD
50 50 
51## 多模态模型接入51## 多模态模型接入
52 52 
53-以下内容将以 [Qwen3-VL-MoE](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3_vl_moe/model_adapter.py)(MoE: Mixture of Experts,混合专家架构)W8A8混合量化场景(简称"场景示例")的模型接入为例。53+以下内容将以 [Qwen3-VL-MoE](../../../msmodelslim/model/qwen3_vl_moe/model_adapter.py)(MoE: Mixture of Experts,混合专家架构)W8A8混合量化场景(简称"场景示例")的模型接入为例。
54 54 
55**Qwen3-VL-MoE的加载策略**55**Qwen3-VL-MoE的加载策略**
56 56 
@@ -61,11 +61,11 @@ flowchart TD
61 61 
62### 新建模型适配器目录和文件62### 新建模型适配器目录和文件
63 63 
64-建议在 [`msmodelslim/model/`](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/model) 下创建独立目录,如 `qwen3_vl_moe/`,包含以下文件:64+建议在 [`msmodelslim/model/`](../../../msmodelslim/model) 下创建独立目录,如 `qwen3_vl_moe/`,包含以下文件:
65 65 
66-- [`model_adapter.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3_vl_moe/model_adapter.py):模型适配器主文件66+- [`model_adapter.py`](../../../msmodelslim/model/qwen3_vl_moe/model_adapter.py):模型适配器主文件
67-- [`__init__.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3_vl_moe/__init__.py):导出适配器类67+- [`__init__.py`](../../../msmodelslim/model/qwen3_vl_moe/__init__.py):导出适配器类
68-- [`moe_utils.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3_vl_moe/moe_utils.py)(可选):MoE融合权重等特殊结构的辅助转换工具68+- [`moe_utils.py`](../../../msmodelslim/model/qwen3_vl_moe/moe_utils.py)(可选):MoE融合权重等特殊结构的辅助转换工具
69 69 
70### 定义适配器类并继承必要接口70### 定义适配器类并继承必要接口
71 71 
@@ -92,7 +92,7 @@ class Qwen3VLMoeModelAdapter(VlmBaseModelAdapter, # 提供多模态通用能力
92 92 
93#### `handle_dataset`:处理多模态校准数据93#### `handle_dataset`:处理多模态校准数据
94 94 
95-将校准数据(`VlmCalibSample`)转换为多模态理解模型支持的输入,`VlmCalibSample`的定义可参考[`vlm_dataset_loader.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/infra/dataset_loader/vlm_dataset_loader.py):95+将校准数据(`VlmCalibSample`)转换为多模态理解模型支持的输入,`VlmCalibSample`的定义可参考[`vlm_dataset_loader.py`](../../../msmodelslim/infra/dataset_loader/vlm_dataset_loader.py):
96 96 
97**关键点**97**关键点**
98 98 
@@ -180,7 +180,7 @@ def handle_dataset(self, dataset: Any, device: DeviceType = DeviceType.NPU) -> L
180- 通过临时设置 `num_hidden_layers=1` 来控制仅加载一个语言部分解码层180- 通过临时设置 `num_hidden_layers=1` 来控制仅加载一个语言部分解码层
181- 视觉部分会被完整加载(所有blocks、patch_embed、merger、deepstack_merger_list等)181- 视觉部分会被完整加载(所有blocks、patch_embed、merger、deepstack_merger_list等)
182- 使用 `from_pretrained` 而非手动加载权重,更简洁可靠182- 使用 `from_pretrained` 而非手动加载权重,更简洁可靠
183-- 如果首层是MoE层,需要进行3D权重转换(参考 [`moe_utils.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3_vl_moe/moe_utils.py))183+- 如果首层是MoE层,需要进行3D权重转换(参考 [`moe_utils.py`](../../../msmodelslim/model/qwen3_vl_moe/moe_utils.py))
184 184 
185```python185```python
186def init_model(self, device: DeviceType = DeviceType.NPU) -> nn.Module:186def init_model(self, device: DeviceType = DeviceType.NPU) -> nn.Module:
@@ -456,7 +456,7 @@ def generate_model_forward(self, model: nn.Module, inputs: Any) -> Generator[Pro
456 456 
457### 注册模型名457### 注册模型名
458 458 
459-在 [`config/config.ini`](https://gitcode.com/Ascend/msmodelslim/blob/master/config/config.ini) 中注册模型:459+在 [`config/config.ini`](../../../config/config.ini) 中注册模型:
460 460 
461```ini461```ini
462[ModelAdapter]462[ModelAdapter]
@@ -474,7 +474,7 @@ qwen3_vl_moe = msmodelslim.model.qwen3_vl_moe.model_adapter:Qwen3VLMoeModelAdapt
474 474 
475### 准备量化配置475### 准备量化配置
476 476 
477-创建量化配置文件(YAML),例如 [`qwen3_vl_moe_w8a8.yaml`](https://gitcode.com/Ascend/msmodelslim/blob/master/lab_practice/qwen3_vl_moe/qwen3_vl_moe_w8a8.yaml):477+创建量化配置文件(YAML),例如 [`qwen3_vl_moe_w8a8.yaml`](../../../lab_practice/qwen3_vl_moe/qwen3_vl_moe_w8a8.yaml):
478 478 
479```yaml479```yaml
480apiversion: multimodal_vlm_modelslim_v1480apiversion: multimodal_vlm_modelslim_v1
@@ -579,7 +579,7 @@ msmodelslim quant --model_path ${MODEL_PATH} \
579**解决**579**解决**
580 580 
581- 参考[辅助方法动态加载语言部分的权重](#辅助方法动态加载语言部分的权重)中 `_convert_single_moe_layer` 方法,实现3D权重切分为多个Linear层581- 参考[辅助方法动态加载语言部分的权重](#辅助方法动态加载语言部分的权重)中 `_convert_single_moe_layer` 方法,实现3D权重切分为多个Linear层
582-- 参考 [`moe_utils.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3_vl_moe/moe_utils.py) 的等价替换底层逻辑实现582+- 参考 [`moe_utils.py`](../../../msmodelslim/model/qwen3_vl_moe/moe_utils.py) 的等价替换底层逻辑实现
583 583 
584### 校准数据格式错误584### 校准数据格式错误
585 585 
@@ -686,8 +686,8 @@ class Qwen3VLMoeModelAdapter(VlmBaseModelAdapter,
686### 参考资料686### 参考资料
687 687 
688- [模型接入指南](integrating_models.md):大模型基础接入指导688- [模型接入指南](integrating_models.md):大模型基础接入指导
689-- [Qwen2.5-Omni模型适配器](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen2_5_omni_thinker/model_adapter.py):端到端多模态(文本/图像/音频/视频)适配示例689+- [Qwen2.5-Omni模型适配器](../../../msmodelslim/model/qwen2_5_omni_thinker/model_adapter.py):端到端多模态(文本/图像/音频/视频)适配示例
690-- [Qwen3-VL-MoE模型适配器](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3_vl_moe/model_adapter.py):完整实现示例690+- [Qwen3-VL-MoE模型适配器](../../../msmodelslim/model/qwen3_vl_moe/model_adapter.py):完整实现示例
691-- [VLM数据集加载器](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/infra/dataset_loader/vlm_dataset_loader.py)与[dataset_loader](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/infra/dataset_loader/):校准数据加载处理691+- [VLM数据集加载器](../../../msmodelslim/infra/dataset_loader/vlm_dataset_loader.py)与[dataset_loader](../../../msmodelslim/infra/dataset_loader):校准数据加载处理
692-- [多模态VLM量化服务](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/core/quant_service/multimodal_vlm_v1):服务层实现692+- [多模态VLM量化服务](../../../msmodelslim/core/quant_service/multimodal_vlm_v1):服务层实现
693- [一键量化使用说明](../user_guide/feature_guide/quick_quantization_v1/usage.md):命令行参数详解693- [一键量化使用说明](../user_guide/feature_guide/quick_quantization_v1/usage.md):命令行参数详解
@@ -14,9 +14,9 @@
14 14 
15| msModelSlim版本 | CANN版本 | PyTorch版本 | TorchNPU版本 | Python版本 | Transformers版本 |15| msModelSlim版本 | CANN版本 | PyTorch版本 | TorchNPU版本 | Python版本 | Transformers版本 |
16|---------------|--------|-------------------|----------------|------------------|----------------|16|---------------|--------|-------------------|----------------|------------------|----------------|
17-| 26.0.0.alpha02 | 不依赖特定版本 | 与具体模型有关,请参考相关模型资料 | 与具体模型有关,请参考相关模型资料 | Python 3.10、3.11 | 与具体模型有关,请参考[example](https://gitcode.com/Ascend/msmodelslim/tree/master/example)目录下对应模型的案例说明 |17+| 26.0.0.alpha02 | 不依赖特定版本 | 与具体模型有关,请参考相关模型资料 | 与具体模型有关,请参考相关模型资料 | Python 3.10、3.11 | 与具体模型有关,请参考[example](../../../example)目录下对应模型的案例说明 |
18-| 26.0.0.alpha01 | 不依赖特定版本 | 与具体模型有关,请参考相关模型资料 | 与具体模型有关,请参考相关模型资料 | Python 3.10、3.11 | 与具体模型有关,请参考[example](https://gitcode.com/Ascend/msmodelslim/tree/master/example)目录下对应模型的案例说明 |18+| 26.0.0.alpha01 | 不依赖特定版本 | 与具体模型有关,请参考相关模型资料 | 与具体模型有关,请参考相关模型资料 | Python 3.10、3.11 | 与具体模型有关,请参考[example](../../../example)目录下对应模型的案例说明 |
19-| 8.3.0 | 8.2.RC1及以上版本 | 与具体模型有关,请参考相关模型资料 | 与具体模型有关,请参考相关模型资料 | Python 3.10、3.11 | 与具体模型有关,请参考[example](https://gitcode.com/Ascend/msmodelslim/tree/master/example)目录下对应模型的案例说明 |19+| 8.3.0 | 8.2.RC1及以上版本 | 与具体模型有关,请参考相关模型资料 | 与具体模型有关,请参考相关模型资料 | Python 3.10、3.11 | 与具体模型有关,请参考[example](../../../example)目录下对应模型的案例说明 |
20 20 
21### whl包获取21### whl包获取
22 22 
@@ -63,9 +63,9 @@ toc_depth: 3
63**重要提示**:在使用自动调优功能之前,请确保使用的模型是支持的。需要同时满足以下条件:63**重要提示**:在使用自动调优功能之前,请确保使用的模型是支持的。需要同时满足以下条件:
64 64 
651. **模型类型限制**:当前自动调优服务仅支持**大语言模型(LLM)**,且对 **MoE** 模型支持有限(MoE 通常包含大量专家非共享子层,回退/搜索空间更大,导致迭代优化轮次更多,整体调优耗时更长)。651. **模型类型限制**:当前自动调优服务仅支持**大语言模型(LLM)**,且对 **MoE** 模型支持有限(MoE 通常包含大量专家非共享子层,回退/搜索空间更大,导致迭代优化轮次更多,整体调优耗时更长)。
66-2. **量化工具支持**:模型需要在量化工具的支持列表中,可以通过查看 [config/config.ini](https://gitcode.com/Ascend/msmodelslim/blob/master/config/config.ini) 中的 `[ModelAdapter]` 确定模型是否支持,其中包含了当前支持的模型适配器及其支持的模型名。如果模型不在支持列表中,需要先进行模型适配,实现相应的模型接口后才能使用自动调优功能。模型适配说明可参考 《[LLM 大模型接入指南](../../../development_guide/integrating_models.md)》。66+2. **量化工具支持**:模型需要在量化工具的支持列表中,可以通过查看 [config/config.ini](../../../../../config/config.ini) 中的 `[ModelAdapter]` 确定模型是否支持,其中包含了当前支持的模型适配器及其支持的模型名。如果模型不在支持列表中,需要先进行模型适配,实现相应的模型接口后才能使用自动调优功能。模型适配说明可参考 《[LLM 大模型接入指南](../../../development_guide/integrating_models.md)》。
673. **vLLM-Ascend 支持**:模型需要被 vLLM-Ascend 支持,能够将量化后的模型以服务化方式启动。请先确定 vLLM-Ascend 是否支持量化后模型服务化启动。673. **vLLM-Ascend 支持**:模型需要被 vLLM-Ascend 支持,能够将量化后的模型以服务化方式启动。请先确定 vLLM-Ascend 是否支持量化后模型服务化启动。
68-4. **transformers 版本兼容**:量化工具与推理引擎(vLLM-Ascend)对 `transformers` 的版本有各自的要求,需确保当前环境中的版本能同时满足二者。若某一模型在使用的过程中,量化工具与推理引擎所需的 `transformers` 版本不一致,且**不存在一个 transformers 版本能同时满足两边要求**,则无法在该环境下启动自动调优服务。使用前,请参照双方依赖说明确认当前环境中的 `transformers` 版本兼容:**量化工具侧**各模型对 transformers 等依赖的版本要求见 [config/config.ini](https://gitcode.com/Ascend/msmodelslim/blob/master/config/config.ini) 中的 `[ModelAdapterDependencies]` 配置项;**推理引擎侧**各版本 vLLM-Ascend 的依赖要求见 [vLLM-Ascend 发布说明](https://docs.vllm.ai/projects/vllm-ascend-cn/zh-cn/latest/user_guide/release_notes.html#id5) 中各版本的 Dependencies 小节。68+4. **transformers 版本兼容**:量化工具与推理引擎(vLLM-Ascend)对 `transformers` 的版本有各自的要求,需确保当前环境中的版本能同时满足二者。若某一模型在使用的过程中,量化工具与推理引擎所需的 `transformers` 版本不一致,且**不存在一个 transformers 版本能同时满足两边要求**,则无法在该环境下启动自动调优服务。使用前,请参照双方依赖说明确认当前环境中的 `transformers` 版本兼容:**量化工具侧**各模型对 transformers 等依赖的版本要求见 [config/config.ini](../../../../../config/config.ini) 中的 `[ModelAdapterDependencies]` 配置项;**推理引擎侧**各版本 vLLM-Ascend 的依赖要求见 [vLLM-Ascend 发布说明](https://docs.vllm.ai/projects/vllm-ascend-cn/zh-cn/latest/user_guide/release_notes.html#id5) 中各版本的 Dependencies 小节。
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件 docs/zh/user_guide/feature_guide/auto_precision_tuning/usage.md 的目录深度为 5(docs/zh/user_guide/feature_guide/auto_precision_tuning/),到达仓库根目录需要 ../../../../..(5 个 ..)。但第 66 行和第 68 行的 config/config.ini 链接使用了 ../../../../../config/config.ini(6 个 ..),多了一层,导致:

  • 在 GitCode/GitHub 等平台上浏览时链接跳转到 404;
  • 本地文件浏览时可能跳转到仓库上级目录。

触发条件:用户点击该文档中指向 config/config.ini 的链接时必然触发。

  • 第 68 行:../../../../../config/config.ini../../../../..config/config.ini

(注意:第 66 行中已有的 ../../../development_guide/integrating_models.md(3 个 ..)未在本次 diff 中修改,且其路径是正确指向 docs/zh/development_guide/ 的相对路径,无需修改。)

建议:将所有指向仓库根目录的相对路径从 6 层 .. 改为 5 层 ..。第 66 行:../../../../../config/config.ini../../../../..config/config.ini;第 68 行同理。

likedislike
695. **单机服务化**:当前自动调优服务不支持跨机部署。对于需要跨机才能完成服务化启动的超大规模模型,暂时无法使用自动调优功能。695. **单机服务化**:当前自动调优服务不支持跨机部署。对于需要跨机才能完成服务化启动的超大规模模型,暂时无法使用自动调优功能。
70 70 
71### 3.3 命令格式71### 3.3 命令格式
@@ -49,7 +49,7 @@ model = AutoModelForCausalLM.from_pretrained(
49 49 
50### 1.5 使用样例50### 1.5 使用样例
51 51 
52-[Deepseek w8a8量化示例](https://gitcode.com/Ascend/msmodelslim/blob/master/example/DeepSeek/README.md)52+[Deepseek w8a8量化示例](../../../../../example/DeepSeek/README.md)
53 53 
54## 2. 混合校准数据集使用方法说明54## 2. 混合校准数据集使用方法说明
55 55 
@@ -590,8 +590,8 @@ from transformers.models.qwen2.configuration_qwen2 import Qwen2Config
590 590 
591| 脚本文件 | 参考资料 |591| 脚本文件 | 参考资料 |
592| ------------------------------------------------- | ------------------------------------------------------------ |592| ------------------------------------------------- | ------------------------------------------------------------ |
593-| [quant_qwen.py](https://gitcode.com/Ascend/msmodelslim/blob/master/example/Qwen/quant_qwen.py) | [Qwen2.5-72B 支持Attention量化](https://gitcode.com/Ascend/msmodelslim/blob/master/example/Qwen/README.md#qwen25-72b-支持attention量化) |593+| [quant_qwen.py](../../../../../example/Qwen/quant_qwen.py) | [Qwen2.5-72B 支持Attention量化](../../../../../example/Qwen/README.md#qwen25-72b-支持attention量化) |
594-| [quant_llama.py](https://gitcode.com/Ascend/msmodelslim/blob/master/example/Llama/quant_llama.py) | [Llama3.1-70B W8A8量化搭配Attention量化](https://gitcode.com/Ascend/msmodelslim/blob/master/example/Llama/README.md#llama31-70b-w8a8量化搭配attention量化) |594+| [quant_llama.py](../../../../../example/Llama/quant_llama.py) | [Llama3.1-70B W8A8量化搭配Attention量化](../../../../../example/Llama/README.md#llama31-70b-w8a8量化搭配attention量化) |
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件 docs/zh/user_guide/feature_guide/traditional_quantization_v0/foundation_model_quantization_and_calibration.md 目录深度为 5,需 5 个 .. 到达根目录。但本次 diff 中以下 5 个链接均使用了 6 个 ..../../../../../,多了一层):

  • 第 52 行:../../../../../example/DeepSeek/README.md
  • 第 593 行:../../../../../example/Qwen/quant_qwen.py
  • 第 593 行:../../../../../example/Qwen/README.md#qwen25-72b-支持attention量化
  • 第 594 行:../../../../../example/Llama/quant_llama.py
  • 第 594 行:../../../../../example/Llama/README.md#llama31-70b-w8a8量化搭配attention量化

触发条件:用户点击上述任一链接时必然失效。

建议:将所有 6 层 .. 改为 5 层 ..../../../../../example/../../../../..example/

likedislike
595 595 
596#### 本文仅给出FA3场景下Llama3.1-70B和Qwen2.5-72B的量化推荐配置,可按实际情况进行参数调整,详见《[精度调优策略](../../../best_practices/w8a8_accuracy_tuning_policy.md)》596#### 本文仅给出FA3场景下Llama3.1-70B和Qwen2.5-72B的量化推荐配置,可按实际情况进行参数调整,详见《[精度调优策略](../../../best_practices/w8a8_accuracy_tuning_policy.md)》
597 597 
@@ -170,7 +170,7 @@ searched_config = cache_adaptor.search(
170)170)
171```171```
172 172 
173-完整的搜索脚本示例 [dit_cache_search_t2v_sp.sh](https://gitcode.com/Ascend/msmodelslim/blob/master/example/osp1_2/dit_cache_search_t2v_sp.sh):173+完整的搜索脚本示例 [dit_cache_search_t2v_sp.sh](../../../../../example/osp1_2/dit_cache_search_t2v_sp.sh):
174 174 
175```bash175```bash
176#!/bin/bash176#!/bin/bash
@@ -254,7 +254,7 @@ for step_id, t in enumerate(timesteps):
254 254 
255#### 11.5.3 完整推理脚本255#### 11.5.3 完整推理脚本
256 256 
257-完整的推理脚本示例 [dit_cache_sample_t2v_sp.sh](https://gitcode.com/Ascend/msmodelslim/blob/master/example/osp1_2/dit_cache_sample_t2v_sp.sh):257+完整的推理脚本示例 [dit_cache_sample_t2v_sp.sh](../../../../../example/osp1_2/dit_cache_sample_t2v_sp.sh):
258 258 
259```bash259```bash
260#!/bin/bash260#!/bin/bash
@@ -319,7 +319,7 @@ bash scripts/text_condition/gpu/sample_t2v_sp.sh
319 319 
320### 15.2 搜索 timestep320### 15.2 搜索 timestep
321 321 
322-获取到模型pipeline对象后,设置采样优化参数,传入生成的校准视频文件夹目录,调用`ReStepAdaptor`类进行 `timestep` 搜索,完整示例脚本: [search_t2v_sp.sh](https://gitcode.com/Ascend/msmodelslim/blob/master/example/osp1_2/search_t2v_sp.sh)。322+获取到模型pipeline对象后,设置采样优化参数,传入生成的校准视频文件夹目录,调用`ReStepAdaptor`类进行 `timestep` 搜索,完整示例脚本: [search_t2v_sp.sh](../../../../../example/osp1_2/search_t2v_sp.sh)。
323 323 
324```python3324```python3
325# Load pipeline, for example325# Load pipeline, for example
@@ -345,7 +345,7 @@ scheduler_timestep = restep_adaptor.search()
345 345 
346### 15.3 用搜索的 timestep 进行推理346### 15.3 用搜索的 timestep 进行推理
347 347 
348-示例推理命令(完整脚本请参考[sample_t2v_sp.sh](https://gitcode.com/Ascend/msmodelslim/blob/master/example/osp1_2/sample_t2v_sp.sh)):348+示例推理命令(完整脚本请参考[sample_t2v_sp.sh](../../../../../example/osp1_2/sample_t2v_sp.sh)):
349 349 
350```shell350```shell
351torchrun --nnodes=1 --nproc_per_node 8 --master_port 29503 \351torchrun --nnodes=1 --nproc_per_node 8 --master_port 29503 \
@@ -362,4 +362,4 @@ torchrun --nnodes=1 --nproc_per_node 8 --master_port 29503 \
362```362```
363 363 
364其中,`--schedule_timestep` 为搜索得到的 timestep 文件路径。364其中,`--schedule_timestep` 为搜索得到的 timestep 文件路径。
365-可参考[search_t2v_sp.sh](https://gitcode.com/Ascend/msmodelslim/blob/master/example/osp1_2/search_t2v_sp.sh)修改模型参数路径和搜索得到的 timestep 文件路径,执行带采样优化的推理生成。365+可参考[search_t2v_sp.sh](../../../../../example/osp1_2/search_t2v_sp.sh)修改模型参数路径和搜索得到的 timestep 文件路径,执行带采样优化的推理生成。
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。但本次 diff 中以下 5 个指向 example/osp1_2/ 的链接均使用了 6 个 ..(多了一层):

  • 第 173 行:../../../../../example/osp1_2/dit_cache_search_t2v_sp.sh
  • 第 257 行:../../../../../example/osp1_2/dit_cache_sample_t2v_sp.sh
  • 第 322 行:../../../../../example/osp1_2/search_t2v_sp.sh
  • 第 348 行:../../../../../example/osp1_2/sample_t2v_sp.sh
  • 第 365 行:../../../../../example/osp1_2/search_t2v_sp.sh

触发条件:用户点击上述任一链接时必然失效。

建议:将所有 6 层 .. 改为 5 层 ..../../../../../example/../../../../..example/

likedislike
@@ -31,7 +31,7 @@
31 31 
32#### 代码实现32#### 代码实现
33 33 
34-算法在 [msmodelslim/processor/quarot/offline_quarot/quarot.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/processor/quarot/offline_quarot/quarot.py) 中实现。34+算法在 [msmodelslim/processor/quarot/offline_quarot/quarot.py](../../../../../msmodelslim/processor/quarot/offline_quarot/quarot.py) 中实现。
35 35 
36#### 处理流程时序图36#### 处理流程时序图
37 37 
@@ -360,7 +360,7 @@ class LAOSOnlineRotationInterface:
360 - 实现`get_ln_fuse_map()`:返回LayerNorm与Linear层的融合映射。360 - 实现`get_ln_fuse_map()`:返回LayerNorm与Linear层的融合映射。
361 - 实现`get_bake_names()`:返回需要mean融合的Linear层名称列表(通常返回空列表)。361 - 实现`get_bake_names()`:返回需要mean融合的Linear层名称列表(通常返回空列表)。
362 - 实现`get_rotate_map(block_size)`:返回旋转映射对,包括pre_run和preprocess阶段的旋转配置。362 - 实现`get_rotate_map(block_size)`:返回旋转映射对,包括pre_run和preprocess阶段的旋转配置。
363- - 可参考 [msmodelslim/model/qwen3/model_adapter.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3/model_adapter.py) 或 [msmodelslim/model/deepseek_v3/model_adapter.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/deepseek_v3/model_adapter.py) 的实现。363+ - 可参考 [msmodelslim/model/qwen3/model_adapter.py](../../../../../msmodelslim/model/qwen3/model_adapter.py) 或 [msmodelslim/model/deepseek_v3/model_adapter.py](../../../../../msmodelslim/model/deepseek_v3/model_adapter.py) 的实现。
364 364 
365 2. **实现LAOSOnlineRotationInterface(可选,仅当需要在线旋转时)**365 2. **实现LAOSOnlineRotationInterface(可选,仅当需要在线旋转时)**
366 - 如果配置中`online: True`,需要同时实现`LAOSOnlineRotationInterface`接口。366 - 如果配置中`online: True`,需要同时实现`LAOSOnlineRotationInterface`接口。
@@ -375,7 +375,7 @@ class LAOSOnlineRotationInterface:
375 375 
376**现象**:输入模型的维度暂未被支持,导致旋转矩阵创建失败。376**现象**:输入模型的维度暂未被支持,导致旋转矩阵创建失败。
377 377 
378-**解决方案**:请先确定指定维度的 Hadamard 矩阵存在,参考 [msmodelslim/processor/quarot/common/hadamard_txt](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/processor/quarot/common/hadamard_txt) 添加特定维度的矩阵,并在 [msmodelslim/processor/quarot/common/hadamard.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/processor/quarot/common/hadamard.py) 进行补充。378+**解决方案**:请先确定指定维度的 Hadamard 矩阵存在,参考 [msmodelslim/processor/quarot/common/hadamard_txt](../../../../../msmodelslim/processor/quarot/common/hadamard_txt) 添加特定维度的矩阵,并在 [msmodelslim/processor/quarot/common/hadamard.py](../../../../../msmodelslim/processor/quarot/common/hadamard.py) 进行补充。
379 379 
380### 张量并行配置错误380### 张量并行配置错误
381 381 
@@ -410,4 +410,4 @@ class LAOSOnlineRotationInterface:
410 410 
411- 确保模型基于Transformer decoder架构。411- 确保模型基于Transformer decoder架构。
412- 检查适配器是否正确实现了所有`QuaRotInterface`接口方法(如果启用在线旋转,还需实现`LAOSOnlineRotationInterface`)。412- 检查适配器是否正确实现了所有`QuaRotInterface`接口方法(如果启用在线旋转,还需实现`LAOSOnlineRotationInterface`)。
413-- 参考 [msmodelslim/model/qwen3/model_adapter.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3/model_adapter.py) 或 [msmodelslim/model/deepseek_v3/model_adapter.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/deepseek_v3/model_adapter.py) 的实现示例。413+- 参考 [msmodelslim/model/qwen3/model_adapter.py](../../../../../msmodelslim/model/qwen3/model_adapter.py) 或 [msmodelslim/model/deepseek_v3/model_adapter.py](../../../../../msmodelslim/model/deepseek_v3/model_adapter.py) 的实现示例。
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。但本次 diff 中以下 5 个链接均使用了 6 个 ..(多了一层):

  • 第 34 行:../../../../../msmodelslim/processor/quarot/offline_quarot/quarot.py
  • 第 363 行:../../../../../msmodelslim/model/qwen3/model_adapter.py../../../../../msmodelslim/model/deepseek_v3/model_adapter.py
  • 第 378 行:../../../../../msmodelslim/processor/quarot/common/hadamard_txt../../../../../msmodelslim/processor/quarot/common/hadamard.py
  • 第 413 行:../../../../../msmodelslim/model/qwen3/model_adapter.py../../../../../msmodelslim/model/deepseek_v3/model_adapter.py

触发条件:用户点击上述任一链接时必然失效。

建议:将所有 6 层 .. 改为 5 层 ..../../../../../msmodelslim/../../../../..msmodelslim/

likedislike
@@ -73,7 +73,7 @@ y = torch.cat([linear(x) for linear in linears], dim=-1)
73 73 
74#### 代码实现74#### 代码实现
75 75 
76-算法在 [msmodelslim/processor/anti_outlier/smooth_quant/](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/processor/anti_outlier/smooth_quant) 中实现,处理流程分两阶段。76+算法在 [msmodelslim/processor/anti_outlier/smooth_quant/](../../../../../msmodelslim/processor/anti_outlier/smooth_quant) 中实现,处理流程分两阶段。
77 77 
78#### 预处理阶段78#### 预处理阶段
79 79 
@@ -195,7 +195,7 @@ class SmoothQuantInterface(ABC):
1952. **配置子图映射**:为每层配置 norm-linear 子图映射关系。1952. **配置子图映射**:为每层配置 norm-linear 子图映射关系。
1963. **指定模块路径**:使用完整的模块路径,如 `model.layers.{i}.input_layernorm`1963. **指定模块路径**:使用完整的模块路径,如 `model.layers.{i}.input_layernorm`
197 197 
198-**参考实现:** 可参考 [msmodelslim/model/qwen3/model_adapter.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/model/qwen3/model_adapter.py) 中的 `Qwen3ModelAdapter` 实现。198+**参考实现:** 可参考 [msmodelslim/model/qwen3/model_adapter.py](../../../../../msmodelslim/model/qwen3/model_adapter.py) 中的 `Qwen3ModelAdapter` 实现。
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。但本次 diff 中以下 2 个链接均使用了 6 个 ..(多了一层):

  • 第 76 行:../../../../../msmodelslim/processor/anti_outlier/smooth_quant
  • 第 198 行:../../../../../msmodelslim/model/qwen3/model_adapter.py

触发条件:用户点击上述任一链接时必然失效。

建议:将所有 6 层 .. 改为 5 层 ..../../../../../msmodelslim/../../../../..msmodelslim/

likedislike
199 199 
200### 配置示例200### 配置示例
201 201 
@@ -67,7 +67,7 @@
67 67 
68#### 代码实现68#### 代码实现
69 69 
70-- FA3 量化在 [processor.py](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/processor/quant/fa3/processor.py) 中实现,处理流程分三阶段。70+- FA3 量化在 [processor.py](../../../../../msmodelslim/processor/quant/fa3/processor.py) 中实现,处理流程分三阶段。
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。第 70 行 ../../../../../msmodelslim/processor/quant/fa3/processor.py 使用了 6 个 ..,多了一层。

触发条件:用户点击该链接时必然失效。

建议../../../../../msmodelslim/../../../../..msmodelslim/

likedislike
71 71 
72#### 注入阶段72#### 注入阶段
73 73 
@@ -24,7 +24,7 @@
24 24 
25### 实现25### 实现
26 26 
27-算法实现在 [`msmodelslim/core/quantizer/impl/gptq.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quantizer/impl/gptq.py) 中:27+算法实现在 [`msmodelslim/core/quantizer/impl/gptq.py`](../../../../../msmodelslim/core/quantizer/impl/gptq.py) 中:
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。第 27 行 ../../../../../msmodelslim/core/quantizer/impl/gptq.py 使用了 6 个 ..,多了一层。

触发条件:用户点击该链接时必然失效。

建议../../../../../msmodelslim/../../../../..msmodelslim/

likedislike
28 28 
29 - `per_channel`实现类:`WeightPerChannelGPTQ`29 - `per_channel`实现类:`WeightPerChannelGPTQ`
30 - `per_group`实现类:`WeightPerGroupGPTQ`30 - `per_group`实现类:`WeightPerGroupGPTQ`
@@ -18,7 +18,7 @@
18 18 
19### 实现19### 实现
20 20 
21-- 算法在 [`msmodelslim/core/quantizer/impl/histogram.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quantizer/impl/histogram.py) 和 [`msmodelslim/core/observer/histogram.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/observer/histogram.py) 中实现,处理流程分4步。21+- 算法在 [`msmodelslim/core/quantizer/impl/histogram.py`](../../../../../msmodelslim/core/quantizer/impl/histogram.py) 和 [`msmodelslim/core/observer/histogram.py`](../../../../../msmodelslim/core/observer/histogram.py) 中实现,处理流程分4步。
22 22 
231. **直方图统计**231. **直方图统计**
24 - 将输入张量的值域划分为固定数量的bins(默认2048)。24 - 将输入张量的值域划分为固定数量的bins(默认2048)。
@@ -272,7 +272,7 @@ class SearchMethod(str, Enum):
272 method: "minmax" # 不支持直方图权重量化,此处不应配置为"histogram"272 method: "minmax" # 不支持直方图权重量化,此处不应配置为"histogram"
273```273```
274 274 
275-- 排查对应的quantizer在初始化时是否存在AutoActQuantizer。可以根据 YAML 中 `process` 列表项的 `type` 字段查找对应的量化器名称,在 [`msmodelslim/core/quantizer`](https://gitcode.com/Ascend/msmodelslim/tree/master/msmodelslim/core/quantizer) 中查看对应的代码。275+- 排查对应的quantizer在初始化时是否存在AutoActQuantizer。可以根据 YAML 中 `process` 列表项的 `type` 字段查找对应的量化器名称,在 [`msmodelslim/core/quantizer`](../../../../../msmodelslim/core/quantizer) 中查看对应的代码。
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。但本次 diff 中以下 3 个链接均使用了 6 个 ..(多了一层):

  • 第 21 行:../../../../../msmodelslim/core/quantizer/impl/histogram.py../../../../../msmodelslim/core/observer/histogram.py
  • 第 275 行:../../../../../msmodelslim/core/quantizer

触发条件:用户点击上述任一链接时必然失效。

建议:将所有 6 层 .. 改为 5 层 ..../../../../../msmodelslim/../../../../..msmodelslim/

likedislike
276 276 
277```python277```python
278class LinearQuantizer(nn.Module):278class LinearQuantizer(nn.Module):
@@ -31,7 +31,7 @@ MinMax 算法基于以下公式计算量化参数:
31 31 
32### 实现32### 实现
33 33 
34-算法在 [`msmodelslim/core/quantizer/impl/minmax.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quantizer/impl/minmax.py) 中实现。34+算法在 [`msmodelslim/core/quantizer/impl/minmax.py`](../../../../../msmodelslim/core/quantizer/impl/minmax.py) 中实现。
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。第 34 行 ../../../../../msmodelslim/core/quantizer/impl/minmax.py 使用了 6 个 ..,多了一层。

触发条件:用户点击该链接时必然失效。

建议../../../../../msmodelslim/../../../../..msmodelslim/

likedislike
35 35 
36## 功能介绍36## 功能介绍
37 37 
@@ -25,9 +25,9 @@
25 25 
26具体实现位置如下:26具体实现位置如下:
27 27 
28-- 量化校准:[`msmodelslim/core/quantizer/impl/minmax.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/core/quantizer/impl/minmax.py) 中的 `ActPDMixMinmax`28+- 量化校准:[`msmodelslim/core/quantizer/impl/minmax.py`](../../../../../msmodelslim/core/quantizer/impl/minmax.py) 中的 `ActPDMixMinmax`
29-- 量化模式 IR:[`msmodelslim/ir/w8a8_pdmix.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/ir/w8a8_pdmix.py) 中的 `W8A8PDMixFakeQuantLinear`29+- 量化模式 IR:[`msmodelslim/ir/w8a8_pdmix.py`](../../../../../msmodelslim/ir/w8a8_pdmix.py) 中的 `W8A8PDMixFakeQuantLinear`
30-- 相关常量:[`msmodelslim/ir/const.py`](https://gitcode.com/Ascend/msmodelslim/blob/master/msmodelslim/ir/const.py) 定义 `int8_pd_mix_asym`30+- 相关常量:[`msmodelslim/ir/const.py`](../../../../../msmodelslim/ir/const.py) 定义 `int8_pd_mix_asym`
atomgit-bot
atomgit-botatomgit-bot7月15日

🟠 High Priority

文件目录深度为 5,需 5 个 .. 到达根目录。但本次 diff 中以下 3 个链接均使用了 6 个 ..(多了一层):

  • 第 28 行:../../../../../msmodelslim/core/quantizer/impl/minmax.py
  • 第 29 行:../../../../../msmodelslim/ir/w8a8_pdmix.py
  • 第 30 行:../../../../../msmodelslim/ir/const.py

触发条件:用户点击上述任一链接时必然失效。

建议:将所有 6 层 .. 改为 5 层 ..../../../../../msmodelslim/../../../../..msmodelslim/

likedislike
31 31 
32## 适用要求32## 适用要求
33 33