已合并
fix: v1补充注册 Unsupported ASCIR 算子及占位 codegen #1767
wei_shi创建于 19 天前
fix: v1补充注册 Unsupported ASCIR 算子及占位 codegen #1767
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wei_shi 的贡献)atomgit-bot
19 天前 评论:
19 天前 评论:
变更摘要
本 PR 为 Bug 修复:在 Python ASCIR 的 dtype 推导阶段跳过 Unsupported 节点,避免无输入占位节点触发 dtype 推导断言。具体改动位于 autofuse/compiler/py_module/pyascir_types.cpp 的 HintGraph::InferDtype 中,遍历 ascgraph->GetAllNodes() 时新增类型判断:当 node->GetType() 为 "Unsupported" 时直接 continue 跳过,不进入后续的 ProcessSingleNode 推导流程。
主要改动
- 新增
Unsupported节点跳过逻辑: 在HintGraph::InferDtype的节点遍历循环中增加if (node->GetType() == "Unsupported") { continue; },使该类节点不参与 dtype 推导。 - 规避断言触发: 通过提前跳过,避免无输入占位节点进入
ProcessSingleNode时因缺少输入 dtype 而触发GE_ASSERT断言(此前PY_ASSERT的错误信息可能被覆盖)。 - 保持普通节点推导行为不变: 非
Unsupported节点仍按原有路径执行ProcessSingleNode进行 dtype 推导,不影响正常推导流程。


atomgit-bot
19 天前 评论:
19 天前 评论:
19 天前 添加了label:cann-cla/yes
CANN-robot
19 天前 评论:
19 天前 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/graph-autofusion | ✅ wangxiaotian995, 张德鹏, xchu42 (3/2) | ✅ 张德鹏 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
wei_shi, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了50条消息 查看更多
wangxiaotian995
18 天前 评论:
18 天前 评论:
/lgtm


18 天前 添加了label:lgtm
18 天前 添加了label:approved
18 天前 合入了pull request
Pull Request
描述
为 ASCIR 的 Unsupported 占位节点补齐 V1 注册与代码生成占位实现,支持无输入起始节点在图中被识别和保留,同时避免为该节点生成实际 AscendC API 调用,解决var_mean调用过程中因v1中缺少Unsupported节点注册而导致的断言失败。
变更类型
关联的Issue
无
如何测试
autofuse/ascir/generator/ascir_builtin_ops_v1.cpp中新增的UnsupportedASCIR 注册,确认其无输入、单输出、标记为起始节点,并使用无性能信息的属性 stub。autofuse/ascir/generator/v1_ascir_codegen_impl.h中的UnsupportedAscIrCodegenImpl,确认 API 调用名为空且 API 名称为Unsupported。核对清单
其他信息
本 PR 修改以下两个文件:
autofuse/ascir/generator/ascir_builtin_ops_v1.cpp:注册UnsupportedASCIR 算子,并配置无输入起始节点及空性能信息。autofuse/ascir/generator/v1_ascir_codegen_impl.h:新增UnsupportedAscIrCodegenImpl,为该节点提供不生成实际 API 调用的占位 codegen。