| [DVM] Update decomposition excludes and generate list
Co-authored-by: huangchengnuo<huangchengnuo1@huawei.com>
# message auto-generated for no-merge-commit merge:
!32068 merge fix_inductor_dvm_bug_v2.7.1 into v2.7.1
[DVM] Update decomposition excludes and generate list
Created-by: SorryNaCN
Commit-by: huangchengnuo
Merged-by: ascend-robot
Description: # 【合入来源】
- [ ] 需求
- [ ] 问题单
- [ ] issue/工单
- [x] 重构优化
- [ ] 资料更新
# 【修改方案】
1. 更新 torch_npu/_inductor/dvm/decomp.py 中的 decomps_to_exclude_npu,将 DVM 与 NPU 侧需要排除 decomposition 的算子列表做并集整理,并按字面顺序排序,便于后续维护和差异比对。
2. 新增多类需要保留原始算子语义的排除项,包括 embedding、upsample_*、nll_loss2d_*、max_pool2d_with_indices*、reflection_pad2d*、grid_sampler_2d*、triu、slice.Tensor 等,避免这些算子在 DVM 路径上被提前 decomposition 后影响后续处理。
3. 更新 torch_npu/_inductor/dvm/mlir_fusion.py 中的 anir_config.GENERATE_LIST,增加 aten.unsqueeze,补充 DVM 融合生成阶段对该算子的支持范围。
# 【资料变更】
不涉及。
# 【接口变更】
不涉及。本次修改仅涉及 torch_npu/_inductor/dvm 内部算子处理配置和生成列表调整,不涉及跨仓接口和客户可见接口变更。
# 【功能验证】
1. 本地对修改文件执行语法校验:
python -m py_compile torch_npu/_inductor/dvm/decomp.py torch_npu/_inductor/dvm/mlir_fusion.py
2. 已提交 MR 并触发流水线校验。
3. 当前未新增独立 UT 用例。本次修改主要为 DVM 内部配置项与算子列表调整,后续以流水线结果和相关场景回归为主。
# 【CheckList】
- [x] 代码注释完备,正确记录错误日志
- [x] 代码实现进行了返回值、空指针等校验
- [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等
- [ ] PR持续集成流水线(CI)执行通过,代码检查无异常
See merge request: Ascend/pytorch!32068 | 2 个月前 |