已合并
【PR】: [fix] [autofuse] modify the header files with the same names as ge and metadef. #1300
【PR】: [fix] [autofuse] modify the header files with the same names as ge and metadef. #1300
已合并
邢智雄创建于 7月15日
邢智雄
邢智雄成员
7月15日

Pull Request

描述

修改gaf仓与ge仓以及metadef仓同名的头文件。

变更类型

请选择本次引入的变更类型:

关联的Issue

如何测试

描述测试此变更的步骤和前提条件:

  1. ci流水线pass
  2. RDV pass

核对清单

其他信息

在此添加任何其他关于本次 PR 的说明。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 邢智雄 的贡献)
邢智雄邢智雄成员
7月15日 添加了label:enhancement
邢智雄邢智雄成员
7月15日 创建了 pull request,commit 4bc8034d
atomgit-bot
atomgit-bot
7月15日 评论:

变更摘要

本次 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 等),确保链路一致。

likedislike
不准确?
atomgit-bot
atomgit-bot
7月15日 评论:

代码审查

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 #include directives (graph/types.h, graph/operator.h, graph/gnode.h, etc.) have been consistently updated to their _af.h counterparts across all 289 files.
  • No remaining references to the old non-_af header 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 the af:: namespace aliases.
  • The high-risk targets (Status, HyperStatus, hyper_status) all use correctly updated include paths with no contract changes.
  • The domi namespace types (e.g., domi::ImplyType) that were previously defined in the deleted local types.h are expected to now come from the upstream CANN graph/types.h.

No correctness, security, reliability, or breaking-change issues were found in this diff.


审查总结

审查结果:未发现问题

本 PR 是一次大规模的系统性头文件重命名重构:

  • 将本地的 types.h(原先混合了 CANN upstream 定义 + af:: 命名空间别名)拆分为:upstream graph/types.h + 新的本地 types_af.h 包装文件
  • 其他被重命名的 _af.h 文件均采用相同模式:重命名后的本地包装文件通过 #include 引用 upstream 原始头文件
  • 所有 289 个文件中的 #include 指令均已一致地从旧名称更新为新 _af.h 名称
  • 代码库中不存在遗留的旧头文件引用

按优先级统计:

  • P0: 0
  • P1: 0
  • P2: 0
  • P3: 0

整体风险判断:低风险 — 这是一次纯粹的头文件重命名重构,所有变更均为机械性的 #include 路径替换,逻辑一致且完整。

⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。

likedislike
不准确?
CANN-robotCANN-robot成员
7月15日 添加了label:cann-cla/yes
此处折叠了82条消息 查看更多
邢智雄
邢智雄成员
7月16日 评论:

/check-pr

likedislike
CANN-robot
CANN-robot成员
7月16日 评论:

The following label is not ready.

approved: Please wait for committers to review the code.

likedislike
zhanj
zhanj成员
7月16日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
7月16日 添加了label:approved
CANN-robotCANN-robot成员
7月16日 合入了pull request