Merged
docs: 完善QUICKSTART快速入门文档 #1235
docs: 完善QUICKSTART快速入门文档 #1235
Merged
ayuemoonAdd on Aug 5
ayuemoon
Aug 5

描述

完善 QUICKSTART.md 快速入门文档,补充环境配置说明和算子运行细节,帮助用户更快上手 CANN 算子开发。

具体改动:

  1. 添加 CANN 环境变量配置说明:编译前需 source set_env.sh,避免因找不到 ASCEND_HOME_PATH 导致编译失败
  2. 补充算子运行输出说明:加法输出说明第一个输入从 1.0 递增、第二个输入使用随机数种子 42;乘法输出补充每组结果等于两输入之积的说明
  3. 通用化 soc 参数:--soc=ascend910b → --soc=${soc_version},并添加取值说明,适配不同芯片型号
  4. 更新 msprof 命令:msprof → msprof op,添加算子基础信息打印说明和性能瓶颈提示
  5. 补充采集结果路径:说明结果保存在 OPPROF_* 文件夹,更新 msProf 文档链接

关联的Issue

https://gitcode.com/cann/ops-cv/issues/707

测试

文档更新

本次 PR 本身就是文档更新,修改文件:

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for ayuemoon's contribution.)
ayuemoonayuemoon
Aug 5 Created pull request, commit b73e2ea6
atomgit-bot
atomgit-bot
Aug 5 Comments:

变更摘要

此 PR 主要对 QUICKSTART 快速入门文档进行完善与修订,调整了文档结构并优化了部分说明内容,共计新增 23 行、删除 19 行,属于纯文档类变更。

主要改动

  • 文档内容优化:根据 PR 标题 docs: 完善QUICKSTART快速入门文档,对快速入门指南的内容进行了补充完善和精简调整,使文档更易于新用户上手。
  • 篇幅重新平衡:新增 23 行、删除 19 行,整体净增 4 行,表明在保留原有有效信息的基础上做了适度的补充说明,同时对冗余或过时的内容进行了删减。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Aug 5 Comments:

代码审查

审查总结

已审查文件:docs/QUICKSTART.md(共 1 个文件)

发现问题统计

优先级 数量 说明
P2 2 文档中两处对样例输入数据生成方式的描述与实际代码不符
P3 1 删除了 --soc 不匹配导致 error 161001 的排错提示

整体风险判断

中等风险。核心问题是文档新增的输入数据说明("递增序列 + 随机种子 42")与测试代码实际行为(常量 1.0)完全不一致,会直接误导用户对程序行为的理解。同时,原有的 --soc 参数不匹配排错指引被移除,降低了文档的可用性。其余变更(标题格式调整、msprof op 命令更新、CANN 环境变量提示补充)均为正向改进,无问题。

类型 数量
🔴 阻塞 0
🟡 建议 2

💬 仅评论

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Aug 5 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Aug 5 Comments:

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-cv ✅ 刘伟, 张磊 (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

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

likedislike
CANN-robot
CANN-robotCollaborators
Aug 5 Comments:

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Aug 5 Set zhou-qilong,rxtfeng,loov1,zhangzijie,zl_hw,liu-wei,pingchuantang,llimwang,gubaocheng as approver
CANN-robotCANN-robotCollaborators
Aug 5 Set zhou-qilong,rxtfeng,loov1,zhangzijie,zl_hw,liu-wei,pingchuantang,llimwang,gubaocheng as approver
ayuemoonayuemoon
Aug 5 Modify description of pull request
atomgit-bot
atomgit-botAug 5Start code review2
docs/QUICKSTART.md
Outdated
@@ -155,3 +157,3 @@
155157 ```
156158 
157-4. **成功标志**:输出结果变成乘法结果。
159+4. **成功标志**:输出结果变成乘法结果。每组结果应等于两个输入之积。输入数据仍沿用样例中的递增序列和固定随机数种子 42,请以实际运行值为准。
atomgit-bot
atomgit-botAug 5Comments:

🟡 Medium Priority

第 159 行新增描述:"输入数据仍沿用样例中的递增序列和固定随机数种子 42,请以实际运行值为准。"

与第 96 行的问题相同——实际测试代码 examples/add_example/examples/test_aclnn_add_example.cpp 中两个输入均以 std::vector<float>(2048, 1) 常量 1.0 填充,不存在递增序列和随机种子 42。此处位于"算子开发"章节,用户在修改核函数后重新验证,文档提示的输入生成方式与实际不符,同样会造成困惑。

建议:将描述修正为与实际代码一致,移除不存在的"递增序列和固定随机数种子 42"表述。

Suggestions
159
- 4. **成功标志**:输出结果变成乘法结果。每组结果应等于两个输入之积。输入数据仍沿用样例中的递增序列和固定随机数种子 42,请以实际运行值为准。
159
+ 4. **成功标志**:输出结果变成乘法结果。每组结果应等于两个输入之积。输入数据仍沿用样例中的常量 1.0 填充,请以实际运行值为准。
Apply suggestion
likedislike
Incorrect?
System
System MessageSystem
Aug 5 Comments:

changed this line on e6d315bd view diff detail

atomgit-bot
atomgit-botAug 5Start code review2
docs/QUICKSTART.md
Outdated
@@ -94,3 +96,1 @@
94-> **注意**:运行样例时需确保`--soc`参数与编译算子包时使用的`--soc`取值一致,否则可能报`error 161001`(如`aclnnXxxGetWorkspaceSize failed`)。如遇此错误,请回到[第2节](#2-编译addexample算子)核对`--soc`取值后重新编译安装。
95- 
96-预期输出:打印算子`AddExample`的加法计算结果,表明算子已成功部署并正确执行。
96+预期输出:打印算子`AddExample`的加法计算结果,表明算子已成功部署并正确执行。样例中第一个输入从 1.0 开始递增,第二个输入使用固定随机数种子 42 生成,因此请以实际运行值为准;每组结果应等于两个输入之和。
atomgit-bot
atomgit-botAug 5Comments:

🟡 Medium Priority

变更行(第 96 行)新增描述:"样例中第一个输入从 1.0 开始递增,第二个输入使用固定随机数种子 42 生成"。

实际测试代码 examples/add_example/examples/test_aclnn_add_example.cpp 中(第 99 行和第 106 行):

代码中不存在任何递增序列、随机数生成或 seed 42。文档描述与实际代码行为完全不一致。

同样的问题也存在于第 159 行的相同描述:"输入数据仍沿用样例中的递增序列和固定随机数种子 42"。

影响:用户阅读文档后会期望看到基于随机种子的可变输出,但实际运行结果全部为 1.0,造成困惑。同时用户在修改测试输入时可能误以为存在随机数逻辑而去寻找不存在的代码。

Suggestions
96
- 预期输出:打印算子`AddExample`的加法计算结果,表明算子已成功部署并正确执行。样例中第一个输入从 1.0 开始递增,第二个输入使用固定随机数种子 42 生成,因此请以实际运行值为准;每组结果应等于两个输入之和。
96
+ 预期输出:打印算子`AddExample`的加法计算结果,表明算子已成功部署并正确执行。样例中两个输入均以常量 1.0 填充,每组结果应等于两个输入之和。
Apply suggestion
likedislike
Incorrect?
System
System MessageSystem
Aug 5 Comments:

changed this line on e6d315bd view diff detail

ayuemoonayuemoon
Aug 5 Modify description of pull request
5 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Aug 5 Added label: cann-cla/yes
ayuemoon
ayuemoon
Aug 5 Comments:

compile

likedislike
ayuemoonayuemoon
Aug 5 Pre merge succeeded (commit_id: 57df15357f08989302b0340d934f647ef36e437b)
CANN-robotCANN-robotCollaborators
Aug 5 Added label: ci-pipeline-running
CANN-robot
CANN-robotCollaborators
Aug 5 Comments:

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

任务名称状态日志下载链接
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_X86_A5 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Pre ✅ 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_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-05 21:35:39]    CI执行结束

likedislike
CANN-robot
CANN-robotCollaborators
Aug 5 Comments:

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

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

[2026-08-05 21:30:02]    CI执行结束

likedislike
ayuemoonayuemoon
Aug 5 Pre merge succeeded (commit_id: 897ff2a286bf7f6f5806f181b2ab1b9060c187a8)
ayuemoonayuemoon
Aug 5 Force-pushed 1 commits:78b1ad56-docs: 完善QUICKSTART快速入门文档
ayuemoonayuemoon
Aug 5 Pre merge succeeded (commit_id: a8a4faf15b81d53e87af873d43d81f38aecfaea4)
CANN-robotCANN-robotCollaborators
Aug 5 Removed label: cann-cla/yes
CANN-robotCANN-robotCollaborators
Aug 5 Added label: cann-cla/yes
ayuemoon
ayuemoon
Aug 5 Comments:

compile

likedislike
ayuemoonayuemoon
Aug 5 Pre merge succeeded (commit_id: 688c2fc47266a5cab7d35cce8815be9a5c620b34)
CANN-robotCANN-robotCollaborators
Aug 5 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Aug 5 Added label: api-check-pass
CANN-robotCANN-robotCollaborators
Aug 5 Removed label: api-check-pass
CANN-robotCANN-robotCollaborators
Aug 5 Added label: ci-pipeline-running
CANN-robot
CANN-robotCollaborators
Aug 5 Comments:

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

任务名称状态日志下载链接
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_X86_A5 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Pre ✅ 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_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_harmony-infer-chs-cv ✅ SUCCESS
UT_Test_harmony-infer-cpro-cv ✅ SUCCESS
UT_Test_report_lcov ✅ SUCCESS

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

likedislike
CANN-robot
CANN-robotCollaborators
Aug 5 Comments:

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

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

[2026-08-05 21:37:40]    CI执行结束

likedislike
CANN-robotCANN-robotCollaborators
Aug 5 Added label: api-check-pass
CANN-robotCANN-robotCollaborators
Aug 5 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Aug 5 Added label: ci-pipeline-passed
ayuemoon
ayuemoon
Aug 6 Comments:

@liu-wei @zl_hw 求检视加分下

likedislike
liu-weiliu-weiCollaborators
Aug 6 Resolved final issue
liu-wei
liu-weiCollaborators
Aug 6 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Aug 6 Added label: approved
zl_hwCollaborators
Aug 6 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Aug 6 Added label: lgtm
CANN-robotCANN-robotCollaborators
Aug 6 Closed associated issue
CANN-robotCANN-robotCollaborators
Aug 6 Merged pull request