Merged
feat: 自定义算子注册支持 engine and priority,常量折叠适配 #4918
duhuaAdd on Sep 11
feat: 自定义算子注册支持 engine and priority,常量折叠适配 #4918
Merged
Merged fromdu-hua1024/genewintocann/gedevelop
Pull Request has been successfully merged by CANN-robot.
(Thank you for duhua's contribution.)Sep 11 Added label: enhancement
Sep 11 Added label: cann-cla/yes
CANN-robot
Sep 11 Comments:
Sep 11 Comments:
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.
You can self-configure the PR merge rules for this repository. For more details, please refer to 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 |
|---|---|---|
| compiler/engines/nn_engine | ✅ yangyongqiang0606, kobemini (2/2) | ✅ yangyongqiang0606 (1/1) |
| inc/graph_metadef/external | ✅ 王涛, kobemini, yangyongqiang0606 (3/2) | ✅ 王涛 (1/1) |
| repo-cann/ge | ✅ 王涛, yangyongqiang0606, kobemini (3/2) | ✅ 王涛, yangyongqiang0606 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
du-hua1024, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Sep 11 Set yangyongqiang0606,kobemini,ClarkXie,tangqunzhang,xchu42,hugo111,lining23666,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,zhanj,zhujingjing,Mexyy,wangxiaotian995,stevenaw0,yuht9 as approver
Sep 11 Set yangyongqiang0606,kobemini,ClarkXie,tangqunzhang,xchu42,hugo111,lining23666,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,zhanj,zhujingjing,Mexyy,wangxiaotian995,stevenaw0,yuht9 as approver
188 messages are collapsed here。 See more
王涛
Sep 14 Comments:
Sep 14 Comments:
/approve


Sep 14 Added label: lgtm
yangyongqiang
Sep 14 Comments:
Sep 14 Comments:
/approve


Sep 14 Added label: approved
Sep 14 Merged pull request
Pull Request
描述
本 PR 主要实现自定义算子按 engine、priority 和 backend 注册/查询/创建,并将其适配到常量折叠 Host CPU 执行路径,同时保留原有注册接口的兼容行为。
主要变更:
OpRegistrationPriority(kTop/kBottom)、OpEngine,扩展CustomOpRegistry的注册、查询、实例创建和能力获取接口,注册维度为(op_type, engine_type, priority, backend)。CustomOpFactory与CustomOpCreatorRegister,新增带 priority/engine 的 API;默认接口保持使用engine = OpEngine::kCustom、priority = kTop。REG_OP_WITH_PRIORITY宏,支持为自定义算子显式指定 backend、priority 和 engine,并保留既有注册宏。ConstantFoldingPass::RunOpKernel优先处理OpEngine::kHostCpuengine 下的 bottom-priority Host CPU 自定义算子;命中后通过HostCpuExecuteOp执行,未命中时回退原有OpKernelRegistry路径,创建失败不错误回退。ge_log.h从公共头args_format_desc.h移到实际使用日志宏的实现文件,减少 Ascend031 tiny.arm runtime 包中libgraph.so的链接依赖。变更类型
关联的Issue
无
如何测试
核对清单
其他信息