已合并
refactor: 移除 FunctionCompile 对 numa 配置的依赖,资源类型改为编译期固定生成 #4424
refactor: 移除 FunctionCompile 对 numa 配置的依赖,资源类型改为编译期固定生成 #4424
已合并
lining23666创建于 10 天前
lining23666成员
10 天前

Pull Request

描述

移除 CompileConfigJson::GetResourceTypeFromNumaConfig,FunctionCompile 中资源类型改为编译期固定生成 Ascend + host(X86/Aarch),消除对 numa 配置 JSON 的不必要运行时依赖。

主要变更:

  • 删除 GetResourceTypeFromNumaConfig 函数(唯一读取 OPTION_NUMA_CONFIG 的非测试代码),资源类型固定为 {kResourceTypeAscend, ExecutionRuntime::IsX86() ? kResourceTypeX86 : kResourceTypeAarch}
  • 删除 DeployLocation 类,将 IsX86() 静态方法迁移到 ExecutionRuntime
  • 清理 compile_config_json.ccge_global_options.h/ge_types.h 无用 include
  • 清理 UT 测试中冗余的 OPTION_NUMA_CONFIG 设置代码
  • 更新 dflow.md 文档中 _dflow_runnable_resource 属性描述

变更类型

关联的Issue

如何测试

  1. 编译 data_flow_basedflow_runnernpu_executor_static(deployer)库
  2. 编译并运行 ut_libge_helper_utest UT 测试
  3. 编译 helper_runtime_test ST 测试

核对清单

其他信息

验证结果

  • data_flow_base 编译通过
  • dflow_runner 编译通过
  • npu_executor_static(deployer)编译通过
  • ut_libge_helper_utest 编译通过,83 个测试用例全部 PASSED
  • helper_runtime_test(ST)编译通过

行为变化说明:之前若 numa 配置只含 Ascend,则只编译 Ascend;之后始终编译两种类型。但 CompileAllResourceType 已有容错(toolchain 不存在则 skip),不会因多编译一种类型而失败。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 lining23666 的贡献)
Llining23666成员
10 天前 创建了 pull request,commit c558084c
atomgit-bot
atomgit-bot
10 天前 评论:

变更摘要

本次 PR 是一次重构,旨在移除 FunctionCompile 对 numa 配置 JSON 的运行时依赖。原先资源类型通过 CompileConfigJson::GetResourceTypeFromNumaConfig 读取 OPTION_NUMA_CONFIG 解析得到,现改为在编译期固定生成 Ascendhost(X86/Aarch) 两种资源类型,从而消除不必要的运行时配置依赖。同时,本次改动删除了 DeployLocation 类,将其 IsX86() 静态方法迁移至 ExecutionRuntime,并清理了相关冗余 include 与 UT 测试中重复设置的 OPTION_NUMA_CONFIG 代码。

主要改动

  • 移除 numa 配置依赖:删除 CompileConfigJson::GetResourceTypeFromNumaConfig 函数及其声明,FunctionCompile::CompileAllResourceTypeFunctionCompile::GetBuiltInFuncCompileResult 改为直接使用编译期固定生成的资源类型集合 {kResourceTypeAscend, ExecutionRuntime::IsX86() ? kResourceTypeX86 : kResourceTypeAarch}
  • 迁移 IsX86() 静态方法:删除 dflow/deployer/common/utils/deploy_location.h 中的 DeployLocation 类,在 dflow/base/exec_runtime/execution_runtime.hExecutionRuntime 中新增 IsX86(),并更新 config_parser.cc 及对应单测的调用为 ExecutionRuntime::IsX86()
  • 补充资源类型常量:在 compile_config_json.h 中新增 kResourceTypeX86kResourceTypeAarch 两个常量,用于编译期确定 host 资源类型。
  • 清理无用 include 与测试代码:移除 compile_config_json.cc 中的 ge_global_options.hge_types.h 等无用 include,并清理多个 UT 测试文件中设置或清除 OPTION_NUMA_CONFIG 的冗余代码及相关 include。
  • 同步文档描述:更新 dflow.md_dflow_runnable_resource 属性描述,以反映资源类型不再依赖 numa 配置的行为变化。
likedislike
atomgit-bot
atomgit-bot
10 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
10 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
10 天前 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
For more, you also can visit HICANN.


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/ge stevenaw0, xchu42, 张德鹏 (3/2) 张德鹏 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

lining23666, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
此处折叠了96条消息 查看更多
xchu42
xchu42成员
9 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
9 天前 添加了label:lgtm
张德鹏成员
9 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
9 天前 添加了label:approved
CANN-robotCANN-robot成员
9 天前 合入了pull request