已合并
test: add missing foreach ut coverage #4264
cazerozelrtc创建于 4月27日
test: add missing foreach ut coverage #4264
已合并
cazerozelrtc创建于 4月27日
cazerozelrtc
cazerozelrtc
4月27日

描述

修复 issue #2109 中 foreach 模块 UT 缺失扫描问题。

本次改动不涉及算子计算逻辑和 kernel 实现,主要处理 UT 路径和UT 覆盖。

主要修改:

  1. 将 issue 中列出的 12 个 foreach API UT 从 tests/ut/op_host 移动到 tests/ut/op_api

    • foreach_add_list
    • foreach_add_scalar
    • foreach_addcdiv_scalar
    • foreach_addcmul_scalar
    • foreach_div_scalar
    • foreach_maximum_scalar
    • foreach_minimum_scalar
    • foreach_mul_scalar
    • foreach_pow_scalar
    • foreach_round_off_number
    • foreach_sub_list
    • foreach_sub_scalar
  2. 为上述 12 个 tests/ut/op_api 目录补充 CMakeLists.txt,保证 test_aclnn_*_v2.cpp 能被 API UT 编译系统收集。

  3. foreach_utils 补充 infershape / tiling UT:

    • test_foreach_utils_infershape.cpp
    • test_foreach_utils_tiling.cpp

关联的Issue

关联 Issue #2109

测试

在 A2/910B3 环境,使用 ascend910b 验证 issue #2109 相关 foreach UT 范围。

编译命令:

bash build.sh -u --opapi --ophost \
  --ops=foreach_add_list,foreach_add_scalar,foreach_addcdiv_scalar,foreach_addcmul_scalar,foreach_div_scalar,foreach_maximum_scalar,foreach_minimum_scalar,foreach_mul_scalar,foreach_pow_scalar,foreach_round_off_number,foreach_sub_list,foreach_sub_scalar,foreach_utils \
  --soc=ascend910b --noexec -O0 -j8

执行结果:

nn_op_host_ut:63/63 通过
nn_op_api_ut:76/76 通过

文档更新

无文档更新。

类型标签

  • Bug修复
  • 新特性
  • 性能优化
  • 文档更新
  • 其他,请描述:UT 补充 / UT 路径规范化
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 cazerozelrtc 的贡献)
cazerozelrtccazerozelrtc
4月27日 创建了 pull request,commit b1bee9e3
cazerozelrtccazerozelrtc
4月27日 关联了issue:[Documentation|文档反馈]: [AI 识别] foreach 模块存在ut缺失的问题
CANN-robot
CANN-robot成员
4月27日 评论:

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


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
foreach 陈琦, 刘杰 (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

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

likedislike
CANN-robotCANN-robot成员
4月27日 添加了label:cann-cla/no
CANN-robotCANN-robot成员
4月27日 将crystalhu,yangyang016,fanqirui,zhou-qilong,zhajianqing123,chenqi317,liubo75,tangweiwei2,liujie12345678,Chen_HaoWen,wangyongguang,zhang-wu设为评审人
CANN-robotCANN-robot成员
4月27日 将crystalhu,zhou-qilong,zhajianqing123,chenqi317,liubo75,tangweiwei2,liujie12345678,Chen_HaoWen,wangyongguang,zhang-wu设为审查人
cazerozelrtccazerozelrtc
4月27日 update merge request[project id: 7665709, iid: 4264, commit_id: 6c9bbd1fbd852502d33208201e0a9b52d9366283] virtual merging success
cazerozelrtccazerozelrtc
4月27日 强制推送  1 个提交:6ed23522-test: add missing foreach ut coverage
cazerozelrtccazerozelrtc
4月27日 update merge request[project id: 7665709, iid: 4264, commit_id: 99160048c554c6c1da887995a484e7df1d51cdfe] virtual merging success
cazerozelrtc
cazerozelrtc
4月29日 评论:

/check-cla

likedislike
CANN-robotCANN-robot成员
4月29日 删除了label:cann-cla/no
CANN-robotCANN-robot成员
4月29日 添加了label:cann-cla/yes
cazerozelrtc
cazerozelrtc
5月8日 评论:

compile

likedislike
cazerozelrtccazerozelrtc
5月8日 update merge request[project id: 7665709, iid: 4264, commit_id: 7300ae0ff9b36f7563251bf65787a737d43db652] virtual merging success
CANN-robotCANN-robot成员
5月8日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月8日 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950 ✅ SUCCESS >>>>> >>>>>
Pre_Compile ✅ SUCCESS
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_950_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_950_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
ATK_Test_A2 ✅ SUCCESS

[2026-05-08 09:49:36]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
5月8日 评论:

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
anti_virus ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_style ✅ SUCCESS
pre-commit ✅ SUCCESS

[2026-05-08 09:46:03]    CI执行结束

likedislike
CANN-robotCANN-robot成员
5月8日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月8日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月8日 添加了label:ci-pipeline-passed
liujie12345678成员
5月8日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5月8日 添加了label:approved
chenqi317成员
5月14日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:lgtm
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
5月14日 评论:

The following label is not ready.

ci-pipeline-passed: The ci-pipeline-passed label is expired. Please compile again.

likedislike
chenqi317成员
5月14日 评论:

compile

likedislike
cazerozelrtccazerozelrtc
5月14日 update merge request[project id: 7665709, iid: 4264, commit_id: 973c0077b77a6cb34b69228e1d1dc5f4dc47bc17] virtual merging success
CANN-robotCANN-robot成员
5月14日 删除了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月14日 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950 ✅ SUCCESS >>>>> >>>>>
Pre_Compile ✅ SUCCESS
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_950_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_950_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
ATK_Test_A2 ✅ SUCCESS

[2026-05-14 15:30:53]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
5月14日 评论:

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

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

[2026-05-14 15:24:47]    CI执行结束

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
5月14日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: 陈琦, 刘杰.
Reviewers who wrote a comment of /lgtm are: 陈琦, 刘杰.

likedislike
CANN-robotCANN-robot成员
5月14日 关闭了关联的issue
CANN-robotCANN-robot成员
5月14日 合入了pull request