已合并
[doc]:TTFHW需要在资料中增加约束性语言指导AI稳定执行 #391
孟广欣创建于 7月30日
[doc]:TTFHW需要在资料中增加约束性语言指导AI稳定执行 #391
已合并
孟广欣创建于 7月30日
孟广欣
孟广欣成员
7月30日

1. 修改描述

  • 修改原因: 产品线要求各产品的TTFHW能力要上线
  • 修改方案: 环境安装和编译过程为了让AI也能稳定执行,需要增加一些约束性语言指导AI
  • 修改内容: 增加一些约束性语言用于指导AI稳定执行

2. 功能验证


3. 代码检视

  • 要求:
    • 合入功能代码大于 200 行,需要sig会议申报代码检视议题,并在PR中标注会议。
    • committer评估是否需要在sig会议进行代码检视。
    • 参与检视的committer人员名单与检视时间。
    • 大于 1000 行代码原则上不允许合入,需进行备案。
  • 检视committer人员名单与检视时间:

4. 资料修改自检

  • 资料修改: 需要资料人员luyq11评审

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 孟广欣 的贡献)
孟广欣孟广欣成员
7月30日 关联了里程碑:MindStudio 26.2.0
孟广欣孟广欣成员
7月30日 关联了issue:[Doc]:资料问题修改
atomgit-bot
atomgit-bot
7月30日 评论:

变更摘要

本 PR 属于文档类变更,旨在为 TTFHW 相关文档资料增加约束性语言描述,以指导 AI 在环境安装和编译过程中稳定执行。修改主要聚焦于精简原有内容(删除 118 行),同时补充约束性指导说明(新增 60 行),使文档对 AI 的执行引导更加明确。

主要改动

  • 文档约束性语言补充:在 TTFHW 相关文档中新增约束性描述语句,明确环境安装与编译步骤的执行规范,确保 AI 能按预期稳定完成操作。
  • 文档内容精简:删除大量原有冗余或不必要的描述内容(净减少 58 行),使文档更聚焦于对 AI 的指导性约束。
likedislike
atomgit-bot
atomgit-bot
7月30日 评论:

代码审查

审查完成。现在提交关闭总结。


关闭总结

按优先级统计

优先级 数量
P0 0
P1 2
P2 0
P3 0

各文件审查结论

  • README.md:无问题。变更是将两条安装指引合并为一条指向安装指南的链接,属于合理的文档精简。
  • docs/zh/development_guide/development_guide.md:无问题。变更包括将 "MindStudio Profiler" 统一更名为 "msProf"、将开发环境配置节精简为指向安装指南的引用、以及扩充编译参数表(新增 --build_type--version 参数说明)。内容一致,无事实性错误。
  • docs/zh/install_guide/msprof_install_guide.md:发现 2 个 P1 问题,均为路径不一致——第 2.3.1 节克隆仓库到 ~/msprof,但第 2.3.2 节和第 2.3.3 节的编译/测试命令却使用了 cd ~/msdebugbuild.py 位于仓库根目录,在错误路径下执行会导致命令失败,阻塞用户安装流程。第 2.3.4 节正确引用了 ~/msprof/artifacts,确认 ~/msprof 为正确路径。

整体风险评估

本次变更的风险集中在安装指南的路径错误上——用户严格按照文档操作将无法完成源码编译。由于这是纯文档变更,不涉及运行时代码逻辑,修复成本低(两处路径替换),建议在合入前修正 ~/msdebug~/msprof

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

⛔ 需要修改

likedislike
ascend-robotascend-robot成员
7月30日 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
7月30日 评论:

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-Ascend/msprof 陈豪, 谢作孟 (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

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

likedislike
ascend-robot
ascend-robot成员
7月30日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
7月30日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
7月30日 评论:

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
7月30日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
7月30日 添加了label:docs-ci-pipeline-success
Mrtutu
Mrtutu成员7月30日进行代码检视3
docs/zh/install_guide/msprof_install_guide.md
已过期
@@ -88,0 +47,4 @@
47+保持在 `ctr_in.py` 打开的同一个交互式容器 Shell 中,在仓库根目录执行以下命令,自动完成依赖下载与构建:
48+ 
49+```bash
50+cd ~/msdebug
Mrtutu
Mrtutu7月30日评论:

严重程度: 严重

问题: 源码编译步骤的工作目录写成 ~/msdebug,但上一步克隆命令 git clone https://gitcode.com/Ascend/msprof.git 实际创建的目录是 ~/msprof,两者不一致。

原因: 该目录并不存在,执行 cd ~/msdebug 会直接报 “No such file or directory” 失败,构建无法继续。本 PR 的明确目标就是“为了让 AI 也能稳定执行”而增加约束性语言,但这条指令本身正是会阻断 AI 稳定执行的错误路径。同一节内还存在多处目录名不一致:2.3.1 克隆得到 ~/msprof、2.3.2 与 2.3.3 又要求 cd ~/msdebug、2.3.4 安装时又回到 cd ~/msprof/artifacts,三处目录名互相矛盾。

怎么改:
全文统一为 ~/msprof。2.3.2(第 50 行)与 2.3.3 单元测试(第 61 行)的 cd ~/msdebug 都应改为 cd ~/msprof,与克隆结果及 2.3.4 的 ~/msprof/artifacts 保持一致:

cd ~/msprof
python3 build.py
likedislike
孟广欣
孟广欣成员
7月31日 评论:

已修改

System
系统消息系统
7月31日 评论:

changed this line on 3d3a16c2 view diff detail

Mrtutu
Mrtutu成员7月30日进行代码检视1
docs/zh/development_guide/development_guide.md
@@ -75,30 +51,30 @@
7551 
7652### 4.1 获取代码
7753 
54+在上面编译容器中,执行如下命令获取代码:
55+ 
7856```bash
7957git clone https://gitcode.com/Ascend/msprof.git
8058cd msprof
@@ -88,13 +66,13 @@ bash scripts/download_thirdparty.sh
8866 
8967### 4.3 编译 run 包
9068 
91-`build/build.sh` 支持通过 `--mode` 指定编译内容:
69+msProf 工具 run 包的编译命令可配置如下参数。
9270 
93-| 模式 | 说明 |
94-| --- | --- |
95-| `all` | 编译包含采集和解析能力全量 run 包 |
96-| `collector` | 编译仅包含采集能run 包 |
97-| `analysis` | 编译仅包含解析能力的 run 包 |
71+| 参数 | 可选/必选 | 说明 |
72+| --- | --- | --- |
73+| `--build_type` | 可选 | 编译 run 类型,可取值:<br>&#8226; Release:编译出用于生产环境部署的软件包。<br>&#8226; Debug:编译出用于开发调试的软件包(只支持编译**解析**部分Debug 软件)。<br>默认值为 Release。 |
74+| `--mode` | 可选 | 编译 run 包方式,可取值:<br>&#8226; all:编译出包含 msProf 采集和解析功能的软件包。<br>&#8226; collector:编译出仅包含 msProf 采集能的软件包。<br>&#8226; analysis:编译出仅包含 msProf 解析功能的软件。<br>默认值为 analysis。 |
75+| `--version` | 可选 | 配置 run 包的版本号,用户自定义。<br>默认值为 none。 |
9876 
9977示例:
10078 
@@ -101,5 +79,5 @@
10179```bash
10280bash build/build.sh --mode=all --version=<version>
Mrtutu
Mrtutu7月30日评论:

严重程度: 建议

问题: 开发指南 4.3 节的参数表与示例仍以 bash build/build.sh 为入口、以 output/ 为产物目录,但本 PR 已将安装指南(开发指南第 3 节链接过去的环境准备来源)改为统一使用 python3 build.py、产物在 artifacts/,两份文档对同一编译步骤的描述出现分叉。

原因: 关键在于 build.py 并不接受 --mode/--build_type 参数(见 build.py 的 argparse 定义,仅支持 command/--version/--extra,且 --extra 仅打日志、未透传给 build.sh)。因此按安装指南执行 python3 build.py 时,build.sh 始终以默认 BUILD_MODE=analysis 运行,只能产出解析包,无法编译本节示例所强调的 --mode=all 全量包。读者/AI 跨文档跟随时会困惑,甚至误以为 python3 build.py --mode=all 可用(实际会报 unrecognized arguments)。

怎么改:
在 4.3 节说明推荐入口为 python3 build.py(与安装指南对齐),并明确:--mode/--build_type 是底层 build/build.sh 的参数;若需编译全量(all)或 collector 包,应直接调用 bash build/build.sh --mode=all,或评估在 build.py 中透传 --mode。同时将“产物在 output 目录”同步更新为 artifacts/,避免与安装指南再次分叉。

likedislike
Mrtutu
Mrtutu成员7月30日进行代码检视3
docs/zh/install_guide/msprof_install_guide.md
已过期
@@ -1,0 +1,3 @@
1-# msProf工具安装指南
1+# msProf 安装指南
2+ 
3+<br>
Mrtutu
Mrtutu7月30日评论:

严重程度: 提示

问题: 标题下方单独放了一个裸 <br> 标签。

原因: Markdown 中 H1 与正文之间的空行已能产生足够间距,额外用裸 <br> 既非必要也不够规范,在不同渲染器下行为可能不一致。

怎么改:
直接删除该 <br>,保留空行即可:

# msProf 安装指南

## 1. 安装说明
likedislike
孟广欣
孟广欣成员
7月31日 评论:

已修改

System
系统消息系统
7月31日 评论:

changed this line on 3d3a16c2 view diff detail

Mrtutu
Mrtutu成员7月30日进行代码检视3
README.md
已过期
@@ -51,3 +51,1 @@
51-msProf 工具内置在 CANN Toolkit 开发套件中,推荐直接下载 CANN 包进行安装,具体请参见《[CANN 快速安装](https://www.hiascend.com/cann/download)》。
52- 
53-如需通过源码编译方式安装,请参见 《[msProf 工具安装指南](docs/zh/install_guide/msprof_install_guide.md)》。
51+介绍工具的环境依赖与安装方法,请参见《[msProf 安装指南](docs/zh/install_guide/msprof_install_guide.md)》。
Mrtutu
Mrtutu7月30日评论:

严重程度: 提示

问题: “介绍工具的环境依赖与安装方法,请参见《msProf 安装指南》” 前半句“介绍……”是描述性从句,与后半句祈使“请参见”拼在一起,读起来像目录说明而非给用户的指引,句式偏别扭。

原因: 同文件第 55 行“工具的详细使用方法,请参见《msProf 使用指南》”用的是更通顺的“<名词短语>,请参见……”句式,本句与之一致更好。

怎么改:
去掉“介绍”或改为与下文一致的句式,例如:

工具的环境依赖与安装方法,请参见《[msProf 安装指南](docs/zh/install_guide/msprof_install_guide.md)》。
likedislike
孟广欣
孟广欣成员
7月31日 评论:

已修改

System
系统消息系统
7月31日 评论:

changed this line on 3d3a16c2 view diff detail

atomgit-bot
atomgit-bot7月30日进行代码检视2
docs/zh/install_guide/msprof_install_guide.md
@@ -99,0 +59,4 @@
59+ 
60+```bash
61+cd ~/msdebug
62+python3 build.py test
atomgit-bot
atomgit-bot7月30日评论:

🟠 High Priority

与第 2.3.2 节相同的问题:第 2.3.3 节"执行单元测试"(第 61 行)使用了 cd ~/msdebug,但仓库实际克隆路径为 ~/msprof(见第 2.3.1 节第 42 行)。build.py 在仓库根目录,在 ~/msdebug 下执行 python3 build.py test 会因找不到 build.py 而失败。第 2.3.4 节正确引用了 ~/msprof/artifacts,进一步确认正确路径为 ~/msprof

建议:同上,将 cd ~/msdebug 改为 cd ~/msprof

likedislike
孟广欣
孟广欣成员
7月31日 评论:

已修改

atomgit-bot
atomgit-bot7月30日进行代码检视2
docs/zh/install_guide/msprof_install_guide.md
@@ -88,0 +48,4 @@
48+ 
49+```bash
50+cd ~/msdebug
51+python3 build.py
atomgit-bot
atomgit-bot7月30日评论:

🟠 High Priority

安装指南第 2.3.1 节(第 42 行)将仓库克隆到 ~/msprofgit clone https://gitcode.com/Ascend/msprof.git 默认创建 msprof 目录),但第 2.3.2 节(第 50 行)和第 2.3.3 节(第 61 行)的编译和单元测试命令却使用了 cd ~/msdebugbuild.py 位于仓库根目录,其内部通过 Path(__file__).resolve().parent 确定项目根目录(第 49 行),因此必须在仓库目录内执行。第 2.3.4 节(第 74 行)正确引用了 cd ~/msprof/artifacts,进一步确认仓库路径为 ~/msprof

触发条件:用户严格按照安装指南操作时,在 ~/msdebug 目录下执行 python3 build.py 会因找不到 build.py 而失败。

影响:无法完成源码编译和单元测试,阻塞用户安装流程。

修复方向:将第 2.3.2 节(第 50 行)和第 2.3.3 节(第 61 行)的 cd ~/msdebug 统一修正为 cd ~/msprof

建议:将 cd ~/msdebug 改为 cd ~/msprof,使编译命令与第 2.3.1 节的克隆路径和第 2.3.4 节的 artifacts 路径保持一致。第 2.3.3 节的同一处也需要同步修改。

likedislike
孟广欣
孟广欣成员
7月31日 评论:

已修改

孟广欣孟广欣成员
7月31日 推送  1 个提交:3d3a16c2-dev
ascend-robotascend-robot成员
7月31日 添加了label:stat/needs-squash
孟广欣
孟广欣成员
7月31日 评论:

compile

likedislike
AtlasAccountAtlasAccount成员
7月31日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
7月31日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
7月31日 删除了label:docs-ci-pipeline-success
ascend-robot
ascend-robot成员
7月31日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
7月31日 添加了label:docs-ci-pipeline-running
AtlasAccountAtlasAccount成员
7月31日 删除了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
7月31日 添加了label:ci-pipeline-passed
AtlasAccount
AtlasAccount成员
7月31日 评论:
流水线 PR-pipeline_msprof#1319 [ commitID:3d3a16c2 ] 已完成
>>>代码风格自动修复执行失败,具体请查看日志,不影响流水线执行及PR合入
阶段 任务名 状态 详情
编译构建 Build_msprof_arm 🛑 >>>
Build_msprof_x86 🛑 >>>
恶意代码检查 Antipoison_msprof 🛑 >>>
编码安全与规范检查 codecheck_pre-commit 🛑 >>>
pre-commit 🛑 >>>
开源片段检查 SCA_msprof 🛑 >>>
开发者测试 UT_msprof 🛑 >>>
PreSmoke_msprof 🛑 >>>
流水线 PR-pipeline_msprof >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员[A1streomeria]评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
ascend-robot
ascend-robot成员
7月31日 评论:

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robot
ascend-robot成员
7月31日 评论:

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
7月31日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
7月31日 添加了label:docs-ci-pipeline-success
xzm123成员
7月31日 评论:

/lgtm

likedislike
MrtutuMrtutu成员
7月31日 解决了最后一个问题
chenhao_1209成员
7月31日 评论:

/approve

likedislike
ascend-robotascend-robot成员
7月31日 添加了label:approvedlgtm
ascend-robotascend-robot成员
7月31日 合入了pull request
ascend-robot
ascend-robot成员
7月31日 评论:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike