已合并
add proto extend #10332
add proto extend #10332
已合并
wang-minbo创建于 7 天前
wang-minbo成员
7 天前

描述

关联的Issue

https://gitcode.com/cann/ops-transformer/issues/4459

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wang-minbo 的贡献)
Wwang-minbo成员
7 天前 创建了 pull request,commit 3cb66eb3
atomgit-bot
atomgit-bot
7 天前 评论:

变更摘要

本 PR("add proto extend")主要增强 scripts/util/merge_proto.py 的算子 proto 合并能力:使脚本能够识别并合并 _proto_extend.h 扩展 proto 文件,并支持在单个文件中匹配多个算子定义,最终按算子名去重后合并生成统一的 op transformer proto 头文件。

主要改动

  • 支持扩展 proto 文件merge_op_proto 中的文件过滤条件由仅接受 _proto.h 扩展为同时接受 _proto_extend.h,使算子扩展定义也能被纳入合并流程
  • 多定义匹配match_op_proto 由原先仅返回单个匹配(或 (None, None))改为使用 re.finditer 配合非贪婪正则 REG_OP\((\w+)\).*?OP_END_FACTORY_REG\(\1\) 返回全部匹配的 (op_name, op_def) 列表,一个文件可产出多个算子定义
  • 按算子名去重merge_op_proto 新增 seen 集合,仅保留每个算子名首次出现的定义,避免重复定义写入合并结果
  • 代码风格调整:将字符串引号统一为双引号、清理尾随空白并补充文件末尾换行(无业务影响)
likedislike
CANN-robotCANN-robot成员
7 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7 天前 评论:

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
9.1.0 Andy-lb, 蒋礼锐 (2/2) Andy-lb (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

wang-minbo, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
7 天前 将monologue815,jiang-lirui,Allan_Yu,TianXL,xtqh,liudan12,jiangtao_rts,gitcode-chenjiao,hanxiaolong,gaoxiang618,mabing1118,gcw_kUomxQ2l,Andy-lb设为评审人
CANN-robotCANN-robot成员
7 天前 将TianXL,jiangtao_rts,gitcode-chenjiao,hanxiaolong,gcw_kUomxQ2l,Andy-lb设为审查人
wang-minbo成员
7 天前 评论:

/compile

likedislike
Wwang-minbo成员
7 天前 update merge request[project id: 7673863, iid: 10332, commit_id: 0b604ff2ff330dafb2ad1d241d0dd22064a61510] virtual merging success
Andy-lb成员
7 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
7 天前 添加了label:approved
CANN-robotCANN-robot成员
7 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
7 天前 评论:

流水线任务触发成功
任务链接 [65188ba8ed344d7da2f31edfeca2db43][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-20 11:58:24]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
7 天前 评论:

流水线任务触发成功
任务链接 [ae44343b50934b5c9be6305a1920cdf7][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ❌ FAILED >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>> >>>>>
likedislike
CANN-robotCANN-robot成员
7 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
7 天前 添加了label:ci-pipeline-failed
CANN-robotCANN-robot成员
6 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
6 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6 天前 评论:

流水线任务触发成功
任务链接 [f54eebb0b18f47b5ad16da707ec370fb][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-20 15:40:01]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
6 天前 评论:

流水线任务触发成功
任务链接 [e8ad2b63de754d31b2f4ff357db189da][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ❌ FAILED >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>> >>>>>
likedislike
CANN-robotCANN-robot成员
6 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6 天前 添加了label:ci-pipeline-failed
jiang-lirui成员
6 天前 评论:

/approve
/lgtm

likedislike
CANN-robotCANN-robot成员
6 天前 添加了label:lgtm
Wwang-minbo成员
6 天前 修改了pull request 的描述
wang-minbo成员
6 天前 评论:

/compile

likedislike
CANN-robotCANN-robot成员
6 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
6 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6 天前 评论:

流水线任务触发成功
任务链接 [a16da129b1d5455680b336f06d309ac2][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-20 17:29:51]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
6 天前 评论:

流水线任务触发成功
任务链接 [e032e572a3d84013b2f6796eba120228][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>> >>>>>

[2026-08-20 17:05:54]    CI执行结束

likedislike
CANN-robotCANN-robot成员
6 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6 天前 添加了label:ci-pipeline-passed
CANN-robotCANN-robot成员
6 天前 关闭了关联的issue
CANN-robotCANN-robot成员
6 天前 合入了pull request