已合并
feat: 新增 cannsim 仿真一键运行脚本及 --noexec 编译选项 #2874
songkai111创建于 5月21日
feat: 新增 cannsim 仿真一键运行脚本及 --noexec 编译选项 #2874
已合并
songkai111创建于 5月21日
songkai111成员
5月21日

描述

新增 cannsim 仿真端到端运行脚本 scripts/ci/run_cannsim_example.sh,支持在 Ascend950 平台上对算子执行编译、安装、示例编译和 cannsim 仿真四阶段流程。同时在 build.sh 中新增 --noexec 选项,允许仅编译示例而不执行,便于交叉编译场景下将产物提供给 cannsim 使用。

改动原因

原有 build.sh --run_example 会编译后立即执行示例,无法满足交叉编译+cannsim 仿真的场景需求(目标平台无 NPU 硬件)。需要一个独立的脚本串联构建→安装→编译示例→cannsim 仿真的完整流程。

改动方法

  1. build.sh: 新增 --noexec 命令行选项,设置 ENABLE_UT_EXEC 变量控制是否执行编译产物;更新 usage 帮助信息。
  2. scripts/ci/run_cannsim_example.sh: 新增四阶段脚本(Stage 1 构建算子包 → Stage 2 安装算子包 → Stage 3 编译示例 --noexec → Stage 4 运行 cannsim 仿真),支持 --skip-build--skip-cannsim--gen-report--clean-j 等选项,并输出各阶段耗时统计。

关联的Issue

测试

  • 使用 bash build.sh --run_example <op> eager cust --noexec --vendor_name=custom 验证仅编译不执行功能正常
  • 使用 bash scripts/ci/run_cannsim_example.sh <op_name> 验证四阶段端到端流程
  • 使用 --skip-build--skip-cannsim--gen-report--clean 等选项验证各分支逻辑

文档更新

无文档文件变更,usage 帮助信息已在 build.sh 中更新。

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 songkai111 的贡献)
Ssongkai111成员
5月21日 创建了 pull request,commit b24aa638
CANN-robot
CANN-robot成员
5月21日 评论:

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
repo-cann/ops-math 周奇龙, wangrui_ (2/2) 周奇龙 (1/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-robotCANN-robot成员
5月21日 添加了label:cann-cla/yes
此处折叠了6条事件消息 查看更多
CANN-robotCANN-robot成员
5月21日 移除了审查人FelixTang7,zhangyuxiang0119
songkai111成员
5月21日 评论:

compile

likedislike
Ssongkai111成员
5月21日 update merge request[project id: 7649531, iid: 2874, commit_id: d081bab893a96ca9b8179f765f17cf629c663a9d] virtual merging success
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月21日 评论:

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

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

[2026-05-21 16:07:29]    CI执行结束

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

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

任务名称状态日志下载链接
codecheck ❌ FAILED codecheck sync failed
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_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_codestyle ⚠️ WARNING
codecheck_precommit ✅ SUCCESS >>>>>
likedislike
Ssongkai111成员
5月21日 修改标题为 “feat: 新增 cannsim 仿真一键运行脚本及 --noexec 编译选项”,原标题为“adapt new opbase submodel”
Ssongkai111成员
5月21日 修改了pull request 的描述
CANN-robotCANN-robot成员
5月21日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-failed
atomgit-bot
atomgit-bot
5月21日 评论:

代码审查

发现 1 个问题,均为中低优先级建议。

⚠️ 已识别到总体风险,但未成功提取行内评论,请以总体评估为准。

likedislike
songkai111成员
5月21日 评论:

compile

likedislike
Ssongkai111成员
5月21日 update merge request[project id: 7649531, iid: 2874, commit_id: 8784a8b3534f3190e4af7446b4030d3a55eeeb33] virtual merging success
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-failedapi-check-pass
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>>
Compile_harmony-infer ❌ FAILED >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
likedislike
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ❌ FAILED Backend timeout
antipoison ✅ SUCCESS >>>>>
codecheck_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_codestyle ❌ FAILED
codecheck_precommit ✅ SUCCESS >>>>>
likedislike
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-failed
songkai111成员
5月21日 评论:

compile

likedislike
Ssongkai111成员
5月21日 update merge request[project id: 7649531, iid: 2874, commit_id: 6873e1492f67393a71783f376b4e6c5d83c3b308] virtual merging success
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月21日 评论:

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

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

[2026-05-21 16:27:14]    CI执行结束

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

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_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_codestyle ⚠️ WARNING
codecheck_precommit ✅ SUCCESS >>>>>

[2026-05-21 16:20:52]    CI执行结束

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

/lgtm

likedislike
sunday成员
5月21日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5月21日 添加了label:lgtmapproved
CANN-robot
CANN-robot成员
5月21日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: 周奇龙.
Reviewers who wrote a comment of /lgtm are: 周奇龙, wangrui_.

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