Files
TorchNPU/.gitmodules
T
SorryNaCN f2cf9d2ded feat(_inductor): Support DVM for the master branch
Co-authored-by: huangchengnuo<huangchengnuo1@huawei.com>



# message auto-generated for no-merge-commit merge:
!39780 merge support-dvm-master-20260701 into master

feat(_inductor): Support DVM for the master branch

Created-by: SorryNaCN
Commit-by: huangchengnuo
Merged-by: ascend-robot
Description: <!--
PR描述模板更新日期:20260203
-->

# 【合入来源】
> <font color="red">**如有社区issue,请关联issue链接**</font>\
> <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font>

- [ ] 需求
- [ ] 问题单
- [x] issue/工单
- [x] 重构优化
- [ ] 资料更新

关联社区 issue:https://gitcode.com/Ascend/pytorch/issues/1962

# 【修改方案】
> 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\
> 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容)

本 PR 将 `v2.10.0` 分支中已验证的 DVM 相关能力迁移到 `master`,为 inductor 增加 DVM 后端和融合支持。

1. 引入 DVM 第三方依赖并接入构建,仅在 `.gitmodules` 中新增 DVM submodule,保留目标分支已有 submodule 配置。
2. 新增/迁移 DVM inductor 代码,包括 `mlir_fusion`、`graph_fusion`、DVM op emitter、decomp、codegen、工具函数和相关测试。
3. 新增 DVM C++ pybind 接口,并在 `_C` 初始化阶段注册 `torch_npu._C.dvm` 相关绑定。
4. 调整 `torch_npu._inductor` 后端加载逻辑,支持 `npu_backend=dvm`;DVM 后端复用 MLIR patch 与 codegen backend 注册流程。
5. 调整 dynamo/inductor wrapper,使 `mlir` 与 `dvm` 路径通过 NPU backend scope 生效,覆盖初始化与调用阶段。
6. 补充 DVM 相关 UT 与 public bindings 清单,覆盖后端加载、kernel、graph fusion、mlir fusion 等场景。

# 【资料变更】
> 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及”

不涉及。

# 【接口变更】
> 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及”

涉及 `torch_npu._inductor` 的后端选择能力扩展:

1. 支持通过 `torch._inductor.config.npu_backend = "dvm"` 选择 DVM 后端。
2. 支持通过 `torch.compile(..., options={"npu_backend": "dvm"})` 选择 DVM 后端。
3. 支持通过环境变量 `TORCHINDUCTOR_NPU_BACKEND=dvm` 选择 DVM 后端。
4. 新增 `torch_npu._C.dvm` C++ pybind 绑定,供 DVM Python 侧构图与运行调用。

# 【功能验证】
> 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\
> 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图

已完成本地静态验证:

1. `git diff --check origin/master`
2. 对相对 `origin/master` 变更的 Python 文件执行 `python -m py_compile`
3. 已在 PR 评论中发送 `compile` 触发编译流水线

新增/迁移测试覆盖:

1. DVM kernel 基础能力测试
2. DVM graph fusion 测试
3. DVM mlir fusion 测试
4. DVM public bindings 清单校验

# 【CheckList】
> PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x]

- [x] 代码注释完备,正确记录错误日志
- [x] 代码实现进行了返回值、空指针等校验
- [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等
- [ ] PR持续集成流水线(CI)执行通过,代码检查无异常


See merge request: Ascend/pytorch!39780
2026-07-02 16:20:20 +08:00

37 lines
1.3 KiB
Plaintext

[submodule "third_party/op-plugin"]
path = third_party/op-plugin
url = https://gitcode.com/ascend/op-plugin.git
ignore = dirty
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://gitcode.com/GitHub_Trending/go/googletest.git
[submodule "third_party/torchair/torchair"]
path = third_party/torchair/torchair
url = https://gitcode.com/ascend/torchair.git
[submodule "third_party/Tensorpipe"]
path = third_party/Tensorpipe
url = https://gitcode.com/ascend/Tensorpipe.git
[submodule "third_party/fmt"]
path = third_party/fmt
url = https://gitcode.com/GitHub_Trending/fm/fmt.git
[submodule "third_party/nlohmann"]
path = third_party/nlohmann
url = https://gitcode.com/GitHub_Trending/js/json.git
[submodule "third_party/torch-mlir"]
path = third_party/torch-mlir
url = https://gitcode.com/gh_mirrors/to/torch-mlir.git
update = none
[submodule "third_party/dvm/dvm"]
path = third_party/dvm/dvm
url = https://gitcode.com/mindspore/dvm.git
branch = r2.10
[submodule "third_party/acl_src/runtime"]
path = third_party/acl_src/runtime
url = https://gitcode.com/cann/runtime.git
[submodule "third_party/acl_src/ge"]
path = third_party/acl_src/ge
url = https://gitcode.com/cann/ge.git
[submodule "third_party/acl_src/graph-autofusion"]
path = third_party/acl_src/graph-autofusion
url = https://gitcode.com/cann/graph-autofusion.git