已关闭
[Bug-Report|缺陷反馈]:mhc_post 多个UT用例失败:hRes空指针错误码不符、arch22 tiling用例期望过期 #5629
xuejinghui创建于 19 天前关闭于 18 天前
19 天前 添加了label:bug-report
Xxuejinghui
19 天前 修改标题为 “[Bug-Report|缺陷反馈]:mhc_post 多个UT用例失败:hRes空指针错误码不符、arch22 tiling用例期望过期”,原标题为“[Bug-Report|缺陷反馈]: 11”
19 天前 修改标题为 “[Bug-Report|缺陷反馈]:mhc_post 多个UT用例失败:hRes空指针错误码不符、arch22 tiling用例期望过期”,原标题为“[Bug-Report|缺陷反馈]: 11”
19 天前 修改了issue 的描述
xuejinghui
19 天前 评论:
19 天前 评论:
/assign


19 天前 将 xuejinghui 设为负责人
18 天前 关闭了 issue
18 天前 添加了label:resolved
[Bug-Report|缺陷反馈]: mhc_post 多个UT用例失败:hRes空指针错误码不符、arch22 tiling用例期望过期
Describe the current behavior / 问题描述 (Mandatory / 必填)
mhc_post 算子 UT 存在 4 个失败用例,分为两类问题:
问题1:op_api UT
MhcPostOpapiUt.aclnn_mhc_post_empty_null_hRes失败hRes 传 nullptr 时,UT 期望返回
ACLNN_ERR_PARAM_NULLPTR(161001),实际返回ACLNN_ERR_RUNTIME_ERROR(361001)。根因:commit
5e8f48085(feat(mhc_post): 实现hres可选路径支持)在aclnnMhcPostGetWorkspaceSize中新增 SoC guard,非 Ascend950(DAV_3510)平台对hRes == nullptr返回ACLNN_ERR_RUNTIME_ERROR。而 hRes 在 A2/A3 上为必填参数,传空属于参数错误;且 mhc 同族算子(mhc_pre的CheckRequiredHRes、mhc_post_backward的CheckNotNull)在相同场景均返回ACLNN_ERR_PARAM_NULLPTR,mhc_post 为族内唯一异类,forward/backward 行为不一致。问题2:arch22 tiling 3 个用例失败
MhcPostTilingArch22下test_mhc_post_3d_n6_success、test_mhc_post_invalid_n、test_mhc_post_invalid_d全部失败。根因:commit
6c31a2302(mhc_post性能优化,并做arch22&arch35隔离)将 arch22 tiling 收紧为仅支持 n=4 且 d 需满足 128 对齐(mhc_post_tiling_base_arch22.cpp:462-469),但同 commit 新增的 3 个 UT 用例期望值沿用旧泛化实现(期望GRAPH_SUCCESS及具体 tilingData),与收紧后的约束矛盾,自引入起从未通过:test_mhc_post_3d_n6_success:n=6,arch22 不支持test_mhc_post_invalid_n:n=7,用例名为 invalid 却期望 SUCCESStest_mhc_post_invalid_d:d=30000,不满足 128 对齐(30000 % 128 = 48)Environment Information / 环境信息 (Mandatory / 必填)
5e8f48085/6c31a2302之后)--soc分别指定 Ascend910B / Ascend950)Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
source ${ASCEND_HOME_PATH}/set_env.sh cd ops-transformer # 问题1:op_api UT bash build.sh -u --opapi --ops=mhc_post -j16 --noexec ./build/tests/ut/framework_normal/op_api/transformer_op_api_ut \ --gtest_filter=MhcPostOpapiUt.aclnn_mhc_post_empty_null_hRes # 问题2:arch22 tiling UT(arch22 用例仅在 --soc=ascend910b 时编译) bash build.sh -u --ophost --ops=mhc_post --soc=ascend910b -j16 --noexec export BUILD_PATH=$PWD/build ./build/tests/ut/framework_normal/op_host/transformer_op_host_ut \ --gtest_filter='MhcPostTilingArch22.*'Describe the expected behavior / 预期结果 (Mandatory / 必填)
aclnn_mhc_post_empty_null_hRes:非 Ascend950 平台 hRes 传 nullptr 应返回ACLNN_ERR_PARAM_NULLPTR(161001),用例通过;GRAPH_FAILED,用例期望与实现一致,全部通过。Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
问题1 失败日志:
问题2 失败日志:
Special notes for this issue / 备注 (Optional / 选填)
修复方案(已提交分支
mhc_post_ut,commit5f9e03f7a):aclnn_mhc_post.cpp:将 hRes 空指针检查移入CheckNotNull,非 DAV_3510 平台返回ACLNN_ERR_PARAM_NULLPTR,与mhc_pre/mhc_post_backward保持一致,删除原返回ACLNN_ERR_RUNTIME_ERROR的 SoC guard 代码块;ge::GRAPH_FAILED,其中test_mhc_post_3d_n6_success同步更名为test_mhc_post_3d_n6_invalid。修复后验证结果:op_api UT 20/20 通过,ophost UT arch22 13/13 通过、arch35 10/10 通过。
另提示(UT 框架问题,与本缺陷无关):手动直接运行
transformer_op_host_ut二进制前需先export BUILD_PATH=$PWD/build,否则全局环境不加载libophost_transformer_ut.so,空注册表导致gert::OpImplSpaceRegistryV2::GetOpImpl段错误。