Pull Request has been successfully merged by CANN-robot.
(Thank you for zyh_gitcode's contribution.)变更摘要
本 PR 主要解决纯 DSL 写的 attention 算子无法被自动发现的问题:此前普通 attention 与 experimental attention 的算子发现逻辑只检查算子根目录和 op_host 目录下的 CMakeLists.txt,仅提供 op_dsl/CMakeLists.txt 的算子会被跳过,需要额外补一个根目录转发文件。改动在 attention/CMakeLists.txt 与 experimental/attention/CMakeLists.txt 两处发现逻辑中引入第三个入口 op_dsl/CMakeLists.txt,并明确入口优先级,使纯 DSL 算子无需转发文件即可参与构建。
主要改动
- 新增
op_dsl发现入口:在两处 attention 算子发现逻辑中加入op_dsl/CMakeLists.txt,入口优先级依次为<operator>/CMakeLists.txt、<operator>/op_host/CMakeLists.txt、<operator>/op_dsl/CMakeLists.txt。 - 保证单入口加载:每个算子只自动加载一个入口,已有 ASC 算子继续走原有入口,由其
op_host/CMakeLists.txt自行 include DSL 适配,避免同一算子被重复加载。 - 纯 DSL 算子可直接接入:只有
op_dsl/CMakeLists.txt的算子可被自动发现,并继续沿用现有的算子选择过滤规则,算子名称过滤行为不变。 - 改动范围收敛在 CMake 发现逻辑:仅调整
attention/CMakeLists.txt和experimental/attention/CMakeLists.txt,不包含算子示例,也不改动公共登记宏。
🧩 本次 Review 已使用自定义 Skill:


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 |
|---|---|---|
| attention | ✅ luwei_1104, 蒋礼锐, 马兵 (3/2) | ✅ 马兵, luwei_1104, 蒋礼锐 (3/1) |
| experimental/attention | ✅ 蒋礼锐, 马兵, luwei_1104 (3/2) | ✅ 蒋礼锐, 马兵, luwei_1104 (3/1) |
| experimental/ffn | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐, 马兵 (2/1) |
| experimental/gmm | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐, 马兵 (2/1) |
| experimental/mc2 | ✅ 蒋礼锐, 马兵, wang-minbo (3/2) | ✅ 马兵, wang-minbo, 蒋礼锐 (3/1) |
| experimental/moe | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐, 马兵 (2/1) |
| experimental/posembedding | ✅ 蒋礼锐, 马兵, luwei_1104 (3/2) | ✅ 蒋礼锐, 马兵, luwei_1104 (3/1) |
| ffn | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐, 马兵 (2/1) |
| gmm | ✅ 马兵, 蒋礼锐 (2/2) | ✅ 蒋礼锐, 马兵 (2/1) |
| mc2 | ✅ wang-minbo, 蒋礼锐, 马兵 (3/2) | ✅ 马兵, wang-minbo, 蒋礼锐 (3/1) |
| mhc | ✅ 蒋礼锐, luwei_1104, 马兵 (3/2) | ✅ luwei_1104 (1/1) |
| moe | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 马兵, 蒋礼锐 (2/1) |
| posembedding | ✅ 蒋礼锐, 马兵, luwei_1104 (3/2) | ✅ 蒋礼锐, 马兵, luwei_1104 (3/1) |
| sig-ops-transformer | ✅ 蒋礼锐, 马兵 (2/2) | ✅ 蒋礼锐, 马兵 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
sky-zyh, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/lgtm
/approve


/approve


描述
只有 op_dsl/CMakeLists.txt 的算子缺少分类目录加载入口。本 PR 沿用分类目录已有遍历,在原有入口判断后补充 DSL 分支,不新增公共 CMake 函数、模块扫描或目录收集流程。
根目录 CMakeLists.txt、cmake/func.cmake、cmake/custom_build.cmake 均恢复为基线内容。没有新增测试文件。
已有 ASC 算子继续由原入口显式 include DSL CMake;纯 DSL 算子只需保留 op_dsl/CMakeLists.txt。原有依赖收集和加载不变,本版不扩展纯 DSL 依赖发现能力。