已合并
feat(_inductor): Support DVM for the r2.12 branch #39779
SorryNaCN创建于 7月1日
feat(_inductor): Support DVM for the r2.12 branch #39779
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 SorryNaCN 的贡献)7月1日 关联了issue:[Bug]: 26.1.0版本图模式Bug修复
ascend-robot
7月1日 评论:
7月1日 评论:
SorryNaCN
7月1日 评论:
7月1日 评论:
compile


7月1日 添加了label:ascend-cla/yes
此处折叠了44条消息 查看更多
7月2日 添加了label:approved
7月2日 添加了label:lgtm
7月2日 合入了pull request
ascend-robot
7月2日 评论:
7月2日 评论:
流水线 pytorch_gitcode_PR_multiVersion#11736 [ commitID:46d314dd ] 已完成


【合入来源】
关联社区 issue:https://gitcode.com/Ascend/pytorch/issues/1962
【修改方案】
本 PR 将
v2.10.0分支中已验证的 DVM 相关能力迁移到v2.12.0,为 inductor 增加 DVM 后端和融合支持。.gitmodules中新增 DVM submodule,保留目标分支已有 submodule 配置。mlir_fusion、graph_fusion、DVM op emitter、decomp、codegen、工具函数和相关测试。_C初始化阶段注册torch_npu._C.dvm相关绑定。torch_npu._inductor后端加载逻辑,支持npu_backend=dvm;DVM 后端复用 MLIR patch 与 codegen backend 注册流程。mlir与dvm路径通过 NPU backend scope 生效,覆盖初始化与调用阶段。【资料变更】
不涉及。
【接口变更】
涉及
torch_npu._inductor的后端选择能力扩展:torch._inductor.config.npu_backend = "dvm"选择 DVM 后端。torch.compile(..., options={"npu_backend": "dvm"})选择 DVM 后端。TORCHINDUCTOR_NPU_BACKEND=dvm选择 DVM 后端。torch_npu._C.dvmC++ pybind 绑定,供 DVM Python 侧构图与运行调用。【功能验证】
已完成本地静态验证:
git diff --check origin/v2.12.0origin/v2.12.0变更的 Python 文件执行python -m py_compilecompile触发编译流水线新增/迁移测试覆盖:
【CheckList】