已合并
Propagate `msprof` failures from `run_profiling.sh` #1167
Propagate `msprof` failures from `run_profiling.sh` #1167
已合并
KaranocaVe创建于 12 天前
KaranocaVe
KaranocaVe
12 天前

Propagate msprof failures from run_profiling.sh

描述

The profiling wrapper pipes msprof output to tail under set -e, which hides the profiling command's non-zero exit status. Enable pipefail so failed captures stop the wrapper before its completion message.

关联的Issue

This PR fixes the associated report about masked msprof failures.

测试

  • A CPU stub regression confirmed that an msprof exit code of 23 is propagated and the completion message is suppressed.
  • The successful path still returns 0 and produces the expected report path.
  • bash -n and git diff --check passed.

文档更新

No documentation changes are needed for this script-only fix.

类型标签

其他信息

Profiling hardware and the real msprof command were not run; the regression isolates shell pipeline exit handling.

关联 Issue: https://gitcode.com/cann/cann-learning-hub/issues/812

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 KaranocaVe 的贡献)
KaranocaVeKaranocaVe
12 天前 创建了 pull request,commit 8b9f0a11
atomgit-bot
atomgit-bot
12 天前 评论:

变更摘要

本 PR 针对 contrib/tutorials/data_structures_compute/08_engineering_deployment_and_perf_analysis/src/attention_op/scripts/run_profiling.sh 的失败传播问题进行修复。该脚本在 set -e 下将 msprof 的输出通过管道交给 tail 处理,管道退出状态以最后一个命令为准,导致 msprof 的非零退出码被掩盖。变更将 set -e 调整为 set -eo pipefail,使管道中任一环节失败都能终止脚本,从而让 run_profiling.sh 正确反映性能采集命令的失败。

主要改动

  • 启用管道失败传播: 在脚本选项中加入 pipefail(set -e → set -eo pipefail),使管道中 msprof 的非零退出状态不再被管道末端命令覆盖,而能作为整个管道的退出码向上传播。
  • 保留原有退出即停语义: 修改保留 -e 选项,脚本在命令失败时仍会立即终止,行为范围仅限于管道场景的退出码判定。
  • 失败时中断后续流程: 由于退出码得以传播,msprof 采集失败会直接结束 run_profiling.sh,不再继续执行其后的完成提示逻辑。
likedislike
不准确?
atomgit-bot
atomgit-bot
12 天前 评论:

代码审查

✅ 未发现问题

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

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
repo-cann/cann-learning-hub ✅ waimaidaole, fuyangchenghu (2/2) ✅ waimaidaole (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robot
CANN-robot成员
12 天前 评论:

CLA Signature Pass

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

likedislike
KaranocaVeKaranocaVe
12 天前 修改了pull request 的描述
KaranocaVe
KaranocaVe
12 天前 评论:

/compile

likedislike
KaranocaVeKaranocaVe
12 天前 预合并成功(commit_id: cedab38c36ff68969020c95b3c5ece3aeff57f08)
CANN-robot
CANN-robot成员
12 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
12 天前 评论:

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

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
pre-commit ✅ SUCCESS

[2026-10-05 07:15:42]    CI执行结束

likedislike
CANN-robotCANN-robot成员
12 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-passed
CANN-robotCANN-robot成员
12 天前 删除了label:ci-pipeline-passed
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
12 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-passed
meme成员
9 天前 评论:

/approve

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

/lgtm

likedislike
CANN-robotCANN-robot成员
9 天前 添加了label:lgtm
CANN-robotCANN-robot成员
9 天前 合入了pull request