已合并
feat(ci): 出包命令过滤无 op_kernel 目录的算子 #4896
songkai111创建于 19 天前
feat(ci): 出包命令过滤无 op_kernel 目录的算子 #4896
已合并
songkai111创建于 19 天前
songkai111成员
19 天前

描述

出包(pkg)模式下,当前 build_package_commands 仅按 DEFAULT_FILTER_SOC(ascend910b)过滤算子,未判断算子是否具备 op_kernel 目录。出包依赖 kernel 二进制,无 op_kernel 目录的算子无法出包,会导致出包命令包含无法生成 kernel 二进制的算子,影响出包结果。

本次改动在出包命令生成链路中新增「op_kernel 目录过滤」:

  • 新增 check_op_has_op_kernel(op_name, is_experimental=False):按 math/conversion/random/(experimental 场景为对应 experimental/ 前缀)检查算子目录下是否存在 op_kernel 子目录。
  • 新增 filter_ops_by_op_kernel(ops, is_experimental=False):过滤出存在 op_kernel 目录的算子集合。
  • build_package_commands 在 SOC 过滤之后追加 op_kernel 目录过滤,被丢弃的算子(无 op_kernel 目录)打印告警列出;过滤后为空时回退到默认算子命令。

改动仅影响 pkg(出包)模式,UT / example 模式逻辑不变。

关联的Issue

测试

本地验证(克隆自 master 分支):

# 变更含 add_lora(有 op_kernel + 支持 ascend910b)与 affine_grid(无 op_kernel)
$ python3 scripts/ci/gen_ci_cmd.py -f changes.txt --pkg=TRUE
警告: 以下算子无 op_kernel 目录,出包命令中丢弃: affine_grid
生成 1 条命令:
  bash build.sh --pkg -j16 --vendor_name=custom --ops=add_lora

# 仅变更无 op_kernel 算子 → 回退默认算子
$ python3 scripts/ci/gen_ci_cmd.py -f changes.txt --pkg=TRUE
生成 1 条命令:
  bash build.sh --pkg -j16 --vendor_name=custom --ops=is_finite

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 songkai111 的贡献)
Ssongkai111成员
19 天前 创建了 pull request,commit d22666bc
atomgit-bot
atomgit-bot
19 天前 评论:

变更摘要

本 PR 为 CI 出包命令生成流程(scripts/ci/gen_ci_cmd.py)新增按算子 op_kernel 目录存在性过滤的逻辑:出包模式需要生成 kernel 二进制,没有 op_kernel 目录的算子无法出包,因此在 build_package_commands 中先按默认 SOC 过滤后,再丢弃无 op_kernel 目录的算子,避免出包命令包含无法出包的算子。

主要改动

  • 新增 check_op_has_op_kernel 函数: 新增算子目录存在性检查函数,根据是否为 experimental 算子依次在 math/conversion/random/(或 experimental/math/experimental/conversion/experimental/random/)前缀下拼接 op_name/op_kernel 路径,存在即返回 True,否则返回 False
  • 新增 filter_ops_by_op_kernel 函数: 新增过滤函数,基于 check_op_has_op_kernel 从算子集合中筛选出存在 op_kernel 目录的算子,返回过滤后的算子集合。
  • build_package_commands 接入算子过滤: 在按 DEFAULT_FILTER_SOC 过滤之后,追加按 op_kernel 目录过滤;对被丢弃的算子打印警告信息(列出算子名称),若过滤后算子为空则回退到默认出包命令;同时更新该函数的文档注释,补充"仅保留存在 op_kernel 目录算子"的出包模式说明。
likedislike
不准确?
atomgit-bot
atomgit-bot
19 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
19 天前 添加了label:cann-cla/yes
songkai111成员
19 天前 评论:

compile

likedislike
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/ops-math 汤平川, 王林木 (2/2) 汤平川, 王林木 (2/1)

💡 Tip:

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

CLA Signature Pass

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

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

CLA Signature Pass

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

likedislike
Ssongkai111成员
19 天前 update merge request[project id: 7649531, iid: 4896, commit_id: f0ea8f18974c532b3d767669d365298167f7401b] virtual merging success
CANN-robotCANN-robot成员
19 天前 将yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,chenxingyu18,pingchuantang,llimwang,gubaocheng,andong_hw,xuejinghui,zhanw_coding设为评审人
CANN-robotCANN-robot成员
19 天前 将yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,chenxingyu18,pingchuantang,llimwang,gubaocheng,andong_hw,xuejinghui,zhanw_coding设为审查人
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
19 天前 评论:

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

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
UT_Test_experimental ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-20 21:22:56]    CI执行结束

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

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

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_precommit ❌ FAILED >>>>> >>>>>
likedislike
Ssongkai111成员
19 天前 update merge request[project id: 7649531, iid: 4896, commit_id: 8aa182339858b42db1e3855da89fa7b6f43281ea] virtual merging success
Ssongkai111成员
19 天前 强制推送  1 个提交:9b8fb7e2-feat(ci): 出包命令过滤无 op_kernel 目录的算子
Ssongkai111成员
19 天前 update merge request[project id: 7649531, iid: 4896, commit_id: 73dc5c6b115f53a6009dee738729f97690758b86] virtual merging success
CANN-robotCANN-robot成员
19 天前 删除了label:cann-cla/yes
CANN-robotCANN-robot成员
19 天前 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
19 天前 添加了label:api-check-pass
songkai111成员
19 天前 评论:

compile

likedislike
Ssongkai111成员
19 天前 update merge request[project id: 7649531, iid: 4896, commit_id: ec6166fd284c8ca8a47c9827e71f2843327c2e45] virtual merging success
CANN-robotCANN-robot成员
19 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-failed
CANN-robotCANN-robot成员
19 天前 删除了label:ci-pipeline-failedapi-check-pass
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
19 天前 评论:

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

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer ❌ FAILED >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
likedislike
CANN-robot
CANN-robot成员
19 天前 评论:

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

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>

[2026-08-20 21:25:48]    CI执行结束

likedislike
Ssongkai111成员
19 天前 修改了pull request 的描述
CANN-robotCANN-robot成员
19 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-failed
songkai111成员
19 天前 评论:

compile

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

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

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
UT_Test_experimental ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-20 21:36:41]    CI执行结束

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

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

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>

[2026-08-20 21:31:59]    CI执行结束

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
19 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-passed
TangPC
TangPC成员
19 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:approved
llimwang成员
19 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:lgtm
CANN-robotCANN-robot成员
19 天前 关闭了关联的issue
CANN-robotCANN-robot成员
19 天前 合入了pull request