已合并
refactor: 移除 FunctionCompile 对 numa 配置的依赖,资源类型改为编译期固定生成 #4424
lining23666创建于 11 天前
refactor: 移除 FunctionCompile 对 numa 配置的依赖,资源类型改为编译期固定生成 #4424
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 lining23666 的贡献)11 天前 创建了 pull request,commit c558084c
atomgit-bot
11 天前 评论:
11 天前 评论:
变更摘要
本次 PR 是一次重构,旨在移除 FunctionCompile 对 numa 配置 JSON 的运行时依赖。原先资源类型通过 CompileConfigJson::GetResourceTypeFromNumaConfig 读取 OPTION_NUMA_CONFIG 解析得到,现改为在编译期固定生成 Ascend 与 host(X86/Aarch) 两种资源类型,从而消除不必要的运行时配置依赖。同时,本次改动删除了 DeployLocation 类,将其 IsX86() 静态方法迁移至 ExecutionRuntime,并清理了相关冗余 include 与 UT 测试中重复设置的 OPTION_NUMA_CONFIG 代码。
主要改动
- 移除 numa 配置依赖:删除
CompileConfigJson::GetResourceTypeFromNumaConfig函数及其声明,FunctionCompile::CompileAllResourceType和FunctionCompile::GetBuiltInFuncCompileResult改为直接使用编译期固定生成的资源类型集合{kResourceTypeAscend, ExecutionRuntime::IsX86() ? kResourceTypeX86 : kResourceTypeAarch}。 - 迁移
IsX86()静态方法:删除dflow/deployer/common/utils/deploy_location.h中的DeployLocation类,在dflow/base/exec_runtime/execution_runtime.h的ExecutionRuntime中新增IsX86(),并更新config_parser.cc及对应单测的调用为ExecutionRuntime::IsX86()。 - 补充资源类型常量:在
compile_config_json.h中新增kResourceTypeX86与kResourceTypeAarch两个常量,用于编译期确定 host 资源类型。 - 清理无用 include 与测试代码:移除
compile_config_json.cc中的ge_global_options.h、ge_types.h等无用 include,并清理多个 UT 测试文件中设置或清除OPTION_NUMA_CONFIG的冗余代码及相关 include。 - 同步文档描述:更新
dflow.md中_dflow_runnable_resource属性描述,以反映资源类型不再依赖 numa 配置的行为变化。


atomgit-bot
11 天前 评论:
11 天前 评论:
11 天前 添加了label:cann-cla/yes
CANN-robot
11 天前 评论:
11 天前 评论:
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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


此处折叠了96条消息 查看更多
xchu42
10 天前 评论:
10 天前 评论:
/lgtm


10 天前 添加了label:lgtm
9 天前 添加了label:approved
9 天前 合入了pull request
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.cc中ge_global_options.h/ge_types.h无用 includeOPTION_NUMA_CONFIG设置代码_dflow_runnable_resource属性描述变更类型
关联的Issue
如何测试
data_flow_base、dflow_runner、npu_executor_static(deployer)库ut_libge_helper_utestUT 测试helper_runtime_testST 测试核对清单
其他信息
验证结果:
data_flow_base编译通过dflow_runner编译通过npu_executor_static(deployer)编译通过ut_libge_helper_utest编译通过,83 个测试用例全部 PASSEDhelper_runtime_test(ST)编译通过行为变化说明:之前若 numa 配置只含 Ascend,则只编译 Ascend;之后始终编译两种类型。但
CompileAllResourceType已有容错(toolchain 不存在则 skip),不会因多编译一种类型而失败。