已合并
fix: v1补充注册 Unsupported ASCIR 算子及占位 codegen #1767
fix: v1补充注册 Unsupported ASCIR 算子及占位 codegen #1767
已合并
wei_shi创建于 19 天前
wei_shi
wei_shi成员
19 天前

Pull Request

描述

为 ASCIR 的 Unsupported 占位节点补齐 V1 注册与代码生成占位实现,支持无输入起始节点在图中被识别和保留,同时避免为该节点生成实际 AscendC API 调用,解决var_mean调用过程中因v1中缺少Unsupported节点注册而导致的断言失败。

变更类型

关联的Issue

如何测试

  1. 检查 autofuse/ascir/generator/ascir_builtin_ops_v1.cpp 中新增的 Unsupported ASCIR 注册,确认其无输入、单输出、标记为起始节点,并使用无性能信息的属性 stub。
  2. 检查 autofuse/ascir/generator/v1_ascir_codegen_impl.h 中的 UnsupportedAscIrCodegenImpl,确认 API 调用名为空且 API 名称为 Unsupported
  3. 当前环境未执行完整构建和测试。

核对清单

其他信息

本 PR 修改以下两个文件:

  • autofuse/ascir/generator/ascir_builtin_ops_v1.cpp:注册 Unsupported ASCIR 算子,并配置无输入起始节点及空性能信息。
  • autofuse/ascir/generator/v1_ascir_codegen_impl.h:新增 UnsupportedAscIrCodegenImpl,为该节点提供不生成实际 API 调用的占位 codegen。
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wei_shi 的贡献)
wei_shiwei_shi成员
19 天前 创建了 pull request,commit c06ef1ef
atomgit-bot
atomgit-bot
19 天前 评论:

变更摘要

本 PR 为 Bug 修复:在 Python ASCIR 的 dtype 推导阶段跳过 Unsupported 节点,避免无输入占位节点触发 dtype 推导断言。具体改动位于 autofuse/compiler/py_module/pyascir_types.cppHintGraph::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 推导,不影响正常推导流程。
likedislike
atomgit-bot
atomgit-bot
19 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

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

/lgtm

likedislike
CANN-robotCANN-robot成员
18 天前 添加了label:lgtm
张德鹏成员
18 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
18 天前 添加了label:approved
CANN-robotCANN-robot成员
18 天前 合入了pull request