Pull Request已成功合入, 合并人@CANN-robot
(感谢 邢智雄 的贡献)变更摘要
本次 PR 对 autofuse 项目中存在同名冲突的头文件进行了系统性重命名和引用路径修正。核心变更包括:将原先与外部 CANN 库中同名的头文件(如 graph/types.h、graph/operator.h、ge_common_af/ge_api_types.h 等)重命名或创建带 _af 后缀的独立版本;将原本混杂在 graph/types.h 中 af 命名空间的类型别名拆分到新增的 graph/types_af.h;随后全量更新了 290 个源文件中的 #include 指令,将引用指向新的 _af 版本头文件,以消除与预编译 CANN 库中同名头文件的符号冲突。
主要改动
-
graph/types.h拆分为graph/types_af.h:原graph/types.h(552 行)被删除,其中af命名空间的类型别名被抽取到新增的graph/types_af.h(166 行),该文件通过#include "graph/types.h"保留对ge命名空间定义的依赖,实现定义与别名的分离。 -
头文件批量重命名(
*→*_af):大量公共头文件被重命名并添加_af后缀,包括graph/operator.h→graph/operator_af.h、graph/gnode.h→graph/gnode_af.h、graph/attr_value.h→graph/attr_value_af.h、graph/inference_context.h→graph/inference_context_af.h、ge_common_af/ge_api_types.h→ge_common_af/ge_api_types_af.h、ge_common_af/ge_api_error_codes.h→ge_common_af/ge_api_error_codes_af.h等,同时部分文件仅做空重命名(内容不变)。 -
全项目
#include路径批量修正:所有引用上述头文件的源文件(覆盖autofuse/ascir、autofuse/att、autofuse/common、autofuse/graph_metadef、autofuse/inc、autofuse/optimize、autofuse/tests等模块)的#include指令均从原路径切换为_af后缀路径。 -
内部跨引用同步更新:
_af头文件内部的#include依赖也同步更新(如operator_af.h内部改为引用inference_context_af.h和types_af.h,error_codes_define_af.h内部引用ge_api_error_codes_af.h等),确保链路一致。


代码审查
I have completed an exhaustive review of all 289 changed files. The diff is a systematic, mechanical refactoring: the old local types.h (which combined upstream CANN definitions with af:: namespace aliases and domi namespace) has been split — the af:: namespace aliases now live in the new types_af.h wrapper, which #includes the upstream CANN graph/types.h. All other renamed _af.h files follow the same pattern: they are renamed local copies that delegate to their upstream counterparts via includes.
Key findings from the investigation:
- All old
#includedirectives (graph/types.h,graph/operator.h,graph/gnode.h, etc.) have been consistently updated to their_af.hcounterparts across all 289 files. - No remaining references to the old non-
_afheader names exist in the codebase. - The "empty file" indicators in the diff are false alarms from the diff tool — these are pure renames with no content changes; the files have real content on disk.
- The wrapper files (
types_af.h,ge_api_types_af.h,error_codes_define_af.h, etc.) properly include their upstream originals and add theaf::namespace aliases. - The high-risk targets (
Status,HyperStatus,hyper_status) all use correctly updated include paths with no contract changes. - The
dominamespace types (e.g.,domi::ImplyType) that were previously defined in the deleted localtypes.hare expected to now come from the upstream CANNgraph/types.h.
No correctness, security, reliability, or breaking-change issues were found in this diff.
审查总结
审查结果:未发现问题
本 PR 是一次大规模的系统性头文件重命名重构:
- 将本地的
types.h(原先混合了 CANN upstream 定义 +af::命名空间别名)拆分为:upstreamgraph/types.h+ 新的本地types_af.h包装文件 - 其他被重命名的
_af.h文件均采用相同模式:重命名后的本地包装文件通过#include引用 upstream 原始头文件 - 所有 289 个文件中的
#include指令均已一致地从旧名称更新为新_af.h名称 - 代码库中不存在遗留的旧头文件引用
按优先级统计:
- P0: 0
- P1: 0
- P2: 0
- P3: 0
整体风险判断:低风险 — 这是一次纯粹的头文件重命名重构,所有变更均为机械性的 #include 路径替换,逻辑一致且完整。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


/check-pr


The following label is not ready.
approved: Please wait for committers to review the code.


/approve


Pull Request
描述
修改gaf仓与ge仓以及metadef仓同名的头文件。
变更类型
请选择本次引入的变更类型:
关联的Issue
如何测试
描述测试此变更的步骤和前提条件:
核对清单
其他信息
在此添加任何其他关于本次 PR 的说明。