| docs: 补充 AnnotatedArgs 地址刷新 Python 资料与样例 Co-authored-by: shangdf<shangdongfang1@huawei.com> # message auto-generated for no-merge-commit merge: !4316 merge feature/annotated-args-python-docs-example into develop docs: 补充 AnnotatedArgs 地址刷新 Python 资料与样例 Created-by: shangdf Commit-by: shangdf Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 从 PR 4254 中拆出 AnnotatedArgs 地址刷新接口 Python 化的资料与可运行样例,降低核心实现 PR 的检视规模。 变更内容: - 更新 GE Python 自定义算子中英文资料,补充 declare_launch_args、AnnotatedArgsContext、显式刷新模式及老 OM 兼容说明。 - 新增 examples/custom_op/annotated_args_refresh_add_custom/python/,覆盖 Python 构图、ATC 离线编译、无 Python 环境加载以及两轮地址刷新执行。 - 本 PR 不包含接口实现和 UT/ST;核心能力由 PR 4254 提供。 依赖关系:本 PR 依赖 PR 4254,需在 PR 4254 合入后再合入。本 PR 暂以 [wip] 标记。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 依赖 PR:https://gitcode.com/cann/ge/pull/4254 ## 如何测试 1. 对全部 15 个变更文件运行 pre-commit run --files ...,所有检查通过。 2. 对 python/run.sh 运行 bash -n,并对 3 个 Python 源文件运行 AST 语法解析,检查通过。 3. example 文件与 PR 4254 拆分前完成 NPU 端到端验证的版本一致;待 PR 4254 核心能力合入后,可按 python/README.md 在真机重新执行完整验证。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - 源分支:feature/annotated-args-python-docs-example - 基线:develop(创建分支时对应提交 7494a9777) - 本 PR 仅包含资料和 example,便于与核心实现分别检视。 See merge request: cann/ge!4316 | 2 个月前 |
| refactor: 删除 Python custom op 历史 execute(ctx) 接口 Co-authored-by: du-hua1024<duhua2@huawei.com> # message auto-generated for no-merge-commit merge: !4500 merge op into develop refactor: 删除 Python custom op 历史 execute(ctx) 接口 Created-by: du-hua1024 Commit-by: du-hua1024 Merged-by: cann-robot Description: # Pull Request ## 描述 删除 Python custom op 历史 execute(ctx) 接口及相关适配逻辑,统一使用基于 canonical IR 的 schema-bound execute 回调。 主要变更: - 删除 BaseCustomOp、EagerExecuteOp 的 Python 外部继承方式及历史 base.py。 - execute 和 declare_launch_args 统一要求显式声明 -> None,并校验回调实际返回值必须为 None。 - 上下文不再作为 execute 入参,通过 get_execute_ctx() 获取 EagerOpExecutionContext。 - 删除 legacy execute 的 bridge、签名校验、示例和测试适配逻辑。 - 补充 EagerOpExecutionContext、get_execute_ctx、execute 及上下文方法的中文 API 文档。 ## 变更类型 - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 修改用例执行正常,不影响先有execute example ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了静态自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:、fix:、refactor:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅保留 schema-bound canonical IR 执行路径,不再兼容历史 execute(ctx) 写法。 See merge request: cann/ge!4500 | 1 个月前 |
| fix: 修复precommit误删的py引用 Co-authored-by: yelongjian<yelongjian1@huawei.com> # message auto-generated for no-merge-commit merge: !3885 merge dev-precommit0706 into develop fix: 修复precommit误删的py引用 Created-by: yelongjian Commit-by: yelongjian Merged-by: cann-robot Description: # Pull Request ## 描述 修复precommit误删的py引用 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1.NA ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/ge!3885 | 3 个月前 |
| fix: 修复sample问题 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !3937 merge fix/sample_issue into develop fix: 修复sample问题 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: # Pull Request ## 描述 fix: 修复sample问题 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/ge!3937 | 3 个月前 |
| fix: precommit整改 Co-authored-by: yelongjian<yelongjian1@huawei.com> # message auto-generated for no-merge-commit merge: !3726 merge dev-precommit into develop fix: precommit整改 Created-by: yelongjian Commit-by: yelongjian Merged-by: cann-robot Description: # Pull Request ## 描述 precommit整改 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1.NA ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/ge!3726 | 3 个月前 |
| feat: complete Python compilable custom-op online and offline example Co-authored-by: shangdf<shangdongfang1@huawei.com> # message auto-generated for no-merge-commit merge: !4477 merge feature/python-compilable-example-develop into develop feat: complete Python compilable custom-op online and offline example Created-by: shangdf Commit-by: shangdf Merged-by: cann-robot Description: ## 描述 为 GE PR 4388 提供独立的 Python compilable custom-op 示例,完整覆盖 online + offline 两条链路。本 PR 只包含 examples/custom_op 下的示例、索引和离线验证工具,不重复提交 4388 的核心实现。 示例使用同一个 Python compile / declare_launch_args 实现覆盖两条链路: - 在线:run_online.sh 通过 GE Session 构图,验证 CustomGraphOptimizer 调用 Python compile、Bisheng 生成 Ascend C kernel,并在线执行 x + y。 - 离线:run_offline.sh 由 C++ 程序生成 AIR,ATC 在 Python 插件可加载时调用同一个 compile 回调生成 OM;随后清除 Python 插件路径,仅保留 C++ OPP 交付件加载 OM 并执行。 平台信息使用 4388 的最终 API get_compile_platform_info();ASCEND_CUSTOM_OPP_PATH 同时配置 OPP 根目录和 Python 插件目录。 ## 依赖关系 本 PR 依赖 GE PR 4388 提供的 Python compilable 接口(register_op_impl 的 compile 能力、get_compile_platform_info()、native bridge)。请使用 4388 合入后的 GE/CANN 运行包进行完整验证。 ## 如何测试 - python3 -m pytest -q examples/custom_op/python_compilable_add_custom/test/test_python_compilable_add_custom.py - ruff check examples/custom_op/python_compilable_add_custom/src/ge/python_compilable_add_custom.py examples/custom_op/python_compilable_add_custom/src/run.py examples/custom_op/python_compilable_add_custom/test/test_python_compilable_add_custom.py - 配置 CANN、Bisheng 和 NPU 后执行 bash examples/custom_op/python_compilable_add_custom/run_online.sh - 配置 ATC 后执行 bash examples/custom_op/python_compilable_add_custom/run_offline.sh;该脚本在最后一步移除 Python 插件,验证 OM 执行不依赖 Python callback。 See merge request: cann/ge!4477 | 1 个月前 |
| feat(custom_op): 新增 TileLang 自定义算子入图/在线编译/离线模型下沉样例 Co-authored-by: qq_45842700<caodazhou@huawei.com> # message auto-generated for no-merge-commit merge: !4520 merge feat/tilelang-add-custom-examples into develop feat(custom_op): 新增 TileLang 自定义算子入图/在线编译/离线模型下沉样例 Created-by: Dazhou_Cao Commit-by: qq_45842700 Merged-by: cann-robot Description: # Pull Request ## 描述 本次 PR 新增三个 TileLang 自定义算子样例,展示如何使用 TileLang 语言开发 Ascend 自定义算子并通过 GE 进行入图、在线编译和离线模型下沉: 1. **tilelang_add_custom** — TileLang 算子入图样例,演示将 TileLang 编译的 kernel 注册为 GE 自定义算子并通过 Session 执行 2. **tilelang_add_custom_online** — TileLang 算子在线编译样例,演示在运行时动态编译 TileLang kernel 并执行 3. **tilelang_add_custom_offline** — TileLang 算子离线 OM 模型下沉样例,演示将 TileLang 算子编译为离线 OM 模型并执行 同时更新了 examples/custom_op/README.md 和 README_en.md,添加 TileLang 样例索引。 ## 变更类型 - [x] ✨ 新功能 ## 关联的Issue ## 如何测试 1. 进入对应样例目录(如 examples/custom_op/tilelang_add_custom) 2. 参考 README.md 配置环境变量(ASCEND_HOME_PATH 等) 3. 执行 bash run.sh 运行样例 4. 验证输出结果与预期一致 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定 ## 其他信息 样例参考了同目录下 triton_add_custom 等已有算子样例的结构。每个样例包含完整的源码、CMakeLists.txt、README 和运行脚本。 See merge request: cann/ge!4520 | 1 个月前 |
| feat(custom_op): 新增 TileLang 自定义算子入图/在线编译/离线模型下沉样例 Co-authored-by: qq_45842700<caodazhou@huawei.com> # message auto-generated for no-merge-commit merge: !4520 merge feat/tilelang-add-custom-examples into develop feat(custom_op): 新增 TileLang 自定义算子入图/在线编译/离线模型下沉样例 Created-by: Dazhou_Cao Commit-by: qq_45842700 Merged-by: cann-robot Description: # Pull Request ## 描述 本次 PR 新增三个 TileLang 自定义算子样例,展示如何使用 TileLang 语言开发 Ascend 自定义算子并通过 GE 进行入图、在线编译和离线模型下沉: 1. **tilelang_add_custom** — TileLang 算子入图样例,演示将 TileLang 编译的 kernel 注册为 GE 自定义算子并通过 Session 执行 2. **tilelang_add_custom_online** — TileLang 算子在线编译样例,演示在运行时动态编译 TileLang kernel 并执行 3. **tilelang_add_custom_offline** — TileLang 算子离线 OM 模型下沉样例,演示将 TileLang 算子编译为离线 OM 模型并执行 同时更新了 examples/custom_op/README.md 和 README_en.md,添加 TileLang 样例索引。 ## 变更类型 - [x] ✨ 新功能 ## 关联的Issue ## 如何测试 1. 进入对应样例目录(如 examples/custom_op/tilelang_add_custom) 2. 参考 README.md 配置环境变量(ASCEND_HOME_PATH 等) 3. 执行 bash run.sh 运行样例 4. 验证输出结果与预期一致 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定 ## 其他信息 样例参考了同目录下 triton_add_custom 等已有算子样例的结构。每个样例包含完整的源码、CMakeLists.txt、README 和运行脚本。 See merge request: cann/ge!4520 | 1 个月前 |
| feat(custom_op): 新增 TileLang 自定义算子入图/在线编译/离线模型下沉样例 Co-authored-by: qq_45842700<caodazhou@huawei.com> # message auto-generated for no-merge-commit merge: !4520 merge feat/tilelang-add-custom-examples into develop feat(custom_op): 新增 TileLang 自定义算子入图/在线编译/离线模型下沉样例 Created-by: Dazhou_Cao Commit-by: qq_45842700 Merged-by: cann-robot Description: # Pull Request ## 描述 本次 PR 新增三个 TileLang 自定义算子样例,展示如何使用 TileLang 语言开发 Ascend 自定义算子并通过 GE 进行入图、在线编译和离线模型下沉: 1. **tilelang_add_custom** — TileLang 算子入图样例,演示将 TileLang 编译的 kernel 注册为 GE 自定义算子并通过 Session 执行 2. **tilelang_add_custom_online** — TileLang 算子在线编译样例,演示在运行时动态编译 TileLang kernel 并执行 3. **tilelang_add_custom_offline** — TileLang 算子离线 OM 模型下沉样例,演示将 TileLang 算子编译为离线 OM 模型并执行 同时更新了 examples/custom_op/README.md 和 README_en.md,添加 TileLang 样例索引。 ## 变更类型 - [x] ✨ 新功能 ## 关联的Issue ## 如何测试 1. 进入对应样例目录(如 examples/custom_op/tilelang_add_custom) 2. 参考 README.md 配置环境变量(ASCEND_HOME_PATH 等) 3. 执行 bash run.sh 运行样例 4. 验证输出结果与预期一致 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定 ## 其他信息 样例参考了同目录下 triton_add_custom 等已有算子样例的结构。每个样例包含完整的源码、CMakeLists.txt、README 和运行脚本。 See merge request: cann/ge!4520 | 1 个月前 |
| fix: 修复precommit误删的py引用 Co-authored-by: yelongjian<yelongjian1@huawei.com> # message auto-generated for no-merge-commit merge: !3885 merge dev-precommit0706 into develop fix: 修复precommit误删的py引用 Created-by: yelongjian Commit-by: yelongjian Merged-by: cann-robot Description: # Pull Request ## 描述 修复precommit误删的py引用 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1.NA ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/ge!3885 | 3 个月前 |
| feat: complete Python compilable custom-op online and offline example Co-authored-by: shangdf<shangdongfang1@huawei.com> # message auto-generated for no-merge-commit merge: !4477 merge feature/python-compilable-example-develop into develop feat: complete Python compilable custom-op online and offline example Created-by: shangdf Commit-by: shangdf Merged-by: cann-robot Description: ## 描述 为 GE PR 4388 提供独立的 Python compilable custom-op 示例,完整覆盖 online + offline 两条链路。本 PR 只包含 examples/custom_op 下的示例、索引和离线验证工具,不重复提交 4388 的核心实现。 示例使用同一个 Python compile / declare_launch_args 实现覆盖两条链路: - 在线:run_online.sh 通过 GE Session 构图,验证 CustomGraphOptimizer 调用 Python compile、Bisheng 生成 Ascend C kernel,并在线执行 x + y。 - 离线:run_offline.sh 由 C++ 程序生成 AIR,ATC 在 Python 插件可加载时调用同一个 compile 回调生成 OM;随后清除 Python 插件路径,仅保留 C++ OPP 交付件加载 OM 并执行。 平台信息使用 4388 的最终 API get_compile_platform_info();ASCEND_CUSTOM_OPP_PATH 同时配置 OPP 根目录和 Python 插件目录。 ## 依赖关系 本 PR 依赖 GE PR 4388 提供的 Python compilable 接口(register_op_impl 的 compile 能力、get_compile_platform_info()、native bridge)。请使用 4388 合入后的 GE/CANN 运行包进行完整验证。 ## 如何测试 - python3 -m pytest -q examples/custom_op/python_compilable_add_custom/test/test_python_compilable_add_custom.py - ruff check examples/custom_op/python_compilable_add_custom/src/ge/python_compilable_add_custom.py examples/custom_op/python_compilable_add_custom/src/run.py examples/custom_op/python_compilable_add_custom/test/test_python_compilable_add_custom.py - 配置 CANN、Bisheng 和 NPU 后执行 bash examples/custom_op/python_compilable_add_custom/run_online.sh - 配置 ATC 后执行 bash examples/custom_op/python_compilable_add_custom/run_offline.sh;该脚本在最后一步移除 Python 插件,验证 OM 执行不依赖 Python callback。 See merge request: cann/ge!4477 | 1 个月前 |
| feat: complete Python compilable custom-op online and offline example Co-authored-by: shangdf<shangdongfang1@huawei.com> # message auto-generated for no-merge-commit merge: !4477 merge feature/python-compilable-example-develop into develop feat: complete Python compilable custom-op online and offline example Created-by: shangdf Commit-by: shangdf Merged-by: cann-robot Description: ## 描述 为 GE PR 4388 提供独立的 Python compilable custom-op 示例,完整覆盖 online + offline 两条链路。本 PR 只包含 examples/custom_op 下的示例、索引和离线验证工具,不重复提交 4388 的核心实现。 示例使用同一个 Python compile / declare_launch_args 实现覆盖两条链路: - 在线:run_online.sh 通过 GE Session 构图,验证 CustomGraphOptimizer 调用 Python compile、Bisheng 生成 Ascend C kernel,并在线执行 x + y。 - 离线:run_offline.sh 由 C++ 程序生成 AIR,ATC 在 Python 插件可加载时调用同一个 compile 回调生成 OM;随后清除 Python 插件路径,仅保留 C++ OPP 交付件加载 OM 并执行。 平台信息使用 4388 的最终 API get_compile_platform_info();ASCEND_CUSTOM_OPP_PATH 同时配置 OPP 根目录和 Python 插件目录。 ## 依赖关系 本 PR 依赖 GE PR 4388 提供的 Python compilable 接口(register_op_impl 的 compile 能力、get_compile_platform_info()、native bridge)。请使用 4388 合入后的 GE/CANN 运行包进行完整验证。 ## 如何测试 - python3 -m pytest -q examples/custom_op/python_compilable_add_custom/test/test_python_compilable_add_custom.py - ruff check examples/custom_op/python_compilable_add_custom/src/ge/python_compilable_add_custom.py examples/custom_op/python_compilable_add_custom/src/run.py examples/custom_op/python_compilable_add_custom/test/test_python_compilable_add_custom.py - 配置 CANN、Bisheng 和 NPU 后执行 bash examples/custom_op/python_compilable_add_custom/run_online.sh - 配置 ATC 后执行 bash examples/custom_op/python_compilable_add_custom/run_offline.sh;该脚本在最后一步移除 Python 插件,验证 OM 执行不依赖 Python callback。 See merge request: cann/ge!4477 | 1 个月前 |