已合并
fix: 修复ST中架构硬编码、失效用例与桩符号缺失导致的失败和超时 #5111
yelongjian创建于 11 天前
fix: 修复ST中架构硬编码、失效用例与桩符号缺失导致的失败和超时 #5111
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yelongjian 的贡献)11 天前 创建了 pull request,commit a4faf211
atomgit-bot
11 天前 评论:
11 天前 评论:
变更摘要
本 PR 针对 GE ST 中导致用例失败、ctest 超时和 ENGINES 编译失败的问题进行修复,全部改动限于 tests/ 下的测试脚本、测试桩与测试数据。核心包括:去掉 dflow ST 测试数据中的架构硬编码、在用例内补齐因桩空实现而缺失的 release 产物、清理 slice_result_mocker 的 static 状态跨用例泄漏、为 cpueng ST 补齐缺失的链接符号,以及修复 ffts ST 的编译错误并删除针对已移除派发层的失效用例。
主要改动
- dflow ST 测试数据去除架构硬编码: 从
tests/dflow/runner/st/st_run_data/json/helper_runtime/下 4 个numa_config*.json中删除node_def.resource_type的"X86"硬编码,改由架构感知的默认值接管(x86 行为不变,aarch64 解析为Aarch),避免GetDeployEngineType报资源类型不匹配导致BuildGraph失败。 - 用例内预置 release 产物: 在
test_helper_runtime.cc的TestDeployHeavyLoadUdfModelOnDiffServerWithHostFlowgw中按架构创建release目录并写入func_pp0_release.tar.gz、func_pp1_release.tar.gz,以绕过 ST 中ProcessUtils::System空实现导致PackRelease不产出产物、远端部署序列化时Open file fail的问题。 - 修复
slice_result_mocker的 static 状态泄漏: 在SliceResultMocker::InitGtGraph()中新增gep_graph_key_to_pattern_map_.clear(),并将GenGEP中写入该 map 的emplace改为operator[]=,使记录的 pattern 始终跟随实际写入的.om,避免跨用例残留键值导致CheckGuardFunc比对失败。 - cpueng ST 桩补齐缺失符号: 在
aicpu_stub.cpp中新增CpuKernelContext构造函数与Init(void *)(返回 0),在runtime_stub.cpp中新增aclrtGetDevice、aclrtGetDeviceInfo(返回ACL_ERROR_RT_FAILURE),并在stub/runtime/CMakeLists.txt中补充${ASCEND_INSTALL_PATH}/include头文件路径,解决host_engine_stest/cpu_engine_stest的 undefined reference 链接失败。 - ffts ST 修复编译错误并清理失效用例: 删除
fftsplus_dynamic_task_builder_stest.cc中已不存在的manual_thread_task_builder.h死 include,修正fftsplus_ops_kernel_builder_stest.cc中nofity拼写为notify,并删除 12 个针对已移除派发层、不可能通过的失效用例(含tasks[0]越界访问相关用例)。


不准确?
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.
You can self-configure the PR merge rules for this repository. For more details, please refer to 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 | ✅ kobemini, yangyongqiang0606 (2/2) | ✅ yangyongqiang0606 (1/1) |
| tests/engines/ffts_engine | ✅ yangyongqiang0606, kobemini (2/2) | ✅ yangyongqiang0606 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yelongjian, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了57条消息 查看更多
10 天前 添加了label:ci-pipeline-passed
GengChao
10 天前 评论:
10 天前 评论:
/lgtm


yangyongqiang
10 天前 评论:
10 天前 评论:
/approve


10 天前 添加了label:approved
10 天前 合入了pull request
Pull Request
描述
修复 GE ST 中一批导致用例失败、ctest 超时和 ENGINES 编译失败的问题,全部改动限于测试脚本、测试桩与测试数据,不涉及任何业务代码。
1. dflow ST 测试数据去掉架构硬编码
tests/dflow/runner/st/st_run_data/json/helper_runtime/下 4 个numa_config*.json的node_def.resource_type硬编码为"X86",覆盖了config_parser.cc:131中本就存在的架构感知默认值:auto default_resource_type = ExecutionRuntime::IsX86() ? kResoureTypeX86 : kResoureTypeAarch; AssignOptionalField(node_def_config.resource_type, kConfigResourceType, j, default_resource_type);aarch64 上
FunctionCompile::CompileAllResourceType()产出可运行资源类型{Ascend, Aarch},heavy_loadUDF 经DataFlowGraphAutoDeployer::SelectResourceType选中Aarch,而设备表里的 host CPU 资源类型是 JSON 写死的X86,于是HeterogeneousDeployPlanner::GetDeployEngineType报Failed to match device according to resource type[Aarch],BuildGraph返回失败,影响 4 个用例:STEST_helper_runtime.TestDeployHeavyLoadUdfModelOnServerSTEST_helper_runtime.TestDeployHeavyLoadUdfModelOnServerWithHostFlowgwSTEST_helper_runtime.TestDeployHeavyLoadUdfModelOnDiffServerWithHostFlowgwSTEST_helper_runtime.TestDeployUdfModelsOnServerWithHostFlowgw删掉该字段后由架构感知默认值接管:x86 上仍解析为
X86(行为完全不变),aarch64 上解析为Aarch。2.
STEST_helper_runtime::SetUpTestSuite预置 release 包时同样硬编码了X86fixture 在
SetUpTestSuite()里用 shell 预置 UDF release 包(因为ProcessUtils::System在 ST 中是空实现,UdfModelBuilder::PackRelease不会真正产出 tar.gz),但 host 资源类型目录写死为X86:mkdir -p ./temp_udf_st/build/_test/X86/release ... tar -cvf func_pp1_release.tar.gz func_pp1_release.om func_pp1_release.so而
UdfModel::SerializeModel读取的是FunctionCompile按架构产出的路径 —— aarch64 上是_test/Aarch/release/func_pp1_release.tar.gz,预置的产物只在_test/X86/和_test/Ascend/下,于是报Open file fail。改为用
ExecutionRuntime::IsX86()取架构并注入 shell 变量:const std::string host_res_type = ExecutionRuntime::IsX86() ? "X86" : "Aarch"; std::string cmd = "HOST_RES=" + host_res_type + R"( ... mkdir -p ./temp_udf_st/build/_test/${HOST_RES}/releasex86 上仍解析为
X86,行为完全不变。这与第 1 项是同一类架构硬编码问题,只是位置在测试 fixture 而非测试数据。TestDeployHeavyLoadUdfModelOnDiffServerWithHostFlowgw是该套件中唯一把func_pp1部署到远端 server 的用例,会经FlowModelSender::TransferSubmodels序列化子模型;其余 3 个 heavy_load 用例都在本地部署、不走该路径,所以只有它暴露此问题。3. cpueng ST 桩补齐缺失符号
host_engine_stest/cpu_engine_stest链接失败:stub/runtime/src/runtime_stub.cpp增加aclrtGetDevice/aclrtGetDeviceInfo,返回ACL_ERROR_RT_FAILURE,使CpuKernelBuilder::CalcBlockDimByShapeSize走其既有的kDefaultAicpuBlockDim兜底分支(已确认 cpueng ST 无任何 block dim 断言)stub/aicpu/aicpu_stub.cpp增加CpuKernelContext构造函数与Init(void*),返回 0 以满足folding_st.cpp:72的ASSERT_EQ(ret, 0)stub/runtime/CMakeLists.txt增加${ASCEND_INSTALL_PATH}/include以取得acl/acl_rt.h,写法沿用tests/acl_ut/depends/acl/CMakeLists.txt4. ffts ST 修复编译错误并清理失效用例
fftsplus_dynamic_task_builder_stest.cc:24删除死 includetask_builder/mode/manual/manual_thread_task_builder.h(该路径已不存在,且全文件仅此一处提及 manual,无任何代码使用)fftsplus_ops_kernel_builder_stest.cc:932-933修正nofity拼写为notifyFFTSPlusOpsKernelBuilder::GenerateTask现仅处理带ATTR_NAME_ALIAS_ENGINE_NAME的 MIXL2 节点,其余分支为带FFTS_LOGE的显式return FAILED;TheadTaskBuilder仅剩Mixl2ModeTaskBuilder一个子类,task_builder/mode/manual/已整体删除。被删用例覆盖的入口已不存在,不可能通过。反证:全文件仅 2 处设置该属性(MIX_L2_GenerateTask_SUCCESS、tiling_sink_gentask_for_ffts),这两个用例均通过。被删用例清单:
GenerateTask_SUCCESS、GenerateTask_Greater60_Schecule_SUCCESS、GenerateTask_Greater60_SUCCESS、Mix_GenerateTask_SUCCESS、Auto_RTSOP_GenerateTask_SUCCESS、AICPU_GenerateTask_Schecule_Failed、AICPU_GenerateTask_SUCCESS、HCCL_GenerateTask_SUCCESS、RTSOP_GenerateTask_IF_SETIF、RTSOP_GenerateTask_CASE_SETIF、RTSOP_GenerateTask_While_SETIF、RTSOP_GenerateTask_If_If_SETIF。变更类型
关联的Issue
无。与 #5072 相关:本 PR 修复的
slice_result_mockerstatic 状态泄漏,是在 #5072 去掉 libasan 预加载后才暴露出来的既有缺陷。如何测试
前提:aarch64 + CANN 9.3.0 + conda
baize_py39,ASAN 关闭(ENABLE_ASAN=false)。全量 ST 端到端:
预期
rc=0并完整打印test end:,耗时约 13m30s。单独复验 dflow(含原 4 个失败用例):
预期
helper_runtime_test183/183 通过、ctest100% tests passed, 0 tests failed out of 2,且日志中Failed to match device according to resource type[Aarch]与Open file fail均为 0 次。单独复验受影响的 ENGINES:
bash tests/run_test.sh --st=aicpu # 预期 12/12 + 77/77 + 82/82 全通过,无 undefined reference bash tests/run_test.sh --st=ffts # 预期 88/88 全通过,无 core dump单独复验 jit_execution:
预期
ut_jit_execution_st125/125 通过、ctest100% tests passed, 0 tests failed out of 8。实测结果
bash tests/run_test.sh --sttest end:test end:正常,13m30sst_hetero/st_dflow/fehelper_runtime_testst_fast_runtime2_testge_common_atc(phase2)AIR build failed/ST FAILED核对清单
其他信息
tests/下,不含任何业务代码改动;git diff --name-only过滤^tests/后为空。IsX86()为 true 时默认值即X86,与原硬编码相同),仅在 aarch64 上生效。