| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat: 支持 canfuse 的 python 化 Co-authored-by: lfz2812<220252399@seu.edu.cn> # message auto-generated for no-merge-commit merge: !3996 merge master into develop feat: 支持 canfuse 的 python 化 Created-by: lfz2812 Commit-by: lfz2812 Merged-by: cann-robot Description: # Pull Request ## 描述 将 GE 原生 GraphFuseInspectorUtils::CanFuse 能力开放至 Python,使 Python 融合 Pass 可以在改图前检查指定节点集合是否满足融合条件。 Python 化过程: 1. 在 pybind native 层新增 can_fuse 绑定: - 接收 Python Node 可迭代对象。 - 将 Python Node 转换为 C++ GNode 集合。 - 调用 GraphFuseInspectorUtils::CanFuse 执行融合检查。 - 将检查结果和失败原因返回 Python。 2. 在 Python 层新增 fuse_inspector.py: - 提供 can_fuse(nodes) 接口。 - 使用不可变的 FuseCheckResult 封装检查结果。 - 对输入元素进行类型检查,避免非法参数进入 native C++。 3. 在 ge.passes 中公开: - can_fuse - FuseCheckResult 4. 更新 native 模块构建配置、Python 类型声明及中英文 API 文档。 5. 补充 Python UT,覆盖: - 正常节点集合可融合。 - generator 类型入参。 - 空节点集合。 - stream label 冲突。 - 节点来自不同计算图。 - 非 ge.graph.Node 类型参数。 调用示例: python from ge.passes import can_fuse result = can_fuse(nodes) if not result.ok: context.set_error_message(result.reason) return False ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 关联 Issue:#299 ## 如何测试 新增 python_graph_fuse_inspector_test.py,验证 can_fuse 的正常、异常及边界场景。 执行 Python UT: python bash tests/run_test.sh --ut=python ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 原有 Python Pass 接口保持不变,本次仅新增 can_fuse 的 Python 调用能力。 See merge request: cann/ge!3996 | 1 个月前 | |
feat: 新增 Python 自定义算子样例及文档 Co-authored-by: du-hua1024<duhua2@huawei.com> # message auto-generated for no-merge-commit merge: !3989 merge op into develop feat: 新增 Python 自定义算子样例及文档 Created-by: du-hua1024 Commit-by: du-hua1024 Merged-by: cann-robot Description: # Pull Request ## 描述 在 args_refresh_add_custom 路径下新增 Python 版本样例,展示通过 Python EagerExecuteOp 在 GE 在线执行中加载 Bisheng 预编译产物,并使用 ACL Python runtime 完成 kernel 参数构造和下发。 主要变更: - 将原 args_refresh_add_custom C++ 样例整理到 cpp/ 目录,保持原 ArgsUpdater 对比样例能力。 - 新增 python/ 样例,包括 REG_OP proto、ES wheel 生成、run.sh、Python custom op 实现和 Session.run_graph 入口。 - Python 样例通过 bisheng 编译 host object,并提取 .aicore_binary 后由 acl.rt.binary_load_from_file 加载。 - 更新 custom op 示例总览和 GE Python custom op 设计文档。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 - bash -n examples/custom_op/args_refresh_add_custom/python/run.sh ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 无 See merge request: cann/ge!3989 | 1 个月前 | |
refactor: 清理文档目录,更新配置文件 | 2 个月前 | |
refactor: 清理文档目录,更新配置文件 | 2 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 1 个月前 | ||
| 2 个月前 | ||
| 2 个月前 |