文件最后提交记录最后更新时间
docs: 优化融合 pattern pass 文档&&Python pass API/行为调整 Co-authored-by: kobemini<gengchao4@huawei.com> # message auto-generated for no-merge-commit merge: !3248 merge doc/pass-reade-me into develop docs: 优化融合 pattern pass 文档&&Python pass API/行为调整 Created-by: kobemini Commit-by: kobemini Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 优化融合 Pattern Pass 的机制说明、开发指南和 Python 写法体验,目标是让用户能按文档理解机制并完成自定义融合 pass 开发。 主要变更: - 新增融合 Pattern Pass 特性文档,按“匹配 → 条件过滤 → 替换 → 边界规则 → capture tensor → DecomposePass → 执行阶段”说明统一机制。 - 新增 Python / C++ 融合 Pass 开发指南,Python 侧突出运行时接入、@pattern 表达式写法和 replacement 表达式返回。 - 删除旧的混合指南,将内容拆分到特性文档和 C++/Python 指南中,并更新 examples、架构文档和 ASCEND_GE_PY_PASS_PATH 文档入口。 - 收口 Python capture tensor 写法:去掉公开的独立 capture_tensor() helper,统一使用 Pattern.capture_tensor(...)。 - 增强 Pattern.capture_tensor:支持直接传入 TensorHolderNodeNodeIo,示例写法从 pat.capture_tensor(capture_tensor(matmul)) 简化为 pat.capture_tensor(matmul)。 - 增强 @pattern 自动 capture 规则:从“只捕获已访问输入”提升为“先捕获已访问输入,再捕获 return 的 pattern 输出”,并在文档中明确 capture 顺序。 ## 变更类型 - [ ] Bug 修复 - [x] 新功能 - [ ] 代码风格更新(格式化,局部变量) - [ ] 重构(既不修复错误也不增加功能的代码变动) - [ ] 构建过程或辅助工具的变动 - [x] 文档内容更新 ## 关联的 Issue 无 ## 如何测试 已执行: - git diff --check - python3 -m py_compile 检查修改过的 Python pass 框架文件、示例和 Python 测试文件 - 检查本 PR 修改文档中的相对链接均存在 - 检索确认旧的 capture_tensor(capture_tensor(...)) 嵌套写法、独立 capture_tensor 导出和旧文档入口已清理 - python3 -m pytest tests/ge/ut/ge/graph/pyge_tests/python_pattern_pass_test.py::... - ut_fusion_pass_executor_utest ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md) ## 其他信息 当前 PR 包含文档和 Python pass API/行为调整。@pattern 自动 capture 顺序为:先按输入序号捕获已访问的 inputs,再按 return 结构顺序捕获 pattern 输出。 See merge request: cann/ge!32483 天前