PyPTO(发音: pai p-t-o):Parallel Tensor/Tile Operation编程范式。
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
docs(install): Simple Install for PyPTO Co-authored-by: duanhaotian<duanhaotian@huawei.com> # message auto-generated for no-merge-commit merge: !4812 merge dht0710 into master docs(install): Simple Install for PyPTO Created-by: duanhaotian Commit-by: duanhaotian Merged-by: cann-robot Description: PR 应该避免没有描述信息, 描述信息的最重要的作用是描述修改意图,应该清晰明了. 例如: 标题中包含了 fix 标签, 如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性. 如果PR和特定的Issue相关,可以单独包含一行 Related Issue: 放到描述信息最后. 下面是一个典型的PR描述信息: The origin issue template brings too many noise, it's not suitable for git message. eg: comments are not removed, labels are redundant as the PR tile already contains the tag. The guide gives a clear suggestion on how to write the PR body. Related Issue: #1234,#5678 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!4812 | 1 天前 | |
fix(docs): Precision tools do not have a recompilation scenario Co-authored-by: lyz0328<liyanzhen@huawei.com> # message auto-generated for no-merge-commit merge: !4153 merge master into master fix(docs): Precision tools do not have a recompilation scenario Created-by: lyz0328 Commit-by: lyz0328 Merged-by: cann-robot Description: 1、仓库文档国际化,新增英文readme文件,skill和docs暂不翻译 2、精度工具文档陈旧内容修改:1)删除精度工具重编译步骤 2)更新msaccucmp.py执行命令,明确执行路径、不带版本信息,便于用户在不同版本通用执行 3、webide安装方式的安装界面截图变更 Related Issue: #2345 See merge request: cann/pypto!4153 | 17 天前 | |
refactor(agent): Remove operator-development skills and agents Co-authored-by: wangzheng97<wangzheng97@hisilicon.com> # message auto-generated for no-merge-commit merge: !4605 merge chore-remove-op-dev-skills into master refactor(agent): Remove operator-development skills and agents Created-by: wangzheng97 Commit-by: wangzheng97 Merged-by: cann-robot Description: refactor(agent): Remove operator-development skills and agents The agents and skills in this repository should focus on developing and maintaining the PyPTO framework itself: debugging and error location, compile-time Pass analysis, environment setup, and PR/Issue workflows. This PR removes the operator-development skills and agents together with their state-machine plugins and lint hook, so the tooling scope matches the repository. Changes: - Delete 17 operator-development skills (api-explore, golden-generate, op-design, op-develop, op-perf-tune, precision-compare, fused-op-integration, etc.) - Delete 9 operator-development agents (op-orchestrator, op-coder, op-verifier, etc.) - Delete state-machine plugins (.opencode/plugins/: op-lint, state-transition) and the lint engine (.agents/hooks/pypto-op-lint/) - Delete migrate-huggingface-to-npu (unrelated to framework maintenance) - Update .agents/README.md and AGENTS.md, and delete .agents/settings.json, to drop the now-dangling references; trim AGENTS.md to project scope, general principles and entry-point lookup - Consolidate AGENTS.md's general principles into 5 core rules: the 4 principles from Andrej Karpathy's CLAUDE.md (official Chinese translation, forrestchang/andrej-karpathy-skills) — think before coding, simplicity first, surgical changes, goal-driven execution — plus one evidence-before-conclusion rule for diagnostic work - Inline list_idle_chip_ids.sh into pypto-environment-setup and fix dangling references in pypto-skill-validation-prompt and docs/zh/trouble_shooting - Keep pypto-code-merge-agent and the framework debugging / Pass / environment / PR-Issue skills Related Issues: #2533 See merge request: cann/pypto!4605 | 8 天前 | |
fix(build): Fix the binary SHA256 hash value of cannot cmake Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4751 merge master into master fix(build): Fix the binary SHA256 hash value of cannot cmake Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 该 PR 修复了 cmake/fetch_cann_cmake.cmake 中 FetchContent_Declare 所使用的 CANN CMake 归档文件的 SHA256 校验值。由于之前记录的哈希值与实际下载的文件不匹配,导致 CMake 构建流程中的哈希校验失败。此次变更将两个下载源(本地路径和远程 URL)对应的 URL_HASH SHA256 统一更新为正确的哈希值 464693dc211c618b4bca69a5bdbcf4a83550a4e8383ce9dff20fb66a08915fb8。 ## 主要改动 - **修正 URL_HASH SHA256 哈希值**:在 cmake/fetch_cann_cmake.cmake 中,将 FetchContent_Declare 的两处 URL_HASH SHA256 从旧值 b0db2d4d0d2e94bd0dd961d88dc16b6b042fbacb4de4acb9530128c98e637fca 更新为 464693dc211c618b4bca69a5bdbcf4a83550a4e8383ce9dff20fb66a08915fb8,分别对应本地 PypTo 第三方路径下载源和 raw.gitcode.com 远程下载源,确保两种获取方式下哈希校验均能通过。 See merge request: cann/pypto!4751 | 2 天前 | |
feat(machine): Close launch early for 3510 Co-authored-by: huanglu<huanglu22@hisilicon.com> # message auto-generated for no-merge-commit merge: !4687 merge master into master feat(machine): Close launch early for 3510 Created-by: lululu40888 Commit-by: huanglu Merged-by: cann-robot Description: feat(machine): Close launch early for 3510 See merge request: cann/pypto!4687 | 8 小时前 | |
feat(ir): Support Raise and min/max in new frontend Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !4792 merge ir_0710 into master feat(ir): Support Raise and min/max in new frontend Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: 前端kernel中支持: 1. Raise 抛出异常 2. min根据入参类型,转换为pypto.min或者python原生min,max同理 修改example写法,避免列表推导式写法,e.g. [8 for _ in range(len(x.shape))] 改写为 [8] * len(x.shape) See merge request: cann/pypto!4792 | 1 天前 | |
feat(machine): Add pmu synmode Co-authored-by: wan_jianfen<wanjianfen@hisilicon.com> # message auto-generated for no-merge-commit merge: !4638 merge br_FixProf into master feat(machine): Add pmu synmode Created-by: wan_jianfen Commit-by: wan_jianfen Merged-by: cann-robot Description: 支持PMU采集动态调整执行模式: 1、解依赖过程,使用函数指针形式收编不同调度模式 2、schdule 初适化阶段,动态调整切换模式信息,默认情况采用并行调度模式 3、性能验证无劣化。 See merge request: cann/pypto!4638 | 7 小时前 | |
feat(python): A3 platform high-throughput performance version of glm_attention_uniform. Co-authored-by: z00521416<zhangyongtao7@hisilicon.com> # message auto-generated for no-merge-commit merge: !4821 merge dfx_cloud into master feat(python): A3 platform high-throughput performance version of glm_attention_uniform. Created-by: z00521416 Commit-by: z00521416 Merged-by: cann-robot Description: A3 platform high-throughput performance version of glm_attention_uniform. See merge request: cann/pypto!4821 | 14 小时前 | |
feat(ir): Migrate pypto_pro language parser part3 Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !4690 merge ft3 into master feat(ir): Migrate pypto_pro language parser part3 Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: Migrate pypto_pro language parser See merge request: cann/pypto!4690 | 1 天前 | |
feat(build): Support packing whl into run change 3 file. Co-authored-by: wuyi2026<wuyi55@huawei.com> # message auto-generated for no-merge-commit merge: !4486 merge master into master feat(build): Support packing whl into run change 3 file. Created-by: wuyi2026 Commit-by: wuyi2026 Merged-by: cann-robot Description: ## 变更摘要 此 PR 主要聚焦于统一 run 和 whl 构建过程中的时间戳( tag_info),并补充命令行帮助信息。核心改动是将 tag_info 的生成逻辑从 BuildCtrl.get_cmake_build_update_env() 方法提升为 BuildCtrl 的实例属性 self.tag_info,在对象初始化时即确定时间戳,从而保证同一构建实例下 run 和 whl 使用一致的构建时间戳。 ## 主要改动 - **tag_info 提升为实例属性**: 在 BuildCtrl.__init__ 中新增 self.tag_info 属性,将原先在 get_cmake_build_update_env() 局部生成的 tagInfo 逻辑前移,使构建时间戳在对象创建时即固定,后续通过 self.tag_info 统一引用。 - **get_cmake_build_update_env() 简化**: 移除原先内嵌的 tag_info 生成与环境变量写入逻辑,改为直接使用 self.tag_info 写入 env.update({"tagInfo": self.tag_info}),消除重复计算。 - **__str__ 增加 TagInfo 输出**: 在 BuildCtrl.__str__ 方法中新增 TagInfo 字段的打印,便于调试时查看当前构建控制参数的标签信息。 - **命令行帮助信息补充**: 在 scripts/package/pypto/scripts/help.info 中为 --uninstall 和 --upgrade 两个子命令分别添加了 --docker-root=<docker root fs directory> 选项说明。 See merge request: cann/pypto!4486 | 11 天前 | |
fix(swimlane): Time Cost Calculation for Isomorphic Subgraph Repair Co-authored-by: sunhaoxuan2024<sunhaoxuan3@h-partners.com> # message auto-generated for no-merge-commit merge: !4777 merge master into master fix(swimlane): Time Cost Calculation for Isomorphic Subgraph Repair Created-by: sunhaoxuan2024 Commit-by: sunhaoxuan2024 Merged-by: cann-robot Description: 修复泳道图代码同构子图识别错误的问题 See merge request: cann/pypto!4777 | 8 小时前 | |
refactor(all): Remove trailing whitespace Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !2188 merge pre-commit into master refactor(all): Remove trailing whitespace Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Introduce pre-commit tools, and remove trailing white space with default plugin Related Issue: #1017 See merge request: cann/pypto!2188 | 3 个月前 | |
feat(dfx): Update compiler monitor api doc for tracking compilation progress and detecting timeout. Co-authored-by: z00521416<zhangyongtao7@hisilicon.com> # message auto-generated for no-merge-commit merge: !1511 merge master into master feat(dfx): Update compiler monitor api doc for tracking compilation progress and detecting timeout. Created-by: z00521416 Commit-by: z00521416 Merged-by: cann-robot Description: 1. Update compiler monitor api doc for tracking compilation progress and detecting timeout. 2. Migrate PNG files to LFS. See merge request: cann/pypto!1511 | 3 个月前 | |
feat(build): Support packing whl into run Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4267 merge master into master feat(build): Support packing whl into run Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 此 PR 为 PyPTO 项目新增了将 Python wheel ( .whl) 包打入 CANN .run 安装包的能力。通过引入 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 特性开关,将构建产物(whl 包及脚本)整合到 CANN 标准的 run 包交付流程中,使 whl 包能随 run 包一起分发和安装。整体改动涵盖 CMake 构建体系扩展、安装/卸载脚本框架搭建、包描述 XML 配置以及 CI 构建入口适配。 ## 主要改动 - **新增 CMake 打包基础设施**:新增 cmake/package.cmake(安装 whl 及脚本到 run 包目录结构)、cmake/prepare.cmake(第三方路径初始化)、cmake/fetch_cann_cmake.cmake(自动下载 CANN 公共 cmake 脚本)、version.cmake(版本声明 9.1.0),均在 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 开关控制下生效;cmake/config.cmake 中移除了部分不再需要的配置(-17 行)。 - **新增 run 包安装/卸载脚本体系**:在 scripts/package/pypto/scripts/ 下新增 10 个 Shell 脚本,包括 install.sh(安装入口)、uninstall.sh(卸载入口)、run_pypto_install.sh(文件拷贝调度及 whl 的 pip install 后处理)、run_pypto_uninstall.sh(卸载流程)、pypto_custom_install.sh/pypto_custom_uninstall.sh(自定义安装/卸载逻辑)、pypto_func.sh(公共函数库,492 行)、ver_check.sh(版本校验)、cleanup.sh 和 help.info,构成了完整的 run 包生命周期管理。 - **新增包描述 XML 配置**:新增 scripts/package/pypto/pypto.xml 作为 run 包的主配置文件(定义包名 pypto、安装脚本路径、版本信息、目录结构等),并在 scripts/package/module/ascend/ 下新增 5 个模块级 XML(EngineeringCommon.xml、EngineeringFiles.xml、PyptoBin.xml、PyptoInc.xml、PyptoSo.xml),用于描述不同子模块的安装路径和权限。 - **CI 构建入口 build_ci.py 适配**:大幅扩展 build_ci.py(+80/-32),使其支持打包 whl 到 run 包的新构建模式,整合新的 CMake 流程和参数配置。 See merge request: cann/pypto!4267 | 17 天前 | |
refactor(all): Remove trailing whitespace Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !2188 merge pre-commit into master refactor(all): Remove trailing whitespace Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Introduce pre-commit tools, and remove trailing white space with default plugin Related Issue: #1017 See merge request: cann/pypto!2188 | 3 个月前 | |
refactor(agent): Remove operator-development skills and agents Co-authored-by: wangzheng97<wangzheng97@hisilicon.com> # message auto-generated for no-merge-commit merge: !4605 merge chore-remove-op-dev-skills into master refactor(agent): Remove operator-development skills and agents Created-by: wangzheng97 Commit-by: wangzheng97 Merged-by: cann-robot Description: refactor(agent): Remove operator-development skills and agents The agents and skills in this repository should focus on developing and maintaining the PyPTO framework itself: debugging and error location, compile-time Pass analysis, environment setup, and PR/Issue workflows. This PR removes the operator-development skills and agents together with their state-machine plugins and lint hook, so the tooling scope matches the repository. Changes: - Delete 17 operator-development skills (api-explore, golden-generate, op-design, op-develop, op-perf-tune, precision-compare, fused-op-integration, etc.) - Delete 9 operator-development agents (op-orchestrator, op-coder, op-verifier, etc.) - Delete state-machine plugins (.opencode/plugins/: op-lint, state-transition) and the lint engine (.agents/hooks/pypto-op-lint/) - Delete migrate-huggingface-to-npu (unrelated to framework maintenance) - Update .agents/README.md and AGENTS.md, and delete .agents/settings.json, to drop the now-dangling references; trim AGENTS.md to project scope, general principles and entry-point lookup - Consolidate AGENTS.md's general principles into 5 core rules: the 4 principles from Andrej Karpathy's CLAUDE.md (official Chinese translation, forrestchang/andrej-karpathy-skills) — think before coding, simplicity first, surgical changes, goal-driven execution — plus one evidence-before-conclusion rule for diagnostic work - Inline list_idle_chip_ids.sh into pypto-environment-setup and fix dangling references in pypto-skill-validation-prompt and docs/zh/trouble_shooting - Keep pypto-code-merge-agent and the framework debugging / Pass / environment / PR-Issue skills Related Issues: #2533 See merge request: cann/pypto!4605 | 8 天前 | |
feat(build): Support packing whl into run add cmakelists Co-authored-by: wuyi2026<wuyi55@huawei.com> # message auto-generated for no-merge-commit merge: !4323 merge master into master feat(build): Support packing whl into run add cmakelists Created-by: wuyi2026 Commit-by: wuyi2026 Merged-by: cann-robot Description: Add missing files into cmakelists supprto whl build See merge request: cann/pypto!4323 | 15 天前 | |
refactor(all): Remove trailing whitespace Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !2188 merge pre-commit into master refactor(all): Remove trailing whitespace Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Introduce pre-commit tools, and remove trailing white space with default plugin Related Issue: #1017 See merge request: cann/pypto!2188 | 3 个月前 | |
fix(docs): Precision tools do not have a recompilation scenario Co-authored-by: lyz0328<liyanzhen@huawei.com> # message auto-generated for no-merge-commit merge: !4153 merge master into master fix(docs): Precision tools do not have a recompilation scenario Created-by: lyz0328 Commit-by: lyz0328 Merged-by: cann-robot Description: 1、仓库文档国际化,新增英文readme文件,skill和docs暂不翻译 2、精度工具文档陈旧内容修改:1)删除精度工具重编译步骤 2)更新msaccucmp.py执行命令,明确执行路径、不带版本信息,便于用户在不同版本通用执行 3、webide安装方式的安装界面截图变更 Related Issue: #2345 See merge request: cann/pypto!4153 | 17 天前 | |
Initial commit | 6 个月前 | |
feat(build): Compile pypto_impl online support multi user Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4327 merge master into master feat(build): Compile pypto_impl online support multi user Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 此 PR 为 pypto_impl 的在线编译流程增加了多用户场景支持。核心改动集中在 BuildOnlinePyptoImplManager 类中:通过引入 fcntl 文件锁实现跨进程编译协调、新增用户级缓存目录回退机制、以及基于 importlib 的非标准路径动态加载能力,使得不同用户可以在共享安装目录下安全地并发编译和加载 pypto_impl.so,避免了写冲突和重复编译。 ## 主要改动 - **多进程编译协调与文件锁机制**:BuildOnlinePyptoImplManager.ensure_pypto_impl 新增基于 fcntl.flock 的文件锁协调逻辑(_try_acquire_lock、_wait_and_compile),配合 _poll_until 轮询等待,确保同版本 Python 的多进程不会同时执行编译;锁文件在编译完成后被删除,用于跨用户的 os.path.exists() 状态检测。 - **编译产物缓存目录回退**:新增 _compute_cache_dir 方法,通过文件归属用户(st_uid)判断与实际写入验证双重检测,决定编译产物安装到 pkg_dir(共享路径)还是用户级缓存目录(~/.cache/cann/pypto)。当用户对 pkg_dir 无写权限时自动回退,实现多用户环境下的安全编译。 - **跨用户编译等待共享**:新增 _wait_for_pkg_dir_compilation 方法,通过只读检查 pkg_dir 下的 lock 文件是否存在,感知其他用户正在进行的编译,并等待其完成后复用产物,避免重复编译。 - **非标准路径的 .so 动态加载**:新增 _load_from_cache 方法,通过 importlib.util.spec_from_file_location 和 sys.modules 注册,支持从缓存目录等非 pkg_dir 路径加载 pypto_impl.so,同时将模块注册为 pypto.pypto_impl 属性和 sys.modules 条目,确保 from pypto import pypto_impl 可正确访问。 See merge request: cann/pypto!4327 | 14 天前 | |
feat(interface): Support getinputdata for all integral types Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !2224 merge refactor/deadcode into master feat(interface): Support getinputdata for all integral types Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: 1. startArgsSymbolHandlerList of devProg does not used any more 2. Support getinputdata for all integral types Related Issue: [#408](https://gitcode.com/cann/pypto/issues/408) See merge request: cann/pypto!2224 | 3 个月前 | |
docs(install): Simple Install for PyPTO Co-authored-by: duanhaotian<duanhaotian@huawei.com> # message auto-generated for no-merge-commit merge: !4812 merge dht0710 into master docs(install): Simple Install for PyPTO Created-by: duanhaotian Commit-by: duanhaotian Merged-by: cann-robot Description: PR 应该避免没有描述信息, 描述信息的最重要的作用是描述修改意图,应该清晰明了. 例如: 标题中包含了 fix 标签, 如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性. 如果PR和特定的Issue相关,可以单独包含一行 Related Issue: 放到描述信息最后. 下面是一个典型的PR描述信息: The origin issue template brings too many noise, it's not suitable for git message. eg: comments are not removed, labels are redundant as the PR tile already contains the tag. The guide gives a clear suggestion on how to write the PR body. Related Issue: #1234,#5678 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!4812 | 1 天前 | |
docs(install): Simple Install for PyPTO Co-authored-by: duanhaotian<duanhaotian@huawei.com> # message auto-generated for no-merge-commit merge: !4812 merge dht0710 into master docs(install): Simple Install for PyPTO Created-by: duanhaotian Commit-by: duanhaotian Merged-by: cann-robot Description: PR 应该避免没有描述信息, 描述信息的最重要的作用是描述修改意图,应该清晰明了. 例如: 标题中包含了 fix 标签, 如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性. 如果PR和特定的Issue相关,可以单独包含一行 Related Issue: 放到描述信息最后. 下面是一个典型的PR描述信息: The origin issue template brings too many noise, it's not suitable for git message. eg: comments are not removed, labels are redundant as the PR tile already contains the tag. The guide gives a clear suggestion on how to write the PR body. Related Issue: #1234,#5678 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!4812 | 1 天前 | |
fix(docs): Precision tools do not have a recompilation scenario Co-authored-by: lyz0328<liyanzhen@huawei.com> # message auto-generated for no-merge-commit merge: !4153 merge master into master fix(docs): Precision tools do not have a recompilation scenario Created-by: lyz0328 Commit-by: lyz0328 Merged-by: cann-robot Description: 1、仓库文档国际化,新增英文readme文件,skill和docs暂不翻译 2、精度工具文档陈旧内容修改:1)删除精度工具重编译步骤 2)更新msaccucmp.py执行命令,明确执行路径、不带版本信息,便于用户在不同版本通用执行 3、webide安装方式的安装界面截图变更 Related Issue: #2345 See merge request: cann/pypto!4153 | 17 天前 | |
fix(docs): Precision tools do not have a recompilation scenario Co-authored-by: lyz0328<liyanzhen@huawei.com> # message auto-generated for no-merge-commit merge: !4153 merge master into master fix(docs): Precision tools do not have a recompilation scenario Created-by: lyz0328 Commit-by: lyz0328 Merged-by: cann-robot Description: 1、仓库文档国际化,新增英文readme文件,skill和docs暂不翻译 2、精度工具文档陈旧内容修改:1)删除精度工具重编译步骤 2)更新msaccucmp.py执行命令,明确执行路径、不带版本信息,便于用户在不同版本通用执行 3、webide安装方式的安装界面截图变更 Related Issue: #2345 See merge request: cann/pypto!4153 | 17 天前 | |
fix(interpreter): Fix tile_fwk_calculator compiler error in g++ 13.3.0 Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !1453 merge interpreter into master fix(interpreter): Fix tile_fwk_calculator compiler error in g++ 13.3.0 Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: Fix tile_fwk_calculator compiler error in g++ 13.3.0 See merge request: cann/pypto!1453 | 4 个月前 | |
feat(gcov): Support gcov of python scene Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !3250 merge master into master feat(gcov): Support gcov of python scene Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: 为 Python 前端用例增加 gcov 覆盖率统计能力。 主要修改: - 新增 gen_coverage_config.py 在 CMake POST_BUILD 阶段生成覆盖率配置 - setup.py 写入 build_dir 标记文件供 build_ci.py 定位配置文件 - build_ci.py 新增 py_generate_coverage 函数生成覆盖率报告 - 修复 CMake VERBATIM 问题,处理生成器表达式展开后的分号分隔路径(同时修复 C++ 覆盖率场景) See merge request: cann/pypto!3250 | 1 个月前 | |
fix(build): Prohibit directly calling the pip install command Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4703 merge master into master fix(build): Prohibit directly calling the pip install command Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 此 PR 在构建流程中增加了防呆保护机制,禁止用户直接执行 pip install . 或 pip install -e . 来覆盖 cann-toolkit 中已安装的 PyPTO 包。通过在 build_ci.py 中设置 PYPTO_ALLOW_WHL_BUILD 环境变量,并在 setup.py 的 SetupCtrl 中检查该变量,确保只有通过 build_ci.py 触发的构建流程才被允许生成 .whl 包。 ## 主要改动 - **build_ci.py 中注入环境变量**: 在 BuildCtrl 类的 get_cmake_build_update_env 方法中,新增 PYPTO_ALLOW_WHL_BUILD 环境变量并设为 "1",作为允许 whl 构建的标识。 - **setup.py 中增加启动前检查**: 在 SetupCtrl 的 whl 构建入口处读取 PYPTO_ALLOW_WHL_BUILD 环境变量,若未设置或为假值则抛出 RuntimeError,提示用户使用 .run 格式的二进制包或 build_ci.py 来管理 PyPTO。 See merge request: cann/pypto!4703 | 3 天前 | |
feat(ir): Add block codegen and backend Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !3864 merge master into master feat(ir): Add block codegen and backend Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: Add block codegen and backend See merge request: cann/pypto!3864 | 15 天前 | |
feat(build): Support packing whl into run Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4267 merge master into master feat(build): Support packing whl into run Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 此 PR 为 PyPTO 项目新增了将 Python wheel ( .whl) 包打入 CANN .run 安装包的能力。通过引入 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 特性开关,将构建产物(whl 包及脚本)整合到 CANN 标准的 run 包交付流程中,使 whl 包能随 run 包一起分发和安装。整体改动涵盖 CMake 构建体系扩展、安装/卸载脚本框架搭建、包描述 XML 配置以及 CI 构建入口适配。 ## 主要改动 - **新增 CMake 打包基础设施**:新增 cmake/package.cmake(安装 whl 及脚本到 run 包目录结构)、cmake/prepare.cmake(第三方路径初始化)、cmake/fetch_cann_cmake.cmake(自动下载 CANN 公共 cmake 脚本)、version.cmake(版本声明 9.1.0),均在 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 开关控制下生效;cmake/config.cmake 中移除了部分不再需要的配置(-17 行)。 - **新增 run 包安装/卸载脚本体系**:在 scripts/package/pypto/scripts/ 下新增 10 个 Shell 脚本,包括 install.sh(安装入口)、uninstall.sh(卸载入口)、run_pypto_install.sh(文件拷贝调度及 whl 的 pip install 后处理)、run_pypto_uninstall.sh(卸载流程)、pypto_custom_install.sh/pypto_custom_uninstall.sh(自定义安装/卸载逻辑)、pypto_func.sh(公共函数库,492 行)、ver_check.sh(版本校验)、cleanup.sh 和 help.info,构成了完整的 run 包生命周期管理。 - **新增包描述 XML 配置**:新增 scripts/package/pypto/pypto.xml 作为 run 包的主配置文件(定义包名 pypto、安装脚本路径、版本信息、目录结构等),并在 scripts/package/module/ascend/ 下新增 5 个模块级 XML(EngineeringCommon.xml、EngineeringFiles.xml、PyptoBin.xml、PyptoInc.xml、PyptoSo.xml),用于描述不同子模块的安装路径和权限。 - **CI 构建入口 build_ci.py 适配**:大幅扩展 build_ci.py(+80/-32),使其支持打包 whl 到 run 包的新构建模式,整合新的 CMake 流程和参数配置。 See merge request: cann/pypto!4267 | 17 天前 | |
feat(build): Support pypto.run install in python3.7 & 3.8 Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4576 merge master into master feat(build): Support pypto.run install in python3.7 & 3.8 Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: feat(build): Support pypto.run install in python3.7 & 3.8 See merge request: cann/pypto!4576 | 9 天前 | |
feat(build): Support packing whl into run Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4267 merge master into master feat(build): Support packing whl into run Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 此 PR 为 PyPTO 项目新增了将 Python wheel ( .whl) 包打入 CANN .run 安装包的能力。通过引入 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 特性开关,将构建产物(whl 包及脚本)整合到 CANN 标准的 run 包交付流程中,使 whl 包能随 run 包一起分发和安装。整体改动涵盖 CMake 构建体系扩展、安装/卸载脚本框架搭建、包描述 XML 配置以及 CI 构建入口适配。 ## 主要改动 - **新增 CMake 打包基础设施**:新增 cmake/package.cmake(安装 whl 及脚本到 run 包目录结构)、cmake/prepare.cmake(第三方路径初始化)、cmake/fetch_cann_cmake.cmake(自动下载 CANN 公共 cmake 脚本)、version.cmake(版本声明 9.1.0),均在 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 开关控制下生效;cmake/config.cmake 中移除了部分不再需要的配置(-17 行)。 - **新增 run 包安装/卸载脚本体系**:在 scripts/package/pypto/scripts/ 下新增 10 个 Shell 脚本,包括 install.sh(安装入口)、uninstall.sh(卸载入口)、run_pypto_install.sh(文件拷贝调度及 whl 的 pip install 后处理)、run_pypto_uninstall.sh(卸载流程)、pypto_custom_install.sh/pypto_custom_uninstall.sh(自定义安装/卸载逻辑)、pypto_func.sh(公共函数库,492 行)、ver_check.sh(版本校验)、cleanup.sh 和 help.info,构成了完整的 run 包生命周期管理。 - **新增包描述 XML 配置**:新增 scripts/package/pypto/pypto.xml 作为 run 包的主配置文件(定义包名 pypto、安装脚本路径、版本信息、目录结构等),并在 scripts/package/module/ascend/ 下新增 5 个模块级 XML(EngineeringCommon.xml、EngineeringFiles.xml、PyptoBin.xml、PyptoInc.xml、PyptoSo.xml),用于描述不同子模块的安装路径和权限。 - **CI 构建入口 build_ci.py 适配**:大幅扩展 build_ci.py(+80/-32),使其支持打包 whl 到 run 包的新构建模式,整合新的 CMake 流程和参数配置。 See merge request: cann/pypto!4267 | 17 天前 | |
fix(build): Prohibit directly calling the pip install command Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4703 merge master into master fix(build): Prohibit directly calling the pip install command Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 此 PR 在构建流程中增加了防呆保护机制,禁止用户直接执行 pip install . 或 pip install -e . 来覆盖 cann-toolkit 中已安装的 PyPTO 包。通过在 build_ci.py 中设置 PYPTO_ALLOW_WHL_BUILD 环境变量,并在 setup.py 的 SetupCtrl 中检查该变量,确保只有通过 build_ci.py 触发的构建流程才被允许生成 .whl 包。 ## 主要改动 - **build_ci.py 中注入环境变量**: 在 BuildCtrl 类的 get_cmake_build_update_env 方法中,新增 PYPTO_ALLOW_WHL_BUILD 环境变量并设为 "1",作为允许 whl 构建的标识。 - **setup.py 中增加启动前检查**: 在 SetupCtrl 的 whl 构建入口处读取 PYPTO_ALLOW_WHL_BUILD 环境变量,若未设置或为假值则抛出 RuntimeError,提示用户使用 .run 格式的二进制包或 build_ci.py 来管理 PyPTO。 See merge request: cann/pypto!4703 | 3 天前 | |
feat(build): Support packing whl into run Co-authored-by: DCGDDD<yangxu14@huawei.com> # message auto-generated for no-merge-commit merge: !4267 merge master into master feat(build): Support packing whl into run Created-by: DCGDDD Commit-by: DCGDDD Merged-by: cann-robot Description: ## 变更摘要 此 PR 为 PyPTO 项目新增了将 Python wheel ( .whl) 包打入 CANN .run 安装包的能力。通过引入 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 特性开关,将构建产物(whl 包及脚本)整合到 CANN 标准的 run 包交付流程中,使 whl 包能随 run 包一起分发和安装。整体改动涵盖 CMake 构建体系扩展、安装/卸载脚本框架搭建、包描述 XML 配置以及 CI 构建入口适配。 ## 主要改动 - **新增 CMake 打包基础设施**:新增 cmake/package.cmake(安装 whl 及脚本到 run 包目录结构)、cmake/prepare.cmake(第三方路径初始化)、cmake/fetch_cann_cmake.cmake(自动下载 CANN 公共 cmake 脚本)、version.cmake(版本声明 9.1.0),均在 ENABLE_FEATURE_PACKING_WHL_INTO_RUN 开关控制下生效;cmake/config.cmake 中移除了部分不再需要的配置(-17 行)。 - **新增 run 包安装/卸载脚本体系**:在 scripts/package/pypto/scripts/ 下新增 10 个 Shell 脚本,包括 install.sh(安装入口)、uninstall.sh(卸载入口)、run_pypto_install.sh(文件拷贝调度及 whl 的 pip install 后处理)、run_pypto_uninstall.sh(卸载流程)、pypto_custom_install.sh/pypto_custom_uninstall.sh(自定义安装/卸载逻辑)、pypto_func.sh(公共函数库,492 行)、ver_check.sh(版本校验)、cleanup.sh 和 help.info,构成了完整的 run 包生命周期管理。 - **新增包描述 XML 配置**:新增 scripts/package/pypto/pypto.xml 作为 run 包的主配置文件(定义包名 pypto、安装脚本路径、版本信息、目录结构等),并在 scripts/package/module/ascend/ 下新增 5 个模块级 XML(EngineeringCommon.xml、EngineeringFiles.xml、PyptoBin.xml、PyptoInc.xml、PyptoSo.xml),用于描述不同子模块的安装路径和权限。 - **CI 构建入口 build_ci.py 适配**:大幅扩展 build_ci.py(+80/-32),使其支持打包 whl 到 run 包的新构建模式,整合新的 CMake 流程和参数配置。 See merge request: cann/pypto!4267 | 17 天前 |
PyPTO
🔥最新动态
- 2026/04/10:0.2.0版本发布,变更前端表达方法,提升易用性、增强功能及性能,完善各模块能力,优化开发体验与运行效率
- 2026/03/30:v0.1.2版本发布,支持集群训练场景、优化框架编译性能与基础性能、修复已知整网集成问题
- 2026/03/09:v0.1.1版本发布,支持新前端、进一步增加API丰富程度、修复一些已知问题
- 2026/01/06:v0.1.0版本发布,PyPTO项目初始版本
- 2025/12:PyPTO项目首次上线。
🚀概述
PyPTO(发音:pai p-t-o)是一款面向AI加速器的高性能编程框架,旨在简化复杂融合算子乃至整个模型网络的开发流程,同时保持高性能计算能力。该框架采用创新的PTO(Parallel Tensor/Tile Operation)编程范式,以基于Tile的编程模型为核心设计理念,通过多层次的中间表示(IR)系统,将用户通过API构建的AI模型应用从高层次的Tensor图逐步编译成硬件指令,最终生成可在目标平台上高效执行的可执行代码。
本仓已集成代码仓库智能体,点击 徽章,进入其专属页面,开启在线智能代码学习与知识问答体验!
核心特性
- 基于 Tile 的编程模型:所有计算都基于Tile(硬件感知的数据块)进行,充分利用硬件并行计算能力和内存层次结构
- 多层级计算图转换:通过编译Pass将Tensor Graph转换为Tile Graph、Block Graph和Execution Graph,每一步包括一系列Pass优化流程
- 自动化代码生成:编译结果通过CodeGen生成底层PTO虚拟指令代码,再通过编译器将虚拟指令代码编译成目标平台的可执行代码
- MPMD 执行调度:可执行代码被加载到设备侧,通过MPMD(Multiple Program Multiple Data)的方式调度到设备上的处理器核
- 完整的工具链支持:全流程的编译中间产物和运行时性能数据可通过IDE集成的工具链可视化识别性能瓶颈,开发者也可以通过工具链控制编译和调度行为
- Python 友好 API:提供直观的Tensor级别抽象,贴近算法开发者的思维模式,支持动态Shape和符号化编程
- 分层抽象设计:对不同开发者暴露不同抽象层次,算法开发者使用Tensor层次,性能专家使用Tile层次,系统开发者使用Block层次
目标用户
- 算法开发者:主要使用Tensor层次编程,快速实现和验证算法,专注于算法逻辑
- 性能优化专家:可使用Tile或Block层次,进行深度性能调优,以实现极致性能
- 系统开发者:可在Tensor/Tile/Block和PTO虚拟指令集层次上进行三方框架对接或集成,以及工具链开发
⚡️最佳实践样例
PyPTO提供了丰富的示例代码,涵盖从基础操作到复杂模型实现的多个层级。一些最佳实践样例参考:
大模型实现样例
- DeepSeekV3.2 SFA -稀疏Flash Attention量化实现
- DeepSeekV3.2 MLA-PROLOG -MLA Indexer Prolog量化实现
- GLM V4.5 Attention -GLM注意力机制实现
- GLM V4.5 ExpertsSelector -GLM专家选择器实现
学习路径
在 examples目录下,我们规划了多个层级的样例:
- beginner/:基础操作示例,帮助初学者快速上手PyPTO编程
- intermediate/:中级示例,包括自定义操作、神经网络模块等
- advanced/:高级示例,包括复杂模式和多函数组合
pypto-gym 样例仓
在 pypto-gym样例仓,我们提供了融合算子开发样例和大模型适配样例,供开发者学习、复用与对比
这些示例可以帮助开发者学习如何编写PyPTO算子,从简单的Tensor操作到复杂的模型网络实现,以便快速实现移植和部署
📌版本配套
本项目源码会跟随CANN软件版本发布,关于CANN软件版本与本项目标签的对应关系请参阅release仓库中的相应版本说明。 请注意,为确保您的源码定制开发顺利进行,请选择配套的CANN版本与Gitcode标签源码,使用master分支可能存在版本不匹配的风险。
⚡️快速入门
若您希望快速体验PyPTO的使用和开发过程,请访问如下文档获取简易教程。
- 环境部署:介绍项目基础环境的搭建,包括软件包和第三方依赖的获取和安装。
- 编译安装:环境部署后,介绍如何快速获取或编译PyPTO软件包并安装。
- 样例运行:安装PyPTO软件包后,介绍如何快速实现样例运行。
📖文档资源
若您希望深入体验项目功能并修改源码,请访问如下文档获取详细教程。
🔍目录结构
关键目录如下:
├── docs/ # 文档资源
│ └── zh/
│ ├── api/ # API参考文档
│ ├── contribute/ # 贡献指南文档
│ └── tutorials/ # PyPTO编程指南
│
├── examples/ # 示例代码
│ ├── 01_beginner/ # 初级示例
│ ├── 02_intermediate/ # 中级示例
│ └── 03_advanced/ # 高级示例
│
├── models/ # 模型实现示例
│
├── python/ # Python源码
│ ├── pypto/ # Python包源码根目录
│ ├── src/ # pybind11源码根目录
│ └── tests/ # Python测试用例源码(UTest, STest)
│
├── framework/ # C++源码根目录
│ ├── include/ # C++对外头文件
│ ├── src/ # C++源码
│ │ ├── codegen/ # 代码生成模块
│ │ ├── passes/ # 编译Pass模块
│ │ └── ...
│ └── tests/ # C++测试用例源码
│
├── tools/ # 工具脚本
│
├── cmake/ # 构建所需的CMake公共配置及脚本
├── build_ci.py # CI执行构建、执行UTest、执行STest辅助脚本
├── CMakeLists.txt # 顶层CMakeLists.txt,定义所有对外公开编译开关
├── pyproject.toml # Python编译工具配置文件
├── LICENSE # 许可证文件
└── setup.py # Python编译工具脚本文件(setuptools)
📝相关信息
联系我们
- 问题反馈:通过GitCode【Issues】提交问题
- 功能建议:通过GitCode【讨论】参与交流
- 技术支持:参考文档或提交Issue
注意:本文档会持续更新,请关注最新版本。