Merged
docs(pypto_pro): Document SK early-start API (SkCap, wait/set) and the superkernel example #7258
zhouqingheAdd on 9 days ago
docs(pypto_pro): Document SK early-start API (SkCap, wait/set) and the superkernel example #7258
Merged
zhouqingheAdd on 9 days ago
zhouqingheCollaborators
9 days ago

描述

SK 早启相关文档,代码变更见 !7275。

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for zhouqinghe's contribution.)
ZzhouqingheCollaborators
9 days ago Created pull request, commit 7a2eed5a
atomgit-bot
atomgit-bot
9 days ago Comments:

变更摘要

本 PR 为纯文档变更,将 SK(SuperKernel)早启(Early-Start)能力相关说明从代码变更中拆分独立提交。核心是新增 SK 子核任务间同步接口 wait_pre_task_end 与 set_next_task_start 的 API 文档(含产品支持情况、函数原型、force 编译期参数、配对使用约束与调用示例),在 JIT_compilation.md 中补充 sk_cap(pl.SkCap 能力位组合)与 schedmode 两个 JIT 参数的说明,并新增 examples/03_advanced/superkernel/ 中英文示例 README 及各级索引条目。

主要改动

  • 新增早启同步 API 文档: 新增 wait_pre_task_end.md 与 set_next_task_start.md,分别对应能力位 CAP_1_EARLY_START_WAIT 与 CAP_2_EARLY_START_SET,说明二者用于允许调用点前/后的指令与前序/后序子核并行,须成对使用且每核、每 TilingKey 分支只调用一次,force 默认为 True 并生成强制形式的 AscendC 调用。
  • 补充 sk_cap / schedmode 参数说明: 在 JIT_compilation.md 的 JIT 参数表中新增 sk_cap 与 schedmode,并列出 CAP_1~CAP_16 各能力位含义、__sk__ 入口与 SK_BIND 记录生成行为,以及 schedmode=1 参与融合时需配合 CAP_8_DISABLE_BATCHMODE_CHECK。
  • 新增 SuperKernel 示例文档: 新增 superkernel 目录中英文 README,描述基于 pypto_pro.language 的 SIMD(Tile)exp kernel 通过 sk_cap=pl.SkCap.CAP_4_DISABLE_DCCI_ALL 生成 SK 入口,并经 npugraph_ex + super_kernel_optimize 与 torch + 1.0 融合的运行方法与预期输出。
  • 更新文档与示例索引: 在 docs/zh/api/index_hiascend.md 与 synchronization/index.md 中加入两个新同步接口条目,并在 examples/03_advanced/README(_en).md、examples/README(_en).md 中增加 superkernel 样例入口,同时将高级样例目录描述扩展为 PyPTO 与 PyPTO Pro。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
9 days ago Comments:

代码审查

审查结论

问题统计: P0 × 0,P1 × 0,P2 × 1,P3 × 0。

逐文件审查情况:

  • docs/zh/api/index_hiascend.md:no issues(同步控制目录下新增两项导航,层级缩进、顺序与 synchronization/index.md toctree 顺序一致)
  • docs/zh/api/pro_api/SIMD-API/synchronization/index.md:no issues(新增 set_next_task_start / wait_pre_task_end 与目录实际文件一一对应)
  • docs/zh/api/pro_api/SIMD-API/synchronization/set_next_task_start.md:no issues(产品支持情况 的 npu 注释格式与同目录其他文档一致;参数表结构与 sync_all.md 等相同;能力位 2/CAP_2_EARLY_START_SET 与 JIT 文档表格一致;示例中 get_block_idx() + get_block_num() * get_subblock_num() 的切分与 get_block_idx.md 描述的纯 Vector 语义相符)
  • docs/zh/api/pro_api/SIMD-API/synchronization/wait_pre_task_end.md:no issues(对偶关系、能力位 1、force 默认值与另一篇互相呼应;../../../../guide/... 相对层级经解析可正确指向 docs/zh/guide/.../JIT_compilation.md)
  • docs/zh/guide/programming_guide/pro/development/compilation_and_execution/JIT_compilation.md:no issues(sk_cap / schedmode 与能力位表格内部一致,SIMT 不支持、CAP_8_DISABLE_BATCHMODE_CHECK 与 schedmode=1 的交叉表述互相吻合,未与其他文档产生冲突)
  • examples/03_advanced/README.md:1 处问题(第 37 行链接到不存在的 ./superkernel/superkernel.py,已并入下述报告)
  • examples/03_advanced/README_en.md:同上(英文版同样断链,已并入)
  • examples/03_advanced/superkernel/README.md:1 处问题(P2,已上报)
  • examples/03_advanced/superkernel/README_en.md:同上(英文版含相同的运行命令与链接,已并入)
  • examples/README.md:no issues(第 81 行缩进与相邻 03_advanced/... 条目一致,链接目标存在)
  • examples/README_en.md:no issues(同上)

整体风险判断: 本 PR 为纯文档变更,未引入可执行代码、配置、依赖或 CI 改动,不存在安全类风险(无 chmod 777、无关闭校验、无远程管道执行、无凭据泄露;示例仅使用标准 source .../set_env.sh 与 TILE_FWK_DEVICE_ID)。主要问题是新增的 SuperKernel 样例目录只有 README、缺少被反复引用并作为运行入口的 superkernel.py,导致索引断链且「执行脚本 / 预期输出」指引不可执行,建议与代码 MR 合并合入。另有一点审查限制需说明:工作区工具被限定在变更文件范围内,无法核实 sk_cap、schedmode、pl.system.wait_pre_task_end 等 API 在当前分支代码中是否已存在(PR 描述称对应实现位于 !7036),因此未就此提出结论。

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

💬 仅评论

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
9 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
9 days ago 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.
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
docs ✅ lyz0328, congqiannan, jason_yuan_ye (3/2) ✅ lyz0328 (1/1)
examples ✅ jason_yuan_ye, congqiannan (2/2) ✅ jason_yuan_ye (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
110 messages are collapsed here。 See more
CANN-robot
CANN-robotCollaborators
7 days ago Comments:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: congqiannan

likedislike
CANN-robotCANN-robotCollaborators
7 days ago Added label: lgtm
CANN-robot
CANN-robotCollaborators
7 days ago Comments:

The MR can not be merged, because of CodeReview discussion not resolved

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

likedislike
ZzhouqingheCollaborators
7 days ago Resolved final issue
CANN-robotCANN-robotCollaborators
7 days ago Merged pull request