已合并
Propagate `msprof` failures from `run_profiling.sh` #1167
KaranocaVe创建于 12 天前
Propagate `msprof` failures from `run_profiling.sh` #1167
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 KaranocaVe 的贡献)12 天前 创建了 pull request,commit 8b9f0a11
atomgit-bot
12 天前 评论:
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,不再继续执行其后的完成提示逻辑。


不准确?
atomgit-bot
12 天前 评论:
12 天前 评论:
12 天前 添加了label:cann-cla/yes
CANN-robot
12 天前 评论:
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
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


CANN-robot
12 天前 评论:
12 天前 评论:
12 天前 修改了pull request 的描述
KaranocaVe
12 天前 评论:
12 天前 评论:
/compile


12 天前 预合并成功(commit_id: cedab38c36ff68969020c95b3c5ece3aeff57f08)
CANN-robot
12 天前 评论:
12 天前 评论:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


12 天前 添加了label:ci-pipeline-running
CANN-robot
12 天前 评论:
12 天前 评论:
12 天前 删除了label:ci-pipeline-running
12 天前 添加了label:ci-pipeline-passed
12 天前 删除了label:ci-pipeline-passed
12 天前 添加了label:ci-pipeline-running
12 天前 删除了label:ci-pipeline-running
12 天前 添加了label:ci-pipeline-passed
9 天前 添加了label:approved
fuyangchenghu
9 天前 评论:
9 天前 评论:
/lgtm


9 天前 添加了label:lgtm
9 天前 合入了pull request
Propagate
msproffailures fromrun_profiling.sh描述
The profiling wrapper pipes
msprofoutput totailunderset -e, which hides the profiling command's non-zero exit status. Enablepipefailso failed captures stop the wrapper before its completion message.关联的Issue
This PR fixes the associated report about masked
msproffailures.测试
msprofexit code of 23 is propagated and the completion message is suppressed.bash -nandgit diff --checkpassed.文档更新
No documentation changes are needed for this script-only fix.
类型标签
其他信息
Profiling hardware and the real
msprofcommand were not run; the regression isolates shell pipeline exit handling.关联 Issue: https://gitcode.com/cann/cann-learning-hub/issues/812