已关闭
[WIP] Repro UT segment fault #443
Yuanhao Ji创建于 2月9日关闭于 3月27日
[WIP] Repro UT segment fault #443
已关闭
共 5 个文件变更+122-34
| @@ -515,7 +515,7 @@ elif [ -d "${DEFAULT_INSTALL_DIR}" ];then | |||
| 515 | ASCEND_CANN_PACKAGE_PATH=${DEFAULT_INSTALL_DIR} | 515 | ASCEND_CANN_PACKAGE_PATH=${DEFAULT_INSTALL_DIR} |
| 516 | else | 516 | else |
| 517 | log "Error: Please set the toolkit package installation directory through parameter -p|--package-path." | 517 | log "Error: Please set the toolkit package installation directory through parameter -p|--package-path." |
| 518 | - exit 1 | 518 | + # exit 1 |
| 519 | fi | 519 | fi |
| 520 | 520 | ||
| 521 | if [ -n "${third_party_nlohmann_path}" ];then | 521 | if [ -n "${third_party_nlohmann_path}" ];then |
| @@ -12,7 +12,7 @@ set(CMAKE_SKIP_RPATH FALSE) | |||
| 12 | # UT | 12 | # UT |
| 13 | if(ENABLE_UT) | 13 | if(ENABLE_UT) |
| 14 | add_subdirectory(ut) | 14 | add_subdirectory(ut) |
| 15 | - add_subdirectory(legacy/ut) | 15 | + # add_subdirectory(legacy/ut) |
| 16 | endif() | 16 | endif() |
| 17 | 17 | ||
| 18 | # ST | 18 | # ST |
| @@ -275,22 +275,22 @@ set(UT_COMMON_INCLUDE_LIST | |||
| 275 | ) | 275 | ) |
| 276 | 276 | ||
| 277 | add_subdirectory(stub) | 277 | add_subdirectory(stub) |
| 278 | -add_subdirectory(framework/next) | 278 | +# add_subdirectory(framework/next) |
| 279 | -add_subdirectory(common/prepare_ut_env) | 279 | +# add_subdirectory(common/prepare_ut_env) |
| 280 | -add_subdirectory(common/binary_package) | 280 | +# add_subdirectory(common/binary_package) |
| 281 | -add_subdirectory(misc) | 281 | +# add_subdirectory(misc) |
| 282 | -add_subdirectory(impl) | 282 | +# add_subdirectory(impl) |
| 283 | -add_subdirectory(device) | 283 | +# add_subdirectory(device) |
| 284 | -add_subdirectory(platform/hcom) | 284 | +# add_subdirectory(platform/hcom) |
| 285 | -add_subdirectory(platform/resource/dispatcher) | 285 | +# add_subdirectory(platform/resource/dispatcher) |
| 286 | -add_subdirectory(platform/resource/notify) | 286 | +# add_subdirectory(platform/resource/notify) |
| 287 | -add_subdirectory(platform/resource/transport) | 287 | +# add_subdirectory(platform/resource/transport) |
| 288 | -add_subdirectory(platform/ping_mesh) | 288 | +# add_subdirectory(platform/ping_mesh) |
| 289 | -add_subdirectory(framework/communicator) | 289 | +# add_subdirectory(framework/communicator) |
| 290 | add_subdirectory(framework/op_base_api) | 290 | add_subdirectory(framework/op_base_api) |
| 291 | -add_subdirectory(framework/communicator/impl) | 291 | +# add_subdirectory(framework/communicator/impl) |
| 292 | -add_subdirectory(framework/resource) | 292 | +# add_subdirectory(framework/resource) |
| 293 | -add_subdirectory(aicpu_kfc/aicpu) | 293 | +# add_subdirectory(aicpu_kfc/aicpu) |
| 294 | -add_subdirectory(aicpu_kfc/misc) | 294 | +# add_subdirectory(aicpu_kfc/misc) |
| 295 | -add_subdirectory(inter/comm) | 295 | +# add_subdirectory(inter/comm) |
| 296 | -add_subdirectory(platform/hccp) | 296 | +# add_subdirectory(platform/hccp) |
| @@ -10,20 +10,21 @@ | |||
| 10 | set(src_to_test_list | 10 | set(src_to_test_list |
| 11 | main.cc | 11 | main.cc |
| 12 | hccl_api_base_test.cc | 12 | hccl_api_base_test.cc |
| 13 | - ut_HcclAllGatherV_API_test.cc | 13 | + repro.cc |
| 14 | - ut_HcclBatchSendRecv_API_test.cc | 14 | + # ut_HcclAllGatherV_API_test.cc |
| 15 | - ut_HcclReduceScatterV_API_test.cc | 15 | + # ut_HcclBatchSendRecv_API_test.cc |
| 16 | - ut_HcclAllReduce_API_test.cc | 16 | + # ut_HcclReduceScatterV_API_test.cc |
| 17 | - ut_HcclBroadcast_API_test.cc | 17 | + # ut_HcclAllReduce_API_test.cc |
| 18 | - ut_HcclScatter_API_test.cc | 18 | + # ut_HcclBroadcast_API_test.cc |
| 19 | - ut_HcclAlltoAll_API_test.cc | 19 | + # ut_HcclScatter_API_test.cc |
| 20 | - ut_HcclRecv_API_test.cc | 20 | + # ut_HcclAlltoAll_API_test.cc |
| 21 | - ut_HcclSend_API_test.cc | 21 | + # ut_HcclRecv_API_test.cc |
| 22 | - ut_HcclAlltoAllV_API_test.cc | 22 | + # ut_HcclSend_API_test.cc |
| 23 | - ut_HcclReduce_API_test.cc | 23 | + # ut_HcclAlltoAllV_API_test.cc |
| 24 | - ut_HcclAllGather_API_test.cc | 24 | + # ut_HcclReduce_API_test.cc |
| 25 | - ut_HcclBarrier_API_test.cc | 25 | + # ut_HcclAllGather_API_test.cc |
| 26 | - ut_HcclReduceScatter_API_test.cc | 26 | + # ut_HcclBarrier_API_test.cc |
| 27 | + # ut_HcclReduceScatter_API_test.cc | ||
| 27 | ) | 28 | ) |
| 28 | 29 | ||
| 29 | add_executable(hccl_utest_framework_op_base_api ${src_to_test_list}) | 30 | add_executable(hccl_utest_framework_op_base_api ${src_to_test_list}) |
| @@ -0,0 +1,87 @@ | |||
| 1 | +/** | ||
| 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. | ||
| 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 8 | + * See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | + */ | ||
| 10 | + | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +class ReproTest : public BaseInit { | ||
| 14 | +public: | ||
| 15 | + void SetUp() override { | ||
| 16 | + BaseInit::SetUp(); | ||
| 17 | + | ||
| 18 | + // 生成 ranktable | ||
| 19 | + UT_USE_1SERVER_1RANK_AS_DEFAULT; | ||
| 20 | + | ||
| 21 | + // 将enableEntryLog默认返回为true | ||
| 22 | + MOCKER(GetExternalInputHcclEnableEntryLog) | ||
| 23 | + .stubs() | ||
| 24 | + .with(any()) | ||
| 25 | + .will(returnValue(true)); | ||
| 26 | + } | ||
| 27 | + void TearDown() override { | ||
| 28 | + BaseInit::TearDown(); | ||
| 29 | + GlobalMockObject::verify(); | ||
| 30 | + } | ||
| 31 | +}; | ||
| 32 | + | ||
| 33 | +TEST_F(ReproTest, UT_1) | ||
| 34 | +{ | ||
| 35 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 36 | + | ||
| 37 | + Ut_Comm_Destroy(comm); | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +TEST_F(ReproTest, UT_2) | ||
| 41 | +{ | ||
| 42 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 43 | + | ||
| 44 | + Ut_Comm_Destroy(comm); | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +TEST_F(ReproTest, UT_3) | ||
| 48 | +{ | ||
| 49 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 50 | + | ||
| 51 | + Ut_Comm_Destroy(comm); | ||
| 52 | +} | ||
| 53 | + | ||
| 54 | +TEST_F(ReproTest, UT_4) | ||
| 55 | +{ | ||
| 56 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 57 | + | ||
| 58 | + Ut_Comm_Destroy(comm); | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +TEST_F(ReproTest, UT_5) | ||
| 62 | +{ | ||
| 63 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 64 | + | ||
| 65 | + Ut_Comm_Destroy(comm); | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +TEST_F(ReproTest, UT_6) | ||
| 69 | +{ | ||
| 70 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 71 | + | ||
| 72 | + Ut_Comm_Destroy(comm); | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +TEST_F(ReproTest, UT_7) | ||
| 76 | +{ | ||
| 77 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 78 | + | ||
| 79 | + Ut_Comm_Destroy(comm); | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | +TEST_F(ReproTest, UT_8) | ||
| 83 | +{ | ||
| 84 | + Ut_Comm_Create(comm, 0, rankTableFileName, 0); | ||
| 85 | + | ||
| 86 | + Ut_Comm_Destroy(comm); | ||
| 87 | +} | ||