| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
typo-fix + eof: correct misspellings/rename identifiers (codespell/typos) and fix missing EOF newlines Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1337 merge master into master typo-fix + eof: correct misspellings/rename identifiers (codespell/typos) and fix missing EOF newlines Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 全仓拼写清理 + EOF 换行归一——新增 typos.toml(typos 工具配置)扫描源码拼写并据此修正字符串/注释/文档拼写,将拼错的内部标识符(命名空间、include guard、函数/变量名)一并改名;codespell -L 白名单扩展领域词;含文件名修正及少量 ruff 无用 import 清理。另补 41 个文件缺失的末行换行(end-of-file-fixer)。compatiable 作为外部 CANN-cmake 依赖文件名保留并加白名单。 ## 描述 158 文件 +323/−310,拼写归一,**含标识符 rename(非纯格式化)**: - **配置**:新增 typos.toml(领域词/短标识符白名单:nd/cann/subtile/fo/adn/eles/ands/tbe/typ/pn/binar/alog/mis/vitaliy/compatiable、SUBTILE/SUBTILES);.pre-commit-config.yaml 仅扩展 codespell -L 白名单(+fo/adn/eles/binar/mis/compatiable),--skip *.py/*.cpp/*.hpp/*.c/*.h 不变(源码拼写由 typos 工具负责)。 - **标识符 rename**(内部符号,同文件/编译单元内调用点同步更新): - 命名空间 TMatmulInternel→TMatmulInternal、TCvtInternel→TCvtInternal - include guard EXTENTION_CSRC_UTILS_H→EXTENSION_*、ELEMENT_TILE_SCLAR_OP_HPP→...SCALAR... - 函数 ReachExhaused/WriteExhaused→...Exhausted、complate_s32/s16_data→complete_* - 变量 vaild/Vaild→valid/Valid(77 处,主体)、fpAddres→fpAddress、enbleCountMode→enableCountMode、NeetCntDstIdx→NeedCntDstIdx、paramter→parameter - **字符串/注释/文档拼写**:convertion→conversion、Unsupport→Unsupported、ony→only、Undelying→Underlying、Indicies→Indices、differnent→different、Iteraions→Iterations、Simpify→Simplify、addressess→addresses、particulary→particularly、seperate→separate、accross→across(.md 中英双语同步)。 - **文件名修正**:图 permuate_all2all_count.png→permute_all2all_count.png。 - **EOF 换行归一(end-of-file-fixer)**:41 个文件补缺失末行 \n——本 PR 涉及的 ElementOp.h、tcmp(s)/gen_data.py、kirinDev0000 5 个 main.cpp(10)+ 全仓其余 kirinDev0000 testcases 与 tinterleave(31);多尾随换行 0。 - **compatiable**:外部依赖 version_compatiable.inc 路径改名已撤回,改为白名单(须与依赖方拼写一致)。 - **ruff**:删少量无用 import(shutil、Tuple)。 ## 关联的Issue ## 测试 - **标识符一致性**:各 rename 均在所在文件内同步更新定义与调用点,行为不变。 - **白名单收敛**:typos.toml/codespell -L 已收录全部领域词与外部依赖名,避免误报。 - **EOF 验证**:全仓复扫缺/多末行换行均 0;pre-commit run end-of-file-fixer --all-files Passed(CI 等价)。 - ⚠️ 含标识符 rename(非纯格式化),本机无 CANN/CPU-sim 工具链未做编译/单测;建议可编译环境跑一次 build + 测试复核(重点确认 namespace/guard/valid 系列无外部引用残留)。 - **改动量**:158 文件 +323/−310(.cpp 77 / .hpp 34 / .py 24 / .md 9 / .h 7 / .sh 4 / .yaml 1 / .toml 1 / .png 1)。 ## 文档更新 .md 仅修正拼写(中英双语),无内容/结构改动。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [x] 其他,请描述:全仓拼写清理(codespell/typos 修正拼写、rename 拼错标识符、新增 typos.toml)+ EOF 末行换行归一(end-of-file-fixer,41 文件);外部依赖名 compatiable 加白名单保留。 See merge request: cann/pto-isa!1337 | 27 天前 | |
typo-fix + eof: correct misspellings/rename identifiers (codespell/typos) and fix missing EOF newlines Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1337 merge master into master typo-fix + eof: correct misspellings/rename identifiers (codespell/typos) and fix missing EOF newlines Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 全仓拼写清理 + EOF 换行归一——新增 typos.toml(typos 工具配置)扫描源码拼写并据此修正字符串/注释/文档拼写,将拼错的内部标识符(命名空间、include guard、函数/变量名)一并改名;codespell -L 白名单扩展领域词;含文件名修正及少量 ruff 无用 import 清理。另补 41 个文件缺失的末行换行(end-of-file-fixer)。compatiable 作为外部 CANN-cmake 依赖文件名保留并加白名单。 ## 描述 158 文件 +323/−310,拼写归一,**含标识符 rename(非纯格式化)**: - **配置**:新增 typos.toml(领域词/短标识符白名单:nd/cann/subtile/fo/adn/eles/ands/tbe/typ/pn/binar/alog/mis/vitaliy/compatiable、SUBTILE/SUBTILES);.pre-commit-config.yaml 仅扩展 codespell -L 白名单(+fo/adn/eles/binar/mis/compatiable),--skip *.py/*.cpp/*.hpp/*.c/*.h 不变(源码拼写由 typos 工具负责)。 - **标识符 rename**(内部符号,同文件/编译单元内调用点同步更新): - 命名空间 TMatmulInternel→TMatmulInternal、TCvtInternel→TCvtInternal - include guard EXTENTION_CSRC_UTILS_H→EXTENSION_*、ELEMENT_TILE_SCLAR_OP_HPP→...SCALAR... - 函数 ReachExhaused/WriteExhaused→...Exhausted、complate_s32/s16_data→complete_* - 变量 vaild/Vaild→valid/Valid(77 处,主体)、fpAddres→fpAddress、enbleCountMode→enableCountMode、NeetCntDstIdx→NeedCntDstIdx、paramter→parameter - **字符串/注释/文档拼写**:convertion→conversion、Unsupport→Unsupported、ony→only、Undelying→Underlying、Indicies→Indices、differnent→different、Iteraions→Iterations、Simpify→Simplify、addressess→addresses、particulary→particularly、seperate→separate、accross→across(.md 中英双语同步)。 - **文件名修正**:图 permuate_all2all_count.png→permute_all2all_count.png。 - **EOF 换行归一(end-of-file-fixer)**:41 个文件补缺失末行 \n——本 PR 涉及的 ElementOp.h、tcmp(s)/gen_data.py、kirinDev0000 5 个 main.cpp(10)+ 全仓其余 kirinDev0000 testcases 与 tinterleave(31);多尾随换行 0。 - **compatiable**:外部依赖 version_compatiable.inc 路径改名已撤回,改为白名单(须与依赖方拼写一致)。 - **ruff**:删少量无用 import(shutil、Tuple)。 ## 关联的Issue ## 测试 - **标识符一致性**:各 rename 均在所在文件内同步更新定义与调用点,行为不变。 - **白名单收敛**:typos.toml/codespell -L 已收录全部领域词与外部依赖名,避免误报。 - **EOF 验证**:全仓复扫缺/多末行换行均 0;pre-commit run end-of-file-fixer --all-files Passed(CI 等价)。 - ⚠️ 含标识符 rename(非纯格式化),本机无 CANN/CPU-sim 工具链未做编译/单测;建议可编译环境跑一次 build + 测试复核(重点确认 namespace/guard/valid 系列无外部引用残留)。 - **改动量**:158 文件 +323/−310(.cpp 77 / .hpp 34 / .py 24 / .md 9 / .h 7 / .sh 4 / .yaml 1 / .toml 1 / .png 1)。 ## 文档更新 .md 仅修正拼写(中英双语),无内容/结构改动。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [x] 其他,请描述:全仓拼写清理(codespell/typos 修正拼写、rename 拼错标识符、新增 typos.toml)+ EOF 末行换行归一(end-of-file-fixer,41 文件);外部依赖名 compatiable 加白名单保留。 See merge request: cann/pto-isa!1337 | 27 天前 | |
feature: 适配A2A3场景的算子性能仿真 Co-authored-by: kay<kaywang@zju.edu.cn> # message auto-generated for no-merge-commit merge: !1004 merge feature_perf_sim_a2a3 into master feature: 适配A2A3场景的算子性能仿真 Created-by: XingkaiWang Commit-by: kay Merged-by: cann-robot Description: ## 描述 本 PR 新增 **A2/A3** 场景下的 perf-sim 算子性能仿真能力,用于在 CPU 侧对 PTO 算子进行指令级性能建模与可视化分析。该能力可以在不依赖真实 NPU 执行的情况下,输出算子的 pipeline 执行时序、同步依赖、总周期估计和各 pipeline 利用情况,便于开发阶段快速评估算子性能和定位瓶颈。 **主要能力包括:** 新增 perf-sim 运行框架,支持通过 LAUNCH_KERNEL 启动算子级性能仿真。 支持记录 PTO 指令、同步事件和跨 pipeline 依赖关系。 支持生成 Chrome Trace/Perfetto 可视化 JSON,用于查看 AIC/AIV pipeline 时序和依赖流。 支持生成 pipeline_summary.csv,按 core 和 AIC / AIV0 / AIV1 维度汇总 total cycles、active cycles 和各 pipeline busy cycles。 支持 1AIC-2AIV 架构建模,覆盖 A2/A3 上 AIC 与两个 AIV 的协同执行形态。 接入 FA 等复杂算子用例,用于验证多轮迭代、AIC/AIV 并发和多核场景下的仿真能力。 完善 trace track 命名与排序,提升 Perfetto 查看体验。 同时,本 PR 在 FA 场景中对 1C2V 同步关系、AIV0/AIV1 指令归属和多轮迭代依赖传播进行了校验和修正,确保 perf-sim 生成的执行形态与 CAModel 结果在大逻辑上保持一致。 **目前已知问题或尚未支持的功能:** 1. 部分PTO ISA指令精度较差导致整体E2E时间有所偏差(搬运类为主) 2. Scalar Pipeline无精细化建模,仅补充调用逻辑 3. 与计算具体值相关的操作后续需要结合CPU_SIM功能仿真开发,尚未支持 4. L2 Cache的缓存命中仅预留接口,尚未实现详细逻辑 ## 关联的Issue https://gitcode.com/cann/pto-isa/issues/386 ## 测试 已完成以下验证: 运行 fa_perf_sim 全量用例,覆盖单核、多核和长序列 FA 场景。 验证 perf-sim 可正常生成 JSON trace 和 pipeline_summary.csv。 使用 Perfetto 打开生成的 trace,确认 AIC/AIV pipeline 展示、track 排序和依赖关系可读。 与 CAModel trace 对比,确认 1AIC-2AIV 场景下 AIC/AIV 并发关系、AIV0/AIV1 对称性和多核负载形态基本一致。 检查 summary CSV,确认 AIC、AIV0、AIV1 分行统计符合 1C2V 架构预期。 ## 文档更新 新增和更新 perf-sim 相关文档,包括: perf-sim 中文用户使用指南 perf-sim 英文用户使用指南 perf-sim 实现逻辑说明文档 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1004 | 2 个月前 | |
fix: keep SDMA host headers CPU-safe Co-authored-by: Youhezhen<youhezhen@huawei.com> # message auto-generated for no-merge-commit merge: !1424 merge fix/sdma-host-header into master fix: keep SDMA host headers CPU-safe Created-by: Youhezhen Commit-by: Youhezhen Merged-by: cann-robot Description: ## 背景 本 MR 为 [hw-native-sys/simpler#1644](https://github.com/hw-native-sys/simpler/pull/1644) 提供可固定依赖的 PTO-ISA revision,解决以下问题: 1. host 侧 SDMA workspace manager 间接包含 device-only 类型,导致普通 C++ host 编译失败; 2. CPU simulator 会无条件补齐 CUBE/VECTOR 两种角色,使显式的单角色编译同时启用两套实现并产生重复定义; 3. CPU stub 缺少设备侧已有的 dcci_dst_t 类型,三参数 dcci 调用无法在 CPU simulator 编译; 4. 仓库中存在仅大小写不同的 TADDDEQRELU.* / TAddDeqRelu.* 路径,macOS 的大小写不敏感文件系统会让 checkout 持续处于 dirty 状态。 ## 修改说明 ### 1. 将 SDMA workspace 常量拆到 host-safe header 涉及文件: - include/pto/comm/async_common/sdma_constants.hpp - include/pto/comm/async_common/async_types.hpp - include/pto/comm/async/sdma/sdma_workspace_manager.hpp **为什么改:** sdma_workspace_manager.hpp 是 host 侧代码,实际只需要 workspace 大小常量;原先包含 async_types.hpp 会同时引入 __gm__、__ubuf__ 等 device-only 类型和定义,扩大 host 编译依赖并触发编译错误。 **怎么改:** 新增只依赖 <cstdint> 的轻量 header,将四个 workspace layout 常量移入其中;device 侧的 async_types.hpp 继续包含该 header,host manager 则直接包含它。 diff -#include "pto/comm/async_common/async_types.hpp" +#include "pto/comm/async_common/sdma_constants.hpp" cpp // sdma_constants.hpp:host/device 均可安全包含 constexpr uint32_t kSdmaContextWorkspaceBytes = 16U * 1024U; constexpr uint32_t kSdmaFlagPayloadBytesPerGroup = 512U; constexpr uint32_t kSdmaMaxChannelGroups = 48U; constexpr uint32_t kSdmaWorkspaceBytes = kSdmaContextWorkspaceBytes + kSdmaMaxChannelGroups * kSdmaFlagPayloadBytesPerGroup; 这样不改变常量的 namespace、名称或计算方式,只切断 host header 对 device 类型定义的依赖。 ### 2. 保留 CPU simulator 显式选择的执行角色 涉及文件:include/pto/common/arch_macro.hpp **为什么改:** 原逻辑在定义 __CPU_SIM 后,会分别补齐缺失的 __DAV_CUBE__ 和 __DAV_VEC__。因此调用方即使显式指定 CUBE-only 或 VECTOR-only,另一个角色仍会被自动打开,同一翻译单元可能同时编译两套 role-specific 实现并产生重复定义。 **怎么改:** 仅当两种角色都未指定时,才保留 PTO standalone CPU tests 所需的双角色默认值;只要调用方已经指定任意一种角色,就原样保留。 diff -#if defined(__CPU_SIM) -#ifndef __DAV_CUBE__ +#if defined(__CPU_SIM) && !defined(__DAV_CUBE__) && !defined(__DAV_VEC__) #define __DAV_CUBE__ -#endif -#ifndef __DAV_VEC__ #define __DAV_VEC__ #endif -#endif 结果是: - 未指定角色:仍同时提供 CUBE/VECTOR stub,保持现有 PTO CPU tests 行为; - 显式指定 CUBE:只编译 CUBE; - 显式指定 VECTOR:只编译 VECTOR。 ### 3. 补齐 CPU simulator 的 dcci_dst_t 涉及文件:include/pto/common/cpu_stub.hpp **为什么改:** device 代码可使用 dcci_dst_t::CACHELINE_OUT 作为三参数 dcci 的 destination mode,但 CPU stub 只有 cache_line_t 和三参数函数签名,没有对应类型,导致同一份 kernel 在 CPU simulator 编译失败。 **怎么改:** 在 CPU stub 中增加与 device API 同名的最小占位类型;其值保持为 0,符合 simulator 中 cache 操作为 no-op 的既有语义。 cpp struct dcci_dst_t { static constexpr int CACHELINE_OUT = 0; }; 这只补齐编译期接口,不改变 CPU simulator 的运行时 cache 行为。 ### 4. 删除 macOS 上发生大小写碰撞的重复文档路径 涉及路径: text 删除:docs/figures/isa/TADDDEQRELU.svg 删除:docs/isa/TADDDEQRELU.md 删除:docs/isa/TADDDEQRELU_zh.md 保留:docs/figures/isa/TAddDeqRelu.svg 保留:docs/isa/TAddDeqRelu.md 保留:docs/isa/TAddDeqRelu_zh.md **为什么改:** 两组文件在 Linux 上可共存,但在默认大小写不敏感的 macOS 文件系统上会映射到同一路径。checkout 后 Git 会持续报告伪修改;并发准备 PTO-ISA checkout 时还可能反复重建目录,最终表现为随机缺少 header。 **怎么改:** 保留与 docs/isa/manifest.yaml 中 instruction: TAddDeqRelu 一致、且被当前文档引用的 CamelCase 路径,删除旧的全大写重复路径。指令 C++ 名称 TADDDEQRELU 不变,仅规范文档文件名。 ## 兼容性 - SDMA workspace 常量的名称、值和 namespace 均未改变; - CPU simulator 未显式选择角色时的默认行为未改变; - NPU/device 实现和 TADDDEQRELU 指令接口未改变; - 文档内容仍由 canonical TAddDeqRelu.* 文件保留。 ## 验证 - GitCode pipeline:17/17 通过; - PTO-ISA full CPU simulator suite(GCC 15):通过; - Simpler ep_dispatch_combine:a2a3sim、a5sim 通过; - Simpler profiling flags smoke:2 个架构 × 6 组配置通过; - case-fold 路径冲突扫描:0 个冲突; - pre-commit:除本机 /tmp OAT 安装锁权限问题外其余 hooks 通过,OAT 及全部检查已由远端 pipeline 复验通过。 See merge request: cann/pto-isa!1424 | 6 天前 | |
A5 tinsert zn->zn Co-authored-by: ssreddy<sarveswara.reddy.sathi@huawei.com> # message auto-generated for no-merge-commit merge: !1459 merge master into master A5 tinsert zn->zn Created-by: ssreddy Commit-by: ssreddy Merged-by: cann-robot Description: ## 描述 A5 TInsert ZN -> ZN ## 关联的Issue NA ## 测试 all ST PASS ## 文档更新 docs updated ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1459 | 5 小时前 | |
Repo-wide pre-commit: strip trailing whitespace and normalize EOF newlines Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1320 merge master into master Repo-wide pre-commit: strip trailing whitespace and normalize EOF newlines Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhhywang Commit-by: zhhywang Merged-by: cann-robot Description: 全仓跑 trailing-whitespace + end-of-file-fixer:剥离行尾空白、补缺失末行换行、删多余尾随空行;零逻辑/语义变更,覆盖 tests/docs/include/kernels/demos 及 .py/.md/.sh/.js。 ## 描述 全仓 pre-commit 自动修复扫描,**仅做空白与行尾归一,零逻辑变更**: - **行尾空白**:剥离行末多余空格/制表符(主体;.cpp/.hpp/.h/.md/.py/.sh/.js 全覆盖)。 - **文件尾换行**:补缺失末行换行(多处 \ No newline at end of file)、删多余尾随空行,统一单换行结尾。 git diff -w 仅余 250 文件(皆为 EOF 换行/空行修复,-w 不抑制空行变更),其余 ~903 文件纯行尾空白;逐类抽样(.cpp/.hpp/.py/.md/setup.py/SKILL.md)均为空白归一,无 token 变化。 ## 关联的Issue ## 测试 - **空白归一收敛**:git diff -w --stat = 250 文件 +46/−365;抽样 .cpp 文件 -w diff 为空(纯行尾空白)。 - **无逻辑变更**:无标识符 rename、无代码增删,仅空白/换行。 - ⚠️ 未做编译验证(本机无 CANN/CPU-sim 工具链);空白不改语义,建议可编译环境跑一次 build 复核。 - **改动量**:1153 文件,+15054 / −15373(.cpp 634 / .md 298 / .hpp 175 / .py 18 / .sh 13 / .h 12 / .js 3)。 ## 文档更新 无文档内容改动;.md 仅为行尾空白/EOF 换行归一。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:全仓 pre-commit 空白归一——trailing-whitespace + end-of-file-fixer,清理行尾空白、统一末行换行;零逻辑变更。 See merge request: cann/pto-isa!1320 | 28 天前 | |
docs: refine ISA doc wording/terminology and rename header-library description Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1370 merge master into master docs: refine ISA doc wording/terminology and rename header-library description Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 对 docs/ 下文档统一润色措辞与术语,重命名头/库文件说明文档,并新增其菜单标题页与两级菜单项。纯文档修改,无源码/配置改动。 ## 描述 10 文件 +15/−12,全为 .md(8 文档润色/重命名 + 2 菜单文件): - **重命名与文档修订**:docs/PTO-ISA-External-Header-and-Library-Description.md → docs/PTO-ISA-Header-and-Library-Description.md,标题简化为「头文件和库文件说明」;将该文档「矩阵级访存」统一改为「不规则访存」,并补充说明 M 前缀表示 memory(如 MGATHER/MSCATTER)。 - **菜单项**:新增菜单标题页 docs/menu/header_and_library_zh.md(一级标题「头文件和库文件说明」,与其它 menu/*.md 一致);并在 docs/menu_ops_development.md 按两级结构挂入该文档——父级 [头文件和库文件说明](menu/header_and_library_zh.md)、叶子 [头文件和库文件说明](PTO-ISA-Header-and-Library-Description.md)。 - **术语规范化**:钳制 → 限制(MGATHER_zh、MSCATTER_zh);分块 → 分形(TROWEXPANDMIN_zh);修正笔误「手握手」→「握手」(MSCATTER_zh)。 - **语法修正(英文)**:only support → only supports(TFMODS、TREMS)。 - **约束描述重写**:TFILLPAD.md / TFILLPAD_zh.md 重写 Mat 类型重载的约束描述,更清晰说明该重载与首条 Vec 重载分属不同 SFINAE 重载、二者不矛盾。 ## 关联的Issue ## 测试 - **纯文档修改**,无代码/构建产物变更,无需编译/单测。 - **一致性**:术语与措辞调整全仓统一应用;产品名、芯片型号、路径、arch 等不在本次润色范围(正确未改)。 - **改动量**:10 文件 +15/−12(.md only);含 1 个新增文件 docs/menu/header_and_library_zh.md、1 个重命名文件。 ## 文档更新 仅修正文档措辞、术语与约束描述,补充菜单项,无内容/结构改动。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1370 | 19 天前 | |
lint+license: reformat with ruff/clang-format and normalize CANN OSL v2.0 headers Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1333 merge master into master lint+license: reformat with ruff/clang-format and normalize CANN OSL v2.0 headers Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 全仓 pre-commit 扫描——ruff format/black 与 clang-format 重排代码格式(零逻辑变更),并将源文件 License 头统一归一到 CANN Open Software License v2.0 全文(补缺失头、V1.0 升 V2.0、订正 "under the terms and conditions" 措辞),另补 .gitignore 忽略项。 ## 描述 63 文件 +1753/−1082,两类自动修复,**核心无逻辑/语义变更**: - **License 头归一(→ CANN OSL v2.0 全文)**: - 补缺失头: pyproject.toml、kernels/manual/a2a3/dispatch_mega_combine/main.cpp 等新增标准版权块。 - 升级旧头:run.sh 等 "a part of the CANN Open Software / Version 1.0" 短头 → v2.0 全文。 - 订正措辞:under terms and conditions of → under the terms and conditions of(21 处)。 - **代码格式化(零逻辑)**: - Python(54 文件,ruff format/black):多行函数调用折叠为单行、容器/字符串换行重排(docs/tools、kernels/tests 脚本为主)。 - C++(4 .cpp + 1 .hpp,clang-format):引用符号 &/* 贴类型、空体函数合并、长参数换行。 - **配置**:.gitignore 增 oat_reports/、log/;setup.py 补空行。 抽样 docs/tools/normalize_isa_docs.py、TPairReduceSum.hpp、tests/.../gen_data.py 均为格式/license 文本变更,无标识符 rename、无代码增删。 ## 关联的Issue ## 测试 - **格式化零逻辑**:Python 仅换行重排、C++ 仅 & 贴类型与换行;无语句增删、无标识符变化。 - **License 合规**:新增/升级头文本与仓内既有 v2.0 头一致;OAT 扫描头数应上升。 - ⚠️ 未做编译/单测验证(本机无 CANN/CPU-sim 工具链);格式化不改语义,建议可编译环境跑一次 build + 测试复核。 - **改动量**:63 文件 +1753/−1082(.py 54 / .cpp 4 / .sh 2 / .hpp 1 / .toml 1 / .gitignore 1)。 ## 文档更新 无文档内容改动;仅 License 头文本归一。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [x] 其他,请描述:全仓 pre-commit 清理——代码格式化(ruff format + clang-format)与 CANN OSL v2.0 License 头归一,零逻辑变更。 See merge request: cann/pto-isa!1333 | 27 天前 | |
fix: normalize cache line constants and CPU sim edge cases Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1415 merge github into master fix: normalize cache line constants and CPU sim edge cases Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 统一 dcci cache line 参数为 cache_line_t::...,并修复 CPU 仿真初始化、TWait 调度识别和 TStore 越界写回问题。 ## 描述 42 文件 +88/-82: - **范围**:通信/同步头文件、CPU/costmodel stub、manual kernels、NPU ST 测试及相关文档。 - **接口同步**:SINGLE_CACHE_LINE/ENTIRE_DATA_CACHE 改为 cache_line_t::SINGLE_CACHE_LINE/cache_line_t::ENTIRE_DATA_CACHE。 - **CPU 仿真修复**:host malloc 改为零初始化;TStoreAcc 跳过无效行列;TWait 增加 _jit_l3_mtp_decode_layer_ 进度感知识别。 ## 关联的Issue ## 测试 - 未运行编译/单测;本次仅根据当前 staged diff 整理 commit message。 ## 文档更新 同步更新 cache line 参数写法相关说明。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1415 | 9 天前 | |
typo-fix + eof: correct misspellings/rename identifiers (codespell/typos) and fix missing EOF newlines Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1337 merge master into master typo-fix + eof: correct misspellings/rename identifiers (codespell/typos) and fix missing EOF newlines Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 全仓拼写清理 + EOF 换行归一——新增 typos.toml(typos 工具配置)扫描源码拼写并据此修正字符串/注释/文档拼写,将拼错的内部标识符(命名空间、include guard、函数/变量名)一并改名;codespell -L 白名单扩展领域词;含文件名修正及少量 ruff 无用 import 清理。另补 41 个文件缺失的末行换行(end-of-file-fixer)。compatiable 作为外部 CANN-cmake 依赖文件名保留并加白名单。 ## 描述 158 文件 +323/−310,拼写归一,**含标识符 rename(非纯格式化)**: - **配置**:新增 typos.toml(领域词/短标识符白名单:nd/cann/subtile/fo/adn/eles/ands/tbe/typ/pn/binar/alog/mis/vitaliy/compatiable、SUBTILE/SUBTILES);.pre-commit-config.yaml 仅扩展 codespell -L 白名单(+fo/adn/eles/binar/mis/compatiable),--skip *.py/*.cpp/*.hpp/*.c/*.h 不变(源码拼写由 typos 工具负责)。 - **标识符 rename**(内部符号,同文件/编译单元内调用点同步更新): - 命名空间 TMatmulInternel→TMatmulInternal、TCvtInternel→TCvtInternal - include guard EXTENTION_CSRC_UTILS_H→EXTENSION_*、ELEMENT_TILE_SCLAR_OP_HPP→...SCALAR... - 函数 ReachExhaused/WriteExhaused→...Exhausted、complate_s32/s16_data→complete_* - 变量 vaild/Vaild→valid/Valid(77 处,主体)、fpAddres→fpAddress、enbleCountMode→enableCountMode、NeetCntDstIdx→NeedCntDstIdx、paramter→parameter - **字符串/注释/文档拼写**:convertion→conversion、Unsupport→Unsupported、ony→only、Undelying→Underlying、Indicies→Indices、differnent→different、Iteraions→Iterations、Simpify→Simplify、addressess→addresses、particulary→particularly、seperate→separate、accross→across(.md 中英双语同步)。 - **文件名修正**:图 permuate_all2all_count.png→permute_all2all_count.png。 - **EOF 换行归一(end-of-file-fixer)**:41 个文件补缺失末行 \n——本 PR 涉及的 ElementOp.h、tcmp(s)/gen_data.py、kirinDev0000 5 个 main.cpp(10)+ 全仓其余 kirinDev0000 testcases 与 tinterleave(31);多尾随换行 0。 - **compatiable**:外部依赖 version_compatiable.inc 路径改名已撤回,改为白名单(须与依赖方拼写一致)。 - **ruff**:删少量无用 import(shutil、Tuple)。 ## 关联的Issue ## 测试 - **标识符一致性**:各 rename 均在所在文件内同步更新定义与调用点,行为不变。 - **白名单收敛**:typos.toml/codespell -L 已收录全部领域词与外部依赖名,避免误报。 - **EOF 验证**:全仓复扫缺/多末行换行均 0;pre-commit run end-of-file-fixer --all-files Passed(CI 等价)。 - ⚠️ 含标识符 rename(非纯格式化),本机无 CANN/CPU-sim 工具链未做编译/单测;建议可编译环境跑一次 build + 测试复核(重点确认 namespace/guard/valid 系列无外部引用残留)。 - **改动量**:158 文件 +323/−310(.cpp 77 / .hpp 34 / .py 24 / .md 9 / .h 7 / .sh 4 / .yaml 1 / .toml 1 / .png 1)。 ## 文档更新 .md 仅修正拼写(中英双语),无内容/结构改动。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [x] 其他,请描述:全仓拼写清理(codespell/typos 修正拼写、rename 拼错标识符、新增 typos.toml)+ EOF 末行换行归一(end-of-file-fixer,41 文件);外部依赖名 compatiable 加白名单保留。 See merge request: cann/pto-isa!1337 | 27 天前 | |
origin code Signed-off-by: yujiangtao <yujiangtao11@h-partners.com> | 7 个月前 | |
docs: refine ISA doc wording/terminology and rename header-library description Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1370 merge master into master docs: refine ISA doc wording/terminology and rename header-library description Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 对 docs/ 下文档统一润色措辞与术语,重命名头/库文件说明文档,并新增其菜单标题页与两级菜单项。纯文档修改,无源码/配置改动。 ## 描述 10 文件 +15/−12,全为 .md(8 文档润色/重命名 + 2 菜单文件): - **重命名与文档修订**:docs/PTO-ISA-External-Header-and-Library-Description.md → docs/PTO-ISA-Header-and-Library-Description.md,标题简化为「头文件和库文件说明」;将该文档「矩阵级访存」统一改为「不规则访存」,并补充说明 M 前缀表示 memory(如 MGATHER/MSCATTER)。 - **菜单项**:新增菜单标题页 docs/menu/header_and_library_zh.md(一级标题「头文件和库文件说明」,与其它 menu/*.md 一致);并在 docs/menu_ops_development.md 按两级结构挂入该文档——父级 [头文件和库文件说明](menu/header_and_library_zh.md)、叶子 [头文件和库文件说明](PTO-ISA-Header-and-Library-Description.md)。 - **术语规范化**:钳制 → 限制(MGATHER_zh、MSCATTER_zh);分块 → 分形(TROWEXPANDMIN_zh);修正笔误「手握手」→「握手」(MSCATTER_zh)。 - **语法修正(英文)**:only support → only supports(TFMODS、TREMS)。 - **约束描述重写**:TFILLPAD.md / TFILLPAD_zh.md 重写 Mat 类型重载的约束描述,更清晰说明该重载与首条 Vec 重载分属不同 SFINAE 重载、二者不矛盾。 ## 关联的Issue ## 测试 - **纯文档修改**,无代码/构建产物变更,无需编译/单测。 - **一致性**:术语与措辞调整全仓统一应用;产品名、芯片型号、路径、arch 等不在本次润色范围(正确未改)。 - **改动量**:10 文件 +15/−12(.md only);含 1 个新增文件 docs/menu/header_and_library_zh.md、1 个重命名文件。 ## 文档更新 仅修正文档措辞、术语与约束描述,补充菜单项,无内容/结构改动。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1370 | 19 天前 | |
docs(docs): Remove PTO-AS docs from ISA manual Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1026 merge master into master docs(docs): Remove PTO-AS docs from ISA manual Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: ## Summary - Delete the standalone docs/assembly PTO-AS documentation tree (PTO-AS spec, BNF, conventions, and all per-category operation pages in both English and Chinese) - Remove the PTO Assembly chapter (06-assembly{,_zh}.md) from the virtual ISA manual and renumber instruction, programming, virtual ISA/IR, bytecode, memory-ordering, and backend-conformance chapters from 07-12 to 06-11 in both languages - Update MkDocs navigation (mkdocs.yml, gen_pages.py, nav-translator.js), manual entry pages, documentation indexes (PTO-Virtual-ISA-Manual{,_zh}.md, PTOISA{,_zh}.md, README{,_zh}.md, mkdocs/README{,_zh}.md, mkdocs/src/index{,_zh}.md, manual/index{,_zh}.md, manual/01-overview{,_zh}.md), and menu files (menu_apis.md, menu_ops_development.md) to drop links to deleted assembly pages and reflect the renumbered chapters - Preserve per-instruction AS syntax sections in docs/isa/*.md and docs/isa/comm/*.md while removing the standalone assembly docs from the ISA manual navigation - Update documentation generation/check tooling (gen_isa_indexes.py, normalize_isa_docs.py, check_virtual_manual_consistency.py) to stop emitting or expecting PTO-AS references and to track the new chapter numbering ## Testing - [x] Restored docs/isa per-instruction AS syntax content and confirmed docs/isa has no pending git diff - [x] rg confirms no remaining 06-assembly or old 07-12 manual chapter path references outside the preserved per-instruction AS links - [x] python3 -m py_compile docs/mkdocs/gen_pages.py docs/tools/check_virtual_manual_consistency.py docs/tools/gen_isa_indexes.py docs/tools/normalize_isa_docs.py See merge request: cann/pto-isa!1026 | 2 个月前 | |
docs(docs): Remove PTO-AS docs from ISA manual Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1026 merge master into master docs(docs): Remove PTO-AS docs from ISA manual Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: ## Summary - Delete the standalone docs/assembly PTO-AS documentation tree (PTO-AS spec, BNF, conventions, and all per-category operation pages in both English and Chinese) - Remove the PTO Assembly chapter (06-assembly{,_zh}.md) from the virtual ISA manual and renumber instruction, programming, virtual ISA/IR, bytecode, memory-ordering, and backend-conformance chapters from 07-12 to 06-11 in both languages - Update MkDocs navigation (mkdocs.yml, gen_pages.py, nav-translator.js), manual entry pages, documentation indexes (PTO-Virtual-ISA-Manual{,_zh}.md, PTOISA{,_zh}.md, README{,_zh}.md, mkdocs/README{,_zh}.md, mkdocs/src/index{,_zh}.md, manual/index{,_zh}.md, manual/01-overview{,_zh}.md), and menu files (menu_apis.md, menu_ops_development.md) to drop links to deleted assembly pages and reflect the renumbered chapters - Preserve per-instruction AS syntax sections in docs/isa/*.md and docs/isa/comm/*.md while removing the standalone assembly docs from the ISA manual navigation - Update documentation generation/check tooling (gen_isa_indexes.py, normalize_isa_docs.py, check_virtual_manual_consistency.py) to stop emitting or expecting PTO-AS references and to track the new chapter numbering ## Testing - [x] Restored docs/isa per-instruction AS syntax content and confirmed docs/isa has no pending git diff - [x] rg confirms no remaining 06-assembly or old 07-12 manual chapter path references outside the preserved per-instruction AS links - [x] python3 -m py_compile docs/mkdocs/gen_pages.py docs/tools/check_virtual_manual_consistency.py docs/tools/gen_isa_indexes.py docs/tools/normalize_isa_docs.py See merge request: cann/pto-isa!1026 | 2 个月前 | |
Add TAXPY and TDEQUANT instructions, reorganize ops-development sidebar into an 11-group functional hierarchy with stub landing pages Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1307 merge master into master Add TAXPY and TDEQUANT instructions, reorganize ops-development sidebar into an 11-group functional hierarchy with stub landing pages Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 新增 TAXPY(原位缩放累加 AXPY: dst = scalar·src0 + dst)与 TDEQUANT(量化 Tile 仿射反量化 S8/S16 → FP32,dst = (src − offset)·scale,TQUANT 的逆运算)两条指令并集成进对应索引;同时按操作语义重构 docs/menu_ops_development.md 侧边栏为 11 个顶层分组 / 23 个子分组 / 120 个叶子指令的分层导航,并新增 23 个 docs/menu/*_zh.md 标题占位页使每个子分组链接可解析。 ## 描述 本次提交以「新增 TAXPY + TDEQUANT 两条指令 + 侧边栏菜单分层重构」为核心: 1. 新增 TAXPY 指令页(docs/isa/TAXPY.md / TAXPY_zh.md,各 86 行): - 语义:对 Tile 做**原位缩放累加**(AXPY,$a \cdot x + y$):dst = scalar · src0 + dst。 - dst 为读-改-写(RMW):旧值作为累加基 $y$ 读入,写回 scalar·x + y,**调用前必须已初始化**;src0($x$)只读;scalar($a$)为标量(TileDataSrc::DType)。 - 支持 dtype:dst/src0 ∈ {half, float}——同型路径直接 vaxpy;dst=float/src0=half 时将半精度拓宽到 FP32 后累加(A5 经 UNPK_B16 + vcvt,A2/A3 由 vaxpy 原生处理 4-block src / 8-block dst);half dst + float src0 非法(实现内 static_assert 拒绝)。 - 实现要点:运行于向量流水线 PIPE_V,使用 vaxpy 向量内联函数;dst/src0 必须同为 TileType::Vec 且有效形状一致;A2/A3 按 repeat-stride 是否溢出与行列关系选择 count/norm 模式覆盖任意合法形状。 - 编码:manifest 归类为 Tile-Scalar / Tile-Immediate,diagram_template: scalar,操作数 dst, src0, scalar。 - 章节齐全:Introduction / Math Interpretation / C++ Intrinsics / Tile Sizes & dtypes / Supported Input Dtypes / Implementation Notes / Constraints / Examples;示例指向 tests/npu/a5|a2a3|kirin9030/src/st/testcase/taxpy/ 与 tests/cpu/st/testcase/taxpy/。 2. 新增 TDEQUANT 指令页(docs/isa/TDEQUANT.md / TDEQUANT_zh.md,各 109 行): - 语义:对量化整数码 Tile(S8 / S16)做**逐行仿射反量化**,输出 FP32:dst = (src − offset) · scale,是 TQUANT(q = round(x/scale) + offset)整数仿射量化的逆运算。 - scale / offset 为**逐行** FP32 参数(沿列广播,paraCol = min(j, paraCols−1)),为 ISA 可见 Tile 操作数(非编译器 scratch);典型形态每行一个标量。 - 支持 dtype:S8 → FP32(UNPK4_B8 解包)、S16 → FP32(UNPK_B16 解包);dst/scale/offset 必须 dtype 一致且均为 FP32。 - 实现要点:运行于 PIPE_V,vsub 减零点 → vmul 重新缩放,无需 tmp scratch(区别于 A2/A3 上 TQUANT 的 5 级 cast 链)。 - 编码:manifest 归类为 Complex,diagram_template: elementwise,操作数 dst, src, scale, offset;指令页 Encoding 章节给出 TEPL 复杂变换编码(Mode=3、Function=11、TileOp=0x6B、BSTART.TEPL TDEQUANT …)。 - 章节齐全:Introduction / Math Interpretation / C++ Intrinsics / Tile Sizes & dtypes / Supported Input Dtypes / Implementation Notes / Encoding / Constraints / Examples;示例指向 tests/npu/a5|a2a3/src/st/testcase/tdequant/ 与 tests/cpu/st/testcase/tdequant/。 3. 两条指令集成进源同步索引(中英文一一对应;**两条指令索引落地范围不同**): - docs/isa/manifest.yaml:TAXPY 新增 Tile-Scalar / Tile-Immediate 条目(scalar 模板,dst, src0, scalar);TDEQUANT 新增 Complex 条目(elementwise 模板,dst, src, scale, offset),均含中英 summary。 - docs/isa/README.md / README_zh.md:各新增 TAXPY、TDEQUANT 两个列表条目(各 2 处)。 - docs/mkdocs/mkdocs.yml:nav 新增 TAXPY 与 TDEQUANT(各 1 处)。 - docs/PTOISA.md / PTOISA_zh.md:Complex 表新增 TDEQUANT 行(各 1 处);TAXPY 因归类为 Tile-Scalar 未进 PTOISA 表。 - docs/mkdocs/src/manual/appendix-d-instruction-family-matrix.md / _zh.md:指令族矩阵新增 TDEQUANT 一行(elementwise / dst, src, scale, offset,各 1 处);TAXPY 未进该矩阵。 - include/README.md / README_zh.md:将既有 TAXPY 行的空链接 []() 补为 ../docs/isa/TAXPY.md(链接修复);TDEQUANT 未进后端可用性表。 4. docs/menu_ops_development.md 按操作语义**整体重写**(旧 247 行 → 新 156 行): - 新结构:**11 个顶层分组**([分组名]() 空链接作导航父节点,0/2/4 空格缩进)+ **23 个子分组**([子组名](menu/xxx_zh.md) 链接)+ **120 个叶子指令**,按操作语义重新归类——逐元素双目运算 / 逐元素单目运算 / 逐元素超越函数 / 逐元素标量运算 / 归约运算 / 广播扩展运算 / 矩阵乘 / 数据搬运与访存 / 复杂变换 / 系统与控制 / 通信。 - TAXPY 置于「逐元素标量运算 > 标量算术」;TQUANT / TDEQUANT 置于「复杂变换 > 数据类型转换」(与 TCVT 同组)。 - 注:11 个顶层分组名采用空链接 []()(仅作分类父节点、无独立落地页),23 个子分组各自指向占位页。 5. **新增 23 个 docs/menu/*_zh.md 占位文件**(与 23 个子分组一一对应),每个文件仅含一行中文标题(如 # 算术运算、# 数据类型转换、# 流通信(FIFO)),用于使菜单的每个子分组链接可解析、构建分层导航骨架(当前仅标题、无正文内容);均为 _zh.md,无英文对应文件。 ## 关联的Issue ## 测试 - 指令页:TAXPY.md / TAXPY_zh.md 各 86 行;TDEQUANT.md / TDEQUANT_zh.md 各 109 行;EN/ZH 结构对称、行数一致。TDEQUANT 语义与 TQUANT 互逆一致(q=round(x/scale)+offset ⇔ x=(q−offset)·scale);TAXPY 为原位 RMW 累加,调用前需初始化 dst。 - 索引集成: - TAXPY 落地 manifest / isa/README(_zh) / mkdocs.yml nav / include/README(_zh)(链接修复)共 7 处;未进 PTOISA(_zh) 与指令族矩阵(归类为 Tile-Scalar,符合各表收录范围)。 - TDEQUANT 落地 manifest / PTOISA(_zh) / isa/README(_zh) / mkdocs.yml nav / 指令族矩阵(_zh) 共 8 处;未进 include/README 后端可用性表。 - manifest 字段:TAXPY(category=Tile-Scalar/Tile-Immediate、diagram_template=scalar、operands=dst, src0, scalar)、TDEQUANT(category=Complex、diagram_template=elementwise、operands=dst, src, scale, offset),均与各自指令页 Encoding/Operands 一致。 - 菜单:新文件 156 行;缩进仅 0/2/4 空格(无旧 8 空格残留);23 处 menu/ 引用全部指向新增占位页;120 处 isa/ 叶子链接;11 个顶层分组保留空链接 []()(分类父节点,预期行为)。 - 占位页:23 个 docs/menu/*_zh.md 各含一行中文标题(无正文),仅用于链接可解析。 - 中英文同步:所有指令页与索引页的 _zh 版本与 EN 版本改动一一对应(菜单占位页与 menu_ops_development.md 为纯中文页,无 EN 对应)。 ## 文档更新 - docs/isa/TAXPY.md / TAXPY_zh.md:新增指令页(原位缩放累加 AXPY,half/float + 半精度拓宽) - docs/isa/TDEQUANT.md / TDEQUANT_zh.md:新增指令页(仿射反量化 S8/S16 → FP32) - docs/isa/manifest.yaml:新增 TAXPY(Tile-Scalar/scalar)与 TDEQUANT(Complex/elementwise)条目 - docs/isa/README.md / README_zh.md:列表新增 TAXPY、TDEQUANT 条目 - docs/mkdocs/mkdocs.yml:nav 新增 TAXPY、TDEQUANT - docs/PTOISA.md / PTOISA_zh.md:Complex 索引表新增 TDEQUANT 行 - docs/mkdocs/src/manual/appendix-d-instruction-family-matrix.md / _zh.md:指令族矩阵新增 TDEQUANT 行 - include/README.md / README_zh.md:补全 TAXPY 行空链接指向 ../docs/isa/TAXPY.md - docs/menu_ops_development.md:API 参考侧边栏按 11 类功能分类法整体重构(旧 247 行 → 新 156 行),子分组链接全部指向占位页 - docs/menu/*_zh.md(23 个):新增分层占位跳转文件,各含一行中文标题,用于链接可解析 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1307 | 29 天前 | |
Add TAXPY and TDEQUANT instructions, reorganize ops-development sidebar into an 11-group functional hierarchy with stub landing pages Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1307 merge master into master Add TAXPY and TDEQUANT instructions, reorganize ops-development sidebar into an 11-group functional hierarchy with stub landing pages Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 新增 TAXPY(原位缩放累加 AXPY: dst = scalar·src0 + dst)与 TDEQUANT(量化 Tile 仿射反量化 S8/S16 → FP32,dst = (src − offset)·scale,TQUANT 的逆运算)两条指令并集成进对应索引;同时按操作语义重构 docs/menu_ops_development.md 侧边栏为 11 个顶层分组 / 23 个子分组 / 120 个叶子指令的分层导航,并新增 23 个 docs/menu/*_zh.md 标题占位页使每个子分组链接可解析。 ## 描述 本次提交以「新增 TAXPY + TDEQUANT 两条指令 + 侧边栏菜单分层重构」为核心: 1. 新增 TAXPY 指令页(docs/isa/TAXPY.md / TAXPY_zh.md,各 86 行): - 语义:对 Tile 做**原位缩放累加**(AXPY,$a \cdot x + y$):dst = scalar · src0 + dst。 - dst 为读-改-写(RMW):旧值作为累加基 $y$ 读入,写回 scalar·x + y,**调用前必须已初始化**;src0($x$)只读;scalar($a$)为标量(TileDataSrc::DType)。 - 支持 dtype:dst/src0 ∈ {half, float}——同型路径直接 vaxpy;dst=float/src0=half 时将半精度拓宽到 FP32 后累加(A5 经 UNPK_B16 + vcvt,A2/A3 由 vaxpy 原生处理 4-block src / 8-block dst);half dst + float src0 非法(实现内 static_assert 拒绝)。 - 实现要点:运行于向量流水线 PIPE_V,使用 vaxpy 向量内联函数;dst/src0 必须同为 TileType::Vec 且有效形状一致;A2/A3 按 repeat-stride 是否溢出与行列关系选择 count/norm 模式覆盖任意合法形状。 - 编码:manifest 归类为 Tile-Scalar / Tile-Immediate,diagram_template: scalar,操作数 dst, src0, scalar。 - 章节齐全:Introduction / Math Interpretation / C++ Intrinsics / Tile Sizes & dtypes / Supported Input Dtypes / Implementation Notes / Constraints / Examples;示例指向 tests/npu/a5|a2a3|kirin9030/src/st/testcase/taxpy/ 与 tests/cpu/st/testcase/taxpy/。 2. 新增 TDEQUANT 指令页(docs/isa/TDEQUANT.md / TDEQUANT_zh.md,各 109 行): - 语义:对量化整数码 Tile(S8 / S16)做**逐行仿射反量化**,输出 FP32:dst = (src − offset) · scale,是 TQUANT(q = round(x/scale) + offset)整数仿射量化的逆运算。 - scale / offset 为**逐行** FP32 参数(沿列广播,paraCol = min(j, paraCols−1)),为 ISA 可见 Tile 操作数(非编译器 scratch);典型形态每行一个标量。 - 支持 dtype:S8 → FP32(UNPK4_B8 解包)、S16 → FP32(UNPK_B16 解包);dst/scale/offset 必须 dtype 一致且均为 FP32。 - 实现要点:运行于 PIPE_V,vsub 减零点 → vmul 重新缩放,无需 tmp scratch(区别于 A2/A3 上 TQUANT 的 5 级 cast 链)。 - 编码:manifest 归类为 Complex,diagram_template: elementwise,操作数 dst, src, scale, offset;指令页 Encoding 章节给出 TEPL 复杂变换编码(Mode=3、Function=11、TileOp=0x6B、BSTART.TEPL TDEQUANT …)。 - 章节齐全:Introduction / Math Interpretation / C++ Intrinsics / Tile Sizes & dtypes / Supported Input Dtypes / Implementation Notes / Encoding / Constraints / Examples;示例指向 tests/npu/a5|a2a3/src/st/testcase/tdequant/ 与 tests/cpu/st/testcase/tdequant/。 3. 两条指令集成进源同步索引(中英文一一对应;**两条指令索引落地范围不同**): - docs/isa/manifest.yaml:TAXPY 新增 Tile-Scalar / Tile-Immediate 条目(scalar 模板,dst, src0, scalar);TDEQUANT 新增 Complex 条目(elementwise 模板,dst, src, scale, offset),均含中英 summary。 - docs/isa/README.md / README_zh.md:各新增 TAXPY、TDEQUANT 两个列表条目(各 2 处)。 - docs/mkdocs/mkdocs.yml:nav 新增 TAXPY 与 TDEQUANT(各 1 处)。 - docs/PTOISA.md / PTOISA_zh.md:Complex 表新增 TDEQUANT 行(各 1 处);TAXPY 因归类为 Tile-Scalar 未进 PTOISA 表。 - docs/mkdocs/src/manual/appendix-d-instruction-family-matrix.md / _zh.md:指令族矩阵新增 TDEQUANT 一行(elementwise / dst, src, scale, offset,各 1 处);TAXPY 未进该矩阵。 - include/README.md / README_zh.md:将既有 TAXPY 行的空链接 []() 补为 ../docs/isa/TAXPY.md(链接修复);TDEQUANT 未进后端可用性表。 4. docs/menu_ops_development.md 按操作语义**整体重写**(旧 247 行 → 新 156 行): - 新结构:**11 个顶层分组**([分组名]() 空链接作导航父节点,0/2/4 空格缩进)+ **23 个子分组**([子组名](menu/xxx_zh.md) 链接)+ **120 个叶子指令**,按操作语义重新归类——逐元素双目运算 / 逐元素单目运算 / 逐元素超越函数 / 逐元素标量运算 / 归约运算 / 广播扩展运算 / 矩阵乘 / 数据搬运与访存 / 复杂变换 / 系统与控制 / 通信。 - TAXPY 置于「逐元素标量运算 > 标量算术」;TQUANT / TDEQUANT 置于「复杂变换 > 数据类型转换」(与 TCVT 同组)。 - 注:11 个顶层分组名采用空链接 []()(仅作分类父节点、无独立落地页),23 个子分组各自指向占位页。 5. **新增 23 个 docs/menu/*_zh.md 占位文件**(与 23 个子分组一一对应),每个文件仅含一行中文标题(如 # 算术运算、# 数据类型转换、# 流通信(FIFO)),用于使菜单的每个子分组链接可解析、构建分层导航骨架(当前仅标题、无正文内容);均为 _zh.md,无英文对应文件。 ## 关联的Issue ## 测试 - 指令页:TAXPY.md / TAXPY_zh.md 各 86 行;TDEQUANT.md / TDEQUANT_zh.md 各 109 行;EN/ZH 结构对称、行数一致。TDEQUANT 语义与 TQUANT 互逆一致(q=round(x/scale)+offset ⇔ x=(q−offset)·scale);TAXPY 为原位 RMW 累加,调用前需初始化 dst。 - 索引集成: - TAXPY 落地 manifest / isa/README(_zh) / mkdocs.yml nav / include/README(_zh)(链接修复)共 7 处;未进 PTOISA(_zh) 与指令族矩阵(归类为 Tile-Scalar,符合各表收录范围)。 - TDEQUANT 落地 manifest / PTOISA(_zh) / isa/README(_zh) / mkdocs.yml nav / 指令族矩阵(_zh) 共 8 处;未进 include/README 后端可用性表。 - manifest 字段:TAXPY(category=Tile-Scalar/Tile-Immediate、diagram_template=scalar、operands=dst, src0, scalar)、TDEQUANT(category=Complex、diagram_template=elementwise、operands=dst, src, scale, offset),均与各自指令页 Encoding/Operands 一致。 - 菜单:新文件 156 行;缩进仅 0/2/4 空格(无旧 8 空格残留);23 处 menu/ 引用全部指向新增占位页;120 处 isa/ 叶子链接;11 个顶层分组保留空链接 []()(分类父节点,预期行为)。 - 占位页:23 个 docs/menu/*_zh.md 各含一行中文标题(无正文),仅用于链接可解析。 - 中英文同步:所有指令页与索引页的 _zh 版本与 EN 版本改动一一对应(菜单占位页与 menu_ops_development.md 为纯中文页,无 EN 对应)。 ## 文档更新 - docs/isa/TAXPY.md / TAXPY_zh.md:新增指令页(原位缩放累加 AXPY,half/float + 半精度拓宽) - docs/isa/TDEQUANT.md / TDEQUANT_zh.md:新增指令页(仿射反量化 S8/S16 → FP32) - docs/isa/manifest.yaml:新增 TAXPY(Tile-Scalar/scalar)与 TDEQUANT(Complex/elementwise)条目 - docs/isa/README.md / README_zh.md:列表新增 TAXPY、TDEQUANT 条目 - docs/mkdocs/mkdocs.yml:nav 新增 TAXPY、TDEQUANT - docs/PTOISA.md / PTOISA_zh.md:Complex 索引表新增 TDEQUANT 行 - docs/mkdocs/src/manual/appendix-d-instruction-family-matrix.md / _zh.md:指令族矩阵新增 TDEQUANT 行 - include/README.md / README_zh.md:补全 TAXPY 行空链接指向 ../docs/isa/TAXPY.md - docs/menu_ops_development.md:API 参考侧边栏按 11 类功能分类法整体重构(旧 247 行 → 新 156 行),子分组链接全部指向占位页 - docs/menu/*_zh.md(23 个):新增分层占位跳转文件,各含一行中文标题,用于链接可解析 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1307 | 29 天前 | |
docs(docs): Fix broken doc-site links and dead PTO-AS references Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1090 merge docs/fix-isa-doc-links into master docs(docs): Fix broken doc-site links and dead PTO-AS references Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: ## Summary - Replace 264 dead PTO-AS spec links in docs/isa/*.md and comm pages with an inline-code reference docs/grammar/PTO-AS.md, matching the already-migrated pages; the docs/assembly tree was deleted earlier but the per-instruction back-references were left dangling - Convert root-absolute /docs/... links in the hand-written manual pages (01-overview{,_zh}, appendix-d{,_zh}) to repo-relative paths so they resolve in the Gitcode repository file view as well as on the doc site, and fix gen_pages.py REL_LINK_RE so multi-level ../ prefixes are counted correctly by the relative-link rewriter - Repoint the build-guide links from the site-excluded docs/mkdocs/README{,_zh}.md to docs/website{,_zh}.md - Skip the repo-root README.md in gen_pages.py (it collides with the curated homepage index.md) and redirect inbound links to the homepage at build time, leaving the repo-relative source links untouched - Convert a .py script link in the flash_atten README to inline code ## Testing - [x] mkdocs build --strict passes with 0 warnings (down from 275) - [x] Manual/ISA links verified to resolve in both the rendered doc site and the Gitcode repository file view - [x] Repo-relative source links left intact where the site rewrite is build-time only Closes [#409](https://gitcode.com/cann/pto-isa/issues/409) See merge request: cann/pto-isa!1090 | 2 个月前 | |
docs(docs): Fix broken doc-site links and dead PTO-AS references Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1090 merge docs/fix-isa-doc-links into master docs(docs): Fix broken doc-site links and dead PTO-AS references Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: ## Summary - Replace 264 dead PTO-AS spec links in docs/isa/*.md and comm pages with an inline-code reference docs/grammar/PTO-AS.md, matching the already-migrated pages; the docs/assembly tree was deleted earlier but the per-instruction back-references were left dangling - Convert root-absolute /docs/... links in the hand-written manual pages (01-overview{,_zh}, appendix-d{,_zh}) to repo-relative paths so they resolve in the Gitcode repository file view as well as on the doc site, and fix gen_pages.py REL_LINK_RE so multi-level ../ prefixes are counted correctly by the relative-link rewriter - Repoint the build-guide links from the site-excluded docs/mkdocs/README{,_zh}.md to docs/website{,_zh}.md - Skip the repo-root README.md in gen_pages.py (it collides with the curated homepage index.md) and redirect inbound links to the homepage at build time, leaving the repo-relative source links untouched - Convert a .py script link in the flash_atten README to inline code ## Testing - [x] mkdocs build --strict passes with 0 warnings (down from 275) - [x] Manual/ISA links verified to resolve in both the rendered doc site and the Gitcode repository file view - [x] Repo-relative source links left intact where the site rewrite is build-time only Closes [#409](https://gitcode.com/cann/pto-isa/issues/409) See merge request: cann/pto-isa!1090 | 2 个月前 | |
Repo-wide pre-commit: strip trailing whitespace and normalize EOF newlines Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1320 merge master into master Repo-wide pre-commit: strip trailing whitespace and normalize EOF newlines Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhhywang Commit-by: zhhywang Merged-by: cann-robot Description: 全仓跑 trailing-whitespace + end-of-file-fixer:剥离行尾空白、补缺失末行换行、删多余尾随空行;零逻辑/语义变更,覆盖 tests/docs/include/kernels/demos 及 .py/.md/.sh/.js。 ## 描述 全仓 pre-commit 自动修复扫描,**仅做空白与行尾归一,零逻辑变更**: - **行尾空白**:剥离行末多余空格/制表符(主体;.cpp/.hpp/.h/.md/.py/.sh/.js 全覆盖)。 - **文件尾换行**:补缺失末行换行(多处 \ No newline at end of file)、删多余尾随空行,统一单换行结尾。 git diff -w 仅余 250 文件(皆为 EOF 换行/空行修复,-w 不抑制空行变更),其余 ~903 文件纯行尾空白;逐类抽样(.cpp/.hpp/.py/.md/setup.py/SKILL.md)均为空白归一,无 token 变化。 ## 关联的Issue ## 测试 - **空白归一收敛**:git diff -w --stat = 250 文件 +46/−365;抽样 .cpp 文件 -w diff 为空(纯行尾空白)。 - **无逻辑变更**:无标识符 rename、无代码增删,仅空白/换行。 - ⚠️ 未做编译验证(本机无 CANN/CPU-sim 工具链);空白不改语义,建议可编译环境跑一次 build 复核。 - **改动量**:1153 文件,+15054 / −15373(.cpp 634 / .md 298 / .hpp 175 / .py 18 / .sh 13 / .h 12 / .js 3)。 ## 文档更新 无文档内容改动;.md 仅为行尾空白/EOF 换行归一。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:全仓 pre-commit 空白归一——trailing-whitespace + end-of-file-fixer,清理行尾空白、统一末行换行;零逻辑变更。 See merge request: cann/pto-isa!1320 | 28 天前 | |
costmodel support fit cycle Co-authored-by: ZhangZGC<8623924@qq.com> # message auto-generated for no-merge-commit merge: !818 merge dev/costmodel_fit into master costmodel support fit cycle Created-by: ZhangZGC Commit-by: ZhangZGC Merged-by: cann-robot Description: ## 描述 costmodel新增指令cycle拟合函数,给定rows、cols、dtype,直接返回cycle。同时支持输出时延的预测。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/pto-isa/issues/319 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!818 | 3 个月前 | |
costmodel support fit cycle Co-authored-by: ZhangZGC<8623924@qq.com> # message auto-generated for no-merge-commit merge: !818 merge dev/costmodel_fit into master costmodel support fit cycle Created-by: ZhangZGC Commit-by: ZhangZGC Merged-by: cann-robot Description: ## 描述 costmodel新增指令cycle拟合函数,给定rows、cols、dtype,直接返回cycle。同时支持输出时延的预测。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/pto-isa/issues/319 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!818 | 3 个月前 | |
fix(tests): Validate run_st.sh arguments and correct onboarding docs Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1232 merge master into master fix(tests): Validate run_st.sh arguments and correct onboarding docs Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: tests/run_st.sh silently exited 0 without running any test when invoked with the argument format shown in the docs (a3 sim all) or with a platform but no mode (--a3 --npu): unknown tokens hit the catch-all *) branch and simply broke out of option parsing, and the a3/a5 blocks require --simple/--all that were never set. The documentation also listed a non-existent .run output path and the wrong argument format, so following it never actually ran anything. ## Summary - Distinguish end-of-args ("") from unknown arguments in checkopts: unknown args now print an error plus usage and exit 1 instead of silently no-op'ing - Add post-parse validation: error out when no platform is selected, and when --a3/--a5 is given without a --simple/--all mode - Add a usage() helper describing platform/mode/run-mode/option flags and valid examples, printed on any invalid invocation - Correct run_st.sh examples in getting-started (.md/_zh) and agent.md to use the required -- prefixes (e.g. --a3 --sim --all) - Fix the .run package output path in getting-started and scripts/package README (zh/en) from scripts/package/output/ to the actual build_out/ (per cmake/package.cmake) - Note in tests/README (.md/_zh) that run_st.sh requires a platform flag and, for a3/a5, a --simple/--all mode flag ## Testing - [x] run_st.sh a3 sim all and --a3 --npu now exit 1 with a clear error and usage instead of silently exiting 0 - [x] Valid --a3 --sim --all and --kirin9030 invocations still pass validation and proceed to build/run - [x] bash -n tests/run_st.sh syntax check passes - [x] No stale scripts/package/output references remain in the repo See merge request: cann/pto-isa!1232 | 1 个月前 | |
docs: 修复文档格式和拼写问题 Co-authored-by: zoujiangjiang<zoujiangjiang@h-partners.com> # message auto-generated for no-merge-commit merge: !1267 merge docs-fix-20260709 into master docs: 修复文档格式和拼写问题 Created-by: zoujiangjiang Commit-by: zoujiangjiang Merged-by: cann-robot Description: ## 修复文档格式和拼写问题 修复 61 个文档文件的格式和拼写问题,共 +162 -161 行。 ### 修改内容 **格式规范:** - 修正数值与单位间多余空格(如 8 KB→8KB、32 位→32位、768 字节→768字节) - 修正单位拼写与格式(32B 统一,与源码注释一致) **拼写修正(debug_zh.md):** - 指令名:TMrgs或t→TMrgsort、dest在ation→destination - 输入法误入:在 range of→in range of、cont在uous→continuous、在teger→integer - 中英混排:static 和 satisfy→static and satisfy、input 和 output→input and output - 行号引用:核对源码修正 CA-0004/0005、SA-0348/0349、SA-0350 等 **文档约束:** - 恢复 TRELU/TSHL/TSHR/TOR/TSTORE_FP 的 A5 约束内容(经源码核对与 A2A3 一致) - 保留源码原文(convertion/Unsupport 等,忠实记录源码断言字符串) **其他:** - 修正 TEXPANDS 示例 tile 地址(0x1000,非 1.0f) - 修正 TXORS 接口签名(src0,与 pto_instr.hpp 一致) - 修正 TEXP 漏字(补充介词 在) ### 测试 - 仅修改文档,无代码逻辑变更 - 所有改动经源码核对,确保文档与源码一致 backport of #1267 See merge request: cann/pto-isa!1267 | 1 个月前 | |
docs: refine ISA doc wording/terminology and rename header-library description Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1370 merge master into master docs: refine ISA doc wording/terminology and rename header-library description Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhywang Commit-by: zhywang Merged-by: cann-robot Description: 对 docs/ 下文档统一润色措辞与术语,重命名头/库文件说明文档,并新增其菜单标题页与两级菜单项。纯文档修改,无源码/配置改动。 ## 描述 10 文件 +15/−12,全为 .md(8 文档润色/重命名 + 2 菜单文件): - **重命名与文档修订**:docs/PTO-ISA-External-Header-and-Library-Description.md → docs/PTO-ISA-Header-and-Library-Description.md,标题简化为「头文件和库文件说明」;将该文档「矩阵级访存」统一改为「不规则访存」,并补充说明 M 前缀表示 memory(如 MGATHER/MSCATTER)。 - **菜单项**:新增菜单标题页 docs/menu/header_and_library_zh.md(一级标题「头文件和库文件说明」,与其它 menu/*.md 一致);并在 docs/menu_ops_development.md 按两级结构挂入该文档——父级 [头文件和库文件说明](menu/header_and_library_zh.md)、叶子 [头文件和库文件说明](PTO-ISA-Header-and-Library-Description.md)。 - **术语规范化**:钳制 → 限制(MGATHER_zh、MSCATTER_zh);分块 → 分形(TROWEXPANDMIN_zh);修正笔误「手握手」→「握手」(MSCATTER_zh)。 - **语法修正(英文)**:only support → only supports(TFMODS、TREMS)。 - **约束描述重写**:TFILLPAD.md / TFILLPAD_zh.md 重写 Mat 类型重载的约束描述,更清晰说明该重载与首条 Vec 重载分属不同 SFINAE 重载、二者不矛盾。 ## 关联的Issue ## 测试 - **纯文档修改**,无代码/构建产物变更,无需编译/单测。 - **一致性**:术语与措辞调整全仓统一应用;产品名、芯片型号、路径、arch 等不在本次润色范围(正确未改)。 - **改动量**:10 文件 +15/−12(.md only);含 1 个新增文件 docs/menu/header_and_library_zh.md、1 个重命名文件。 ## 文档更新 仅修正文档措辞、术语与约束描述,补充菜单项,无内容/结构改动。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!1370 | 19 天前 | |
docs: bump minimum Python to 3.9.x Co-authored-by: chenshengxin<chenshengxin@huawei.com> # message auto-generated for no-merge-commit merge: !954 merge docs/bump-python-3.9 into master docs: bump minimum Python to 3.9.x Created-by: shengxinchen Commit-by: chenshengxin Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> - 将 README、入门指南、网站文档以及 mkdocs 配置中的 Python 最低版本要求从 3.8 更新至 3.9.x(中英文版本)。 - 增加一条生命周期结束(EOL)说明,指出 Python 3.7.x 和 3.8.x 已停止维护,CANN 将很快停止对它们的支持。 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 更新了README.md文件 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/pto-isa!954 | 2 个月前 | |
Repo-wide pre-commit: strip trailing whitespace and normalize EOF newlines Co-authored-by: zhywang<wangzhiyong74@huawei.com> # message auto-generated for no-merge-commit merge: !1320 merge master into master Repo-wide pre-commit: strip trailing whitespace and normalize EOF newlines Created-by: zhhywang Commit-by: zhywang Merged-by: cann-robot Description: Created-by: zhhywang Commit-by: zhhywang Merged-by: cann-robot Description: 全仓跑 trailing-whitespace + end-of-file-fixer:剥离行尾空白、补缺失末行换行、删多余尾随空行;零逻辑/语义变更,覆盖 tests/docs/include/kernels/demos 及 .py/.md/.sh/.js。 ## 描述 全仓 pre-commit 自动修复扫描,**仅做空白与行尾归一,零逻辑变更**: - **行尾空白**:剥离行末多余空格/制表符(主体;.cpp/.hpp/.h/.md/.py/.sh/.js 全覆盖)。 - **文件尾换行**:补缺失末行换行(多处 \ No newline at end of file)、删多余尾随空行,统一单换行结尾。 git diff -w 仅余 250 文件(皆为 EOF 换行/空行修复,-w 不抑制空行变更),其余 ~903 文件纯行尾空白;逐类抽样(.cpp/.hpp/.py/.md/setup.py/SKILL.md)均为空白归一,无 token 变化。 ## 关联的Issue ## 测试 - **空白归一收敛**:git diff -w --stat = 250 文件 +46/−365;抽样 .cpp 文件 -w diff 为空(纯行尾空白)。 - **无逻辑变更**:无标识符 rename、无代码增删,仅空白/换行。 - ⚠️ 未做编译验证(本机无 CANN/CPU-sim 工具链);空白不改语义,建议可编译环境跑一次 build 复核。 - **改动量**:1153 文件,+15054 / −15373(.cpp 634 / .md 298 / .hpp 175 / .py 18 / .sh 13 / .h 12 / .js 3)。 ## 文档更新 无文档内容改动;.md 仅为行尾空白/EOF 换行归一。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:全仓 pre-commit 空白归一——trailing-whitespace + end-of-file-fixer,清理行尾空白、统一末行换行;零逻辑变更。 See merge request: cann/pto-isa!1320 | 28 天前 |
PTO ISA 文档导航
这里是 PTO Tile Lib 的文档入口页,用于帮助读者按主题快速定位文档,而不是逐个目录查找。
PTO 相关文档主要覆盖以下几类内容:
- ISA 基础概念与整体阅读路径
- 指令索引与逐条指令参考
- Tile 编程模型、事件同步与性能优化
- 快速开始、测试运行与文档构建说明
建议阅读路径
如果您第一次接触 PTO Tile Lib,建议按以下顺序阅读:
- 快速开始指南:先完成环境准备并运行 CPU Simulator
- ISA 总览:建立对 PTO ISA 的整体认识
- PTO 指令列表:按类别浏览已定义的标准操作
- Tile 编程模型:理解 tile shape、tile mask 与数据组织方式
- 事件与同步:理解 set/wait flag 与流水线同步
- 性能优化:理解常见瓶颈与调优方向
文档分类
1. ISA 与指令参考
- 虚拟 ISA 手册入口:PTO ISA 手册总入口
- ISA 总览:介绍 PTO ISA 的背景、目标与整体结构
- PTO 指令列表:按类别组织的 PTO 标准操作索引
- 通用约定:命名、约束、使用规范等通用规则
2. 编程模型与开发文档
- 开发文档索引:扩展 PTO Tile Lib 的开发文档入口
- Tile 编程模型:介绍 tile shape、tile mask 与数据布局
- 事件与同步:介绍事件记录、等待与同步机制
- 性能优化:介绍性能分析与调优建议
- CostModel 后端说明(打桩 stub / 拟合 fit):后端拆分、拟合路径与运行方式
3. 入门、测试与文档构建
4. 其他相关文档
- Machine 文档:抽象机器模型与相关说明
目录结构
关键目录如下:
├── isa/ # PTO 指令参考与分类索引
├── coding/ # 编程模型、开发与性能优化文档
├── auto_mode/ # Auto Mode 相关文档
├── machine/ # 抽象机器模型相关文档
├── mkdocs/ # 文档站点构建配置与脚本
├── figures/ # 文档中使用的图片与图示资源
├── README* # 文档入口页
├── PTOISA* # ISA 总览文档
└── getting-started* # 快速开始指南
相关入口
- 根目录 README_zh:项目总览、快速开始与仓库入口
- kernels 目录说明:kernel 与算子实现入口
- include 目录说明:头文件与接口说明
- tests 目录说明:测试与运行入口