已合并
aiv sync perf #1959
chenyia创建于 4月27日
aiv sync perf #1959
已合并
共 44 个文件变更+785-40
| @@ -187,6 +187,7 @@ | |||
| 187 | <file value="hccl_aiv_all_to_all_vc_op.o"/> | 187 | <file value="hccl_aiv_all_to_all_vc_op.o"/> |
| 188 | <file value="hccl_aiv_reduce_scatter_v_op.o"/> | 188 | <file value="hccl_aiv_reduce_scatter_v_op.o"/> |
| 189 | <file value="hccl_aiv_all_gather_v_op.o"/> | 189 | <file value="hccl_aiv_all_gather_v_op.o"/> |
| 190 | + <file value="hccl_aiv_sync_op.o"/> | ||
| 190 | <file value="hccl_ag_superkernel_int8.o"/> | 191 | <file value="hccl_ag_superkernel_int8.o"/> |
| 191 | <file value="hccl_ag_superkernel_int16.o"/> | 192 | <file value="hccl_ag_superkernel_int16.o"/> |
| 192 | <file value="hccl_ag_superkernel_int32.o"/> | 193 | <file value="hccl_ag_superkernel_int32.o"/> |
| @@ -13,4 +13,5 @@ add_subdirectory(all_reduce) | |||
| 13 | add_subdirectory(all_to_all) | 13 | add_subdirectory(all_to_all) |
| 14 | add_subdirectory(broadcast) | 14 | add_subdirectory(broadcast) |
| 15 | add_subdirectory(reduce_scatter) | 15 | add_subdirectory(reduce_scatter) |
| 16 | -add_subdirectory(reduce_scatter_v) | 16 | +add_subdirectory(reduce_scatter_v) |
| 17 | +add_subdirectory(aiv_sync) | ||
| @@ -165,9 +165,6 @@ hiddenInput, input, output | |||
| 165 | hiddenInput | 165 | hiddenInput |
| 166 | 166 | ||
| 167 | constexpr uint64_t AIV_FLAG_BUFFER_SIZE = 3 * 1024 * 1024; // aiv算子的flag区域大小 | 167 | constexpr uint64_t AIV_FLAG_BUFFER_SIZE = 3 * 1024 * 1024; // aiv算子的flag区域大小 |
| 168 | -constexpr uint64_t INFO_EVEN_BUFFER_OFFSET = 3 * 1024 * 1024; // aiv算子偶数tag存放AIV_INFO区域偏移 | ||
| 169 | -constexpr uint64_t INFO_ODD_BUFFER_OFFSET = 4 * 1024 * 1024; // aiv算子奇数tag存放AIV_INFO区域偏移 | ||
| 170 | -constexpr uint64_t LOG_LEVEL_OFFSET = 2 * 1024 * 1024; // 存放AIV_INFO日志环境变量的偏移 | ||
| 171 | constexpr uint64_t CLEAR_BUFFER_OFFSET = 1024 * 1024; // 用于清空的aiv buffer的偏移 | 168 | constexpr uint64_t CLEAR_BUFFER_OFFSET = 1024 * 1024; // 用于清空的aiv buffer的偏移 |
| 172 | constexpr uint64_t SYNC_BUFFER_OFFSET = 2 * 1024 * 1024; // 用于sync的aiv buffer的偏移 | 169 | constexpr uint64_t SYNC_BUFFER_OFFSET = 2 * 1024 * 1024; // 用于sync的aiv buffer的偏移 |
| 173 | constexpr uint64_t BUFFER_AREA = 1024 * 1024; // aiv算子的单独功能flag区域大小 | 170 | constexpr uint64_t BUFFER_AREA = 1024 * 1024; // aiv算子的单独功能flag区域大小 |
| @@ -386,8 +383,6 @@ public: | |||
| 386 | pingpongOffset = multiOffset + DOUBLE * DOUBLE * NUM_BLOCKS_FOUR_PER_RANK_A3 * ATOMIC_FLAG_SIZE * DOUBLE; | 383 | pingpongOffset = multiOffset + DOUBLE * DOUBLE * NUM_BLOCKS_FOUR_PER_RANK_A3 * ATOMIC_FLAG_SIZE * DOUBLE; |
| 387 | countOffset = DOUBLE * pingpongOffset; | 384 | countOffset = DOUBLE * pingpongOffset; |
| 388 | seperateOffset = countOffset + NUM_BLOCKS_FOUR_PER_RANK_A3 * rankSize_ * FLAG_SIZE; | 385 | seperateOffset = countOffset + NUM_BLOCKS_FOUR_PER_RANK_A3 * rankSize_ * FLAG_SIZE; |
| 389 | - logLevel_ = GetLogLevel(); | ||
| 390 | - uint64_t offset = (logLevel_ == 1) ? (tag_ & 1 ? INFO_EVEN_BUFFER_OFFSET : INFO_ODD_BUFFER_OFFSET) : INFO_EVEN_BUFFER_OFFSET; | ||
| 391 | 386 | ||
| 392 | pipe.InitBuffer(localFlagBuf, UB_FLAG_SIZE_4); | 387 | pipe.InitBuffer(localFlagBuf, UB_FLAG_SIZE_4); |
| 393 | localSetTensor = localFlagBuf.GetWithOffset<int32_t>(UB_FLAG_PAD_COUNT, FLAG_ONE_OFFSET); | 388 | localSetTensor = localFlagBuf.GetWithOffset<int32_t>(UB_FLAG_PAD_COUNT, FLAG_ONE_OFFSET); |
| @@ -406,10 +401,6 @@ public: | |||
| 406 | 401 | ||
| 407 | pipe.InitBuffer(flagInQue, AIV_PING_PONG_FACTOR_TWO, UB_FLAG_SIZE); | 402 | pipe.InitBuffer(flagInQue, AIV_PING_PONG_FACTOR_TWO, UB_FLAG_SIZE); |
| 408 | InitOpCounter(headCountMem, tailCountMem, addOneMem, counterMemSize, isEnableCounter); | 403 | InitOpCounter(headCountMem, tailCountMem, addOneMem, counterMemSize, isEnableCounter); |
| 409 | - if (tag_ == 1) { | ||
| 410 | - ClearSyncBuf(); | ||
| 411 | - pipe_barrier(PIPE_ALL); | ||
| 412 | - } | ||
| 413 | } | 404 | } |
| 414 | 405 | ||
| 415 | __aicore__ inline void Init(GM_ADDR hiddenInput, uint64_t threshold, bool useDoubleBuffer = false) | 406 | __aicore__ inline void Init(GM_ADDR hiddenInput, uint64_t threshold, bool useDoubleBuffer = false) |
| @@ -627,8 +618,6 @@ public: | |||
| 627 | 618 | ||
| 628 | __aicore__ inline void ClearSyncBuf(); | 619 | __aicore__ inline void ClearSyncBuf(); |
| 629 | 620 | ||
| 630 | - __aicore__ inline int32_t GetLogLevel(); | ||
| 631 | - | ||
| 632 | __aicore__ inline void InitOpCounter(GM_ADDR headCountMem, GM_ADDR tailCountMem, GM_ADDR addOneMem, uint32_t counterMemSize, | 621 | __aicore__ inline void InitOpCounter(GM_ADDR headCountMem, GM_ADDR tailCountMem, GM_ADDR addOneMem, uint32_t counterMemSize, |
| 633 | bool isEnableCounter) | 622 | bool isEnableCounter) |
| 634 | { | 623 | { |
| @@ -669,7 +658,6 @@ public: | |||
| 669 | uint64_t len_; | 658 | uint64_t len_; |
| 670 | int32_t tag_; | 659 | int32_t tag_; |
| 671 | int32_t numBlocks_; | 660 | int32_t numBlocks_; |
| 672 | - int32_t logLevel_; | ||
| 673 | uint32_t blockIdx_ = GetBlockIdx(); // 在构造函数中初始化,以免漏初始化 | 661 | uint32_t blockIdx_ = GetBlockIdx(); // 在构造函数中初始化,以免漏初始化 |
| 674 | 662 | ||
| 675 | bool useDoubleBuffer_; | 663 | bool useDoubleBuffer_; |
| @@ -769,16 +757,6 @@ __aicore__ inline void AivCommBase::ClearSyncBuf() | |||
| 769 | BlockSync(); | 757 | BlockSync(); |
| 770 | } | 758 | } |
| 771 | 759 | ||
| 772 | -__aicore__ inline int32_t AivCommBase::GetLogLevel() | ||
| 773 | -{ | ||
| 774 | - | ||
| 775 | - int32_t tmpLogLevel = *((__gm__ int32_t*)(GM_OUT[rank_] + LOG_LEVEL_OFFSET - sizeof(int32_t))); | ||
| 776 | - return tmpLogLevel; | ||
| 777 | - | ||
| 778 | - return 0; | ||
| 779 | - | ||
| 780 | -} | ||
| 781 | - | ||
| 782 | __aicore__ inline uint64_t AivCommBase::CeilDiv(uint64_t a, uint64_t b) | 760 | __aicore__ inline uint64_t AivCommBase::CeilDiv(uint64_t a, uint64_t b) |
| 783 | { | 761 | { |
| 784 | if (b == 0) { | 762 | if (b == 0) { |
| @@ -203,8 +203,6 @@ public: | |||
| 203 | 203 | ||
| 204 | __aicore__ inline void IntraSync(int32_t curTag, int32_t offset, int32_t blockIdx, bool ifPingpong = false); | 204 | __aicore__ inline void IntraSync(int32_t curTag, int32_t offset, int32_t blockIdx, bool ifPingpong = false); |
| 205 | 205 | ||
| 206 | - __aicore__ inline int32_t GetLogLevel(); | ||
| 207 | - | ||
| 208 | __aicore__ inline void InitOpCounter(GM_ADDR headCountMem, GM_ADDR tailCountMem, GM_ADDR addOneMem, | 206 | __aicore__ inline void InitOpCounter(GM_ADDR headCountMem, GM_ADDR tailCountMem, GM_ADDR addOneMem, |
| 209 | uint32_t counterMemSize, bool isEnableCounter) | 207 | uint32_t counterMemSize, bool isEnableCounter) |
| 210 | { | 208 | { |
| @@ -241,7 +239,6 @@ public: | |||
| 241 | uint32_t usedBlockNum_; | 239 | uint32_t usedBlockNum_; |
| 242 | uint32_t blockGroup_; | 240 | uint32_t blockGroup_; |
| 243 | bool useDoubleBuffer_; | 241 | bool useDoubleBuffer_; |
| 244 | - int32_t logLevel_; | ||
| 245 | int32_t tag_; | 242 | int32_t tag_; |
| 246 | bool localCopyCores = false; | 243 | bool localCopyCores = false; |
| 247 | int32_t clearEnable_ = 0; | 244 | int32_t clearEnable_ = 0; |
| @@ -392,8 +389,6 @@ __aicore__ inline void AivCrossNode91093Base::CalcNumTargetsAndTargetRanksGroup( | |||
| 392 | 389 | ||
| 393 | __aicore__ inline void AivCrossNode91093Base::InitSetCheckClearArgsTensor() | 390 | __aicore__ inline void AivCrossNode91093Base::InitSetCheckClearArgsTensor() |
| 394 | { | 391 | { |
| 395 | - logLevel_ = GetLogLevel(); | ||
| 396 | - uint64_t offset = (logLevel_ == 1) ? (tag_ & 1 ? INFO_EVEN_BUFFER_OFFSET : INFO_ODD_BUFFER_OFFSET) : INFO_EVEN_BUFFER_OFFSET; | ||
| 397 | pipe.InitBuffer(localFlagBuf, UB_FLAG_SIZE * FLAG_BUF_NUM); | 392 | pipe.InitBuffer(localFlagBuf, UB_FLAG_SIZE * FLAG_BUF_NUM); |
| 398 | localSetTensor = localFlagBuf.GetWithOffset<int32_t>(UB_FLAG_PAD_COUNT, 0); | 393 | localSetTensor = localFlagBuf.GetWithOffset<int32_t>(UB_FLAG_PAD_COUNT, 0); |
| 399 | localCheckTensor = localFlagBuf.GetWithOffset<int32_t>(UB_FLAG_PAD_COUNT, UB_FLAG_SIZE); | 394 | localCheckTensor = localFlagBuf.GetWithOffset<int32_t>(UB_FLAG_PAD_COUNT, UB_FLAG_SIZE); |
| @@ -849,16 +844,6 @@ __aicore__ inline void AivCrossNode91093Base::IntraSync(int32_t tag, int32_t off | |||
| 849 | } | 844 | } |
| 850 | } | 845 | } |
| 851 | 846 | ||
| 852 | -__aicore__ inline int32_t AivCrossNode91093Base::GetLogLevel() | ||
| 853 | -{ | ||
| 854 | - | ||
| 855 | - int32_t tmpLogLevel = *((__gm__ int32_t*)(flagAddrSelf_ + LOG_LEVEL_OFFSET - sizeof(int32_t))); | ||
| 856 | - return tmpLogLevel; | ||
| 857 | - | ||
| 858 | - return 0; | ||
| 859 | - | ||
| 860 | -} | ||
| 861 | - | ||
| 862 | __aicore__ inline void AivCrossNode91093Base::SetSyncRecord(int32_t value, GM_ADDR setAddr, | 847 | __aicore__ inline void AivCrossNode91093Base::SetSyncRecord(int32_t value, GM_ADDR setAddr, |
| 863 | int32_t highOrderOff, int32_t lowOrderOff, bool ifPingpong) | 848 | int32_t highOrderOff, int32_t lowOrderOff, bool ifPingpong) |
| 864 | { | 849 | { |
| @@ -0,0 +1,293 @@ | |||
| 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 | +set_source_files_properties( | ||
| 11 | + aiv_sync_op.h PROPERTIES LANGUAGE CXX | ||
| 12 | +) | ||
| 13 | + | ||
| 14 | +if(CCACHE_PROGRAM) | ||
| 15 | + set(BISHENG_CCACHE ${CCACHE_PROGRAM}) | ||
| 16 | +endif() | ||
| 17 | +if(BUILD_OPEN_PROJECT) | ||
| 18 | + set(CCE_DIR ${ASCEND_CANN_PACKAGE_PATH}/tools/ccec_compiler/bin) | ||
| 19 | + add_custom_target(hccl_aiv_sync_op ALL | ||
| 20 | + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o | ||
| 21 | + COMMAND ${CCE_DIR}/ld.lld -m aicorelinux -Ttext=0 ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o -static -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op.o | ||
| 22 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 23 | + ) | ||
| 24 | + | ||
| 25 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o | ||
| 26 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o | ||
| 27 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 --cce-aicore-arch=dav-c220-vec | ||
| 28 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 29 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 30 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 31 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 32 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 33 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 34 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 35 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 36 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 37 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 38 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 39 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 40 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 41 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 42 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/hccl/ | ||
| 43 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 44 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 45 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 46 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 47 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 48 | + ) | ||
| 49 | + | ||
| 50 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o | ||
| 51 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o | ||
| 52 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=1 --cce-aicore-arch=dav-c220-vec | ||
| 53 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 54 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 55 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 56 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 57 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 58 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 59 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 60 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 61 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 62 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 63 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 64 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 65 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 66 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 67 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/hccl/ | ||
| 68 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 69 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 70 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 71 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 72 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 73 | + ) | ||
| 74 | + | ||
| 75 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o | ||
| 76 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o | ||
| 77 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=2 --cce-aicore-arch=dav-c220-vec | ||
| 78 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 79 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 80 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 81 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 82 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 83 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 84 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 85 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 86 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 87 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 88 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 89 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 90 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 91 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 92 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/hccl/ | ||
| 93 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 94 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 95 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 96 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 97 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 98 | + ) | ||
| 99 | + | ||
| 100 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o | ||
| 101 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o | ||
| 102 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=3 --cce-aicore-arch=dav-c220-vec | ||
| 103 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 104 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 105 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 106 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 107 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 108 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 109 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 110 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 111 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 112 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 113 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 114 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 115 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 116 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 117 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/hccl/ | ||
| 118 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 119 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 120 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 121 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 122 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 123 | + ) | ||
| 124 | + | ||
| 125 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o | ||
| 126 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o | ||
| 127 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=4 --cce-aicore-arch=dav-c220-vec | ||
| 128 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 129 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 130 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 131 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 132 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 133 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 134 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 135 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 136 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 137 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 138 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 139 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 140 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 141 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 142 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/hccl/ | ||
| 143 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 144 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 145 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 146 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 147 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 148 | + ) | ||
| 149 | +else() | ||
| 150 | + get_filename_component(CCE_DIR "${CMAKE_LINKER}" PATH) | ||
| 151 | + | ||
| 152 | + set(TILING_GEN_DIR ${CMAKE_BINARY_DIR}/asc/asc-devkit) | ||
| 153 | + | ||
| 154 | + add_custom_target(hccl_aiv_sync_op | ||
| 155 | + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o kernel_tiling_headers | ||
| 156 | + COMMAND ${CCE_DIR}/ld.lld -m aicorelinux -Ttext=0 ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o -static -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op.o | ||
| 157 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 158 | + ) | ||
| 159 | + | ||
| 160 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o | ||
| 161 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_tmp.o | ||
| 162 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 --cce-aicore-arch=dav-c220-vec | ||
| 163 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 164 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 165 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 166 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 167 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 168 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 169 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 170 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 171 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 172 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 173 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 174 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 175 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 176 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 177 | + -I${TOP_DIR}/hcomm/include/hccl/ | ||
| 178 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 179 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 180 | + -I${TILING_GEN_DIR} | ||
| 181 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 182 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 183 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 184 | + ) | ||
| 185 | + | ||
| 186 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o | ||
| 187 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk1.o | ||
| 188 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=1 --cce-aicore-arch=dav-c220-vec | ||
| 189 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 190 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 191 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 192 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 193 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 194 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 195 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 196 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 197 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 198 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 199 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 200 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 201 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 202 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 203 | + -I${TOP_DIR}/hcomm/include/hccl/ | ||
| 204 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 205 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 206 | + -I${TILING_GEN_DIR} | ||
| 207 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 208 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 209 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 210 | + ) | ||
| 211 | + | ||
| 212 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o | ||
| 213 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk2.o | ||
| 214 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=2 --cce-aicore-arch=dav-c220-vec | ||
| 215 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 216 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 217 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 218 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 219 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 220 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 221 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 222 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 223 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 224 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 225 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 226 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 227 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 228 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 229 | + -I${TOP_DIR}/hcomm/include/hccl/ | ||
| 230 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 231 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 232 | + -I${TILING_GEN_DIR} | ||
| 233 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 234 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 235 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 236 | + ) | ||
| 237 | + | ||
| 238 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o | ||
| 239 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk3.o | ||
| 240 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=3 --cce-aicore-arch=dav-c220-vec | ||
| 241 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 242 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 243 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 244 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 245 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 246 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 247 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 248 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 249 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 250 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 251 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 252 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 253 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 254 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 255 | + -I${TOP_DIR}/hcomm/include/hccl/ | ||
| 256 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 257 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 258 | + -I${TILING_GEN_DIR} | ||
| 259 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 260 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 261 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 262 | + ) | ||
| 263 | + | ||
| 264 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o | ||
| 265 | + COMMAND ${BISHENG_CCACHE} ${CCE_DIR}/ccec -c -x cce -O2 ${CMAKE_CURRENT_SOURCE_DIR}/aiv_sync_op.h -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op_sk4.o | ||
| 266 | + -DASCENDC_DUMP=${ASCENDC_DUMP} -DTILING_KEY_VAR=0 -D__ASCENDC_ENABLE_SUPER_KERNEL__ -DBUILD_SK_FUNC -DSK_FUNC_ID=4 --cce-aicore-arch=dav-c220-vec | ||
| 267 | + --cce-aicore-input-parameter-size=28000 --cce-aicore-only -mllvm -cce-aicore-function-stack-size=0x8000 -mllvm -cce-aicore-dcci-insert-for-scalar=false | ||
| 268 | + -mllvm -cce-aicore-stack-size=0x8000 | ||
| 269 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/ | ||
| 270 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/basic_api/interface/ | ||
| 271 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/include/adv_api/ | ||
| 272 | + -I${ASCEND_CANN_PACKAGE_PATH}/include/ascendc/highlevel_api | ||
| 273 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/ascendc/include/basic_api/impl/ | ||
| 274 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/ | ||
| 275 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/basic_api/ | ||
| 276 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/simt_api/ | ||
| 277 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/asc/impl/micro_api/ | ||
| 278 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/basic_api/ | ||
| 279 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/simt_api/ | ||
| 280 | + -I${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux/include/micro_api/ | ||
| 281 | + -I${TOP_DIR}/hcomm/include/hccl/ | ||
| 282 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../ | ||
| 283 | + -I${CMAKE_CURRENT_SOURCE_DIR}/../aiv_interface/ | ||
| 284 | + -I${TILING_GEN_DIR} | ||
| 285 | + -mllvm -cce-aicore-record-overflow=false -mllvm -cce-aicore-addr-transform -mllvm | ||
| 286 | + --cce-aicore-jump-expand=true -std=c++17 -fstack-protector-all -DONE_CORE_DUMP_SIZE=1024 | ||
| 287 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| 288 | + ) | ||
| 289 | +endif() | ||
| 290 | + | ||
| 291 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hccl_aiv_sync_op.o OPTIONAL | ||
| 292 | + DESTINATION ${INSTALL_LIBRARY_DIR} | ||
| 293 | +) | ||
| @@ -0,0 +1,61 @@ | |||
| 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 | +using namespace AscendC; | ||
| 14 | + | ||
| 15 | +class AivSync910B : public AivCommBase { | ||
| 16 | +public: | ||
| 17 | + __aicore__ inline AivSync910B() {} | ||
| 18 | + __aicore__ inline void SyncBarrier(int32_t tag); | ||
| 19 | + __aicore__ inline void ClearGM(); | ||
| 20 | + __aicore__ inline void Process(int32_t tag); | ||
| 21 | +}; | ||
| 22 | + | ||
| 23 | +__aicore__ inline void AivSync910B::SyncBarrier(int32_t tag) | ||
| 24 | +{ | ||
| 25 | + // 从0开始,用4个flag | ||
| 26 | + uint32_t flagOffset = SYNC_BUFFER_OFFSET; | ||
| 27 | + flagOffset += ((tag % AIV_PING_PONG_FACTOR_TWO == 0) ? 0 : rankSize_ * FLAG_SIZE); | ||
| 28 | + if (blockIdx_ != rank_) { | ||
| 29 | + // 卡间同步 | ||
| 30 | + SetSignalValue((__gm__ int32_t *)(GM_OUT[blockIdx_] + flagOffset + rank_ * FLAG_SIZE), localSetTensor, 1); | ||
| 31 | + WaitSignalValue((__gm__ int32_t *)(GM_OUT[rank_] + flagOffset + blockIdx_ * FLAG_SIZE), localCheckTensor, 1); | ||
| 32 | + PipeBarrier<PIPE_ALL>(); | ||
| 33 | + SetSignalValue((__gm__ int32_t *)(GM_OUT[rank_] + flagOffset + blockIdx_ * FLAG_SIZE), localSetTensor, 0); | ||
| 34 | + } | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +__aicore__ inline void AivSync910B::ClearGM() | ||
| 38 | +{ | ||
| 39 | + uint32_t emptyOffset = CLEAR_BUFFER_OFFSET; | ||
| 40 | + uint32_t blockCount = BUFFER_AREA / rankSize_; | ||
| 41 | + uint32_t blockOffset = blockCount * blockIdx_; | ||
| 42 | + CpGM2GM(GM_OUT[rank_] + blockOffset, GM_OUT[rank_] + blockOffset + emptyOffset, blockCount); | ||
| 43 | +} | ||
| 44 | + | ||
| 45 | +__aicore__ inline void AivSync910B::Process(int32_t tag) | ||
| 46 | +{ | ||
| 47 | + if (tag == 1) { | ||
| 48 | + SyncBarrier(1); | ||
| 49 | + } else if (tag == IDX_2) { | ||
| 50 | + ClearGM(); | ||
| 51 | + } else if (tag == IDX_3) { | ||
| 52 | + SyncBarrier(IDX_2); | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +__aicore__ inline void aiv_sync_910b_inner(KERNEL_ARGS_DEF) | ||
| 57 | +{ | ||
| 58 | + AivSync910B op; | ||
| 59 | + op.Init(KERNEL_CLASS_INIT, false); | ||
| 60 | + op.Process(tag); | ||
| 61 | +} | ||
| @@ -0,0 +1,56 @@ | |||
| 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 | +using namespace AscendC; | ||
| 14 | + | ||
| 15 | +class AivSync910BRdma : public AivCommBase { | ||
| 16 | +public: | ||
| 17 | + __aicore__ inline AivSync910BRdma() {} | ||
| 18 | + __aicore__ inline void Process(int32_t tag, uint64_t rmaInfo, int32_t serverNum); | ||
| 19 | +}; | ||
| 20 | + | ||
| 21 | +__aicore__ inline void AivSync910BRdma::Process(int32_t tag, uint64_t rmaInfo, int32_t serverNum) | ||
| 22 | +{ | ||
| 23 | + uint32_t rankPerSever = rankSize_ / serverNum; | ||
| 24 | + uint64_t flagOffset = ((tag % AIV_PING_PONG_FACTOR_TWO == 0) ? 0 : 2 * rankSize_ * FLAG_SIZE); | ||
| 25 | + if (blockIdx_ < serverNum) { | ||
| 26 | + for(uint32_t i = 0; i < rankPerSever; i++) { | ||
| 27 | + uint32_t targetRank = blockIdx_ + i * serverNum; | ||
| 28 | + if (targetRank == rank_) { | ||
| 29 | + continue; | ||
| 30 | + } | ||
| 31 | + uint64_t localFlagOffset = 2 * targetRank * FLAG_SIZE; | ||
| 32 | + __gm__ int32_t *ctrlFlagGM = (__gm__ int32_t *)(GM_IN_RDMA[rank_] + flagOffset + localFlagOffset + FLAG_SIZE); // flag标志位 | ||
| 33 | + SetSignalValue(ctrlFlagGM, localSetTensor, 1); | ||
| 34 | + PipeBarrier<PIPE_ALL>(); | ||
| 35 | + AIVRDMAPostSend((GM_ADDR)((uint64_t)ctrlFlagGM), (GM_ADDR)((uint64_t)(GM_IN_RDMA[targetRank] + flagOffset + 2 * rank_ * FLAG_SIZE)), | ||
| 36 | + targetRank, UB_FLAG_PAD_COUNT, (__gm__ HcclRMAInfo*)rmaInfo, false, false); | ||
| 37 | + PipeBarrier<PIPE_ALL>(); | ||
| 38 | + } | ||
| 39 | + } else if (blockIdx_ < (DOUBLE * serverNum)) { | ||
| 40 | + for (uint32_t i = 0; i < rankPerSever; i++) { | ||
| 41 | + uint32_t sourceRank = blockIdx_ % serverNum + i * serverNum; | ||
| 42 | + if (sourceRank == rank_) { | ||
| 43 | + continue; | ||
| 44 | + } | ||
| 45 | + WaitSignalValue((__gm__ int32_t *)(GM_IN_RDMA[rank_] + flagOffset + 2 * sourceRank * FLAG_SIZE), localCheckTensor, 1); | ||
| 46 | + PipeBarrier<PIPE_ALL>(); | ||
| 47 | + SetSignalValue((__gm__ int32_t *)(GM_IN_RDMA[rank_] + flagOffset + 2 * sourceRank * FLAG_SIZE), localSetTensor, 0); | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | +} | ||
| 51 | +__aicore__ inline void aiv_sync_910b_rdma(KERNEL_ARGS_DEF) | ||
| 52 | +{ | ||
| 53 | + AivSync910BRdma op; | ||
| 54 | + op.InitForRDMA(KERNEL_CLASS_INIT, false); | ||
| 55 | + op.Process(tag, rmaInfo, serverNum); | ||
| 56 | +} | ||
| @@ -0,0 +1,39 @@ | |||
| 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 | + | ||
| 14 | + | ||
| 15 | + | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +// aiv sync | ||
| 20 | +__aicore__ inline void hccl_aiv_sync_inner(KERNEL_ARGS_DEF) { | ||
| 21 | + return aiv_sync_910b_inner(KERNEL_ARGS_CALL); | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +// aiv sync rdma | ||
| 25 | +__aicore__ inline void hccl_aiv_sync_rdma_inner(KERNEL_ARGS_DEF) { | ||
| 26 | + return aiv_sync_910b_rdma(KERNEL_ARGS_CALL); | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + SK_BIND_FUNC_DEF_A2(hccl_aiv_sync, SK_FUNC_ID) | ||
| 31 | + SK_BIND_FUNC_DEF_A2(hccl_aiv_sync_rdma, SK_FUNC_ID) | ||
| 32 | + | ||
| 33 | + GLOBAL_FUNC_DEF_A2(hccl_aiv_sync); | ||
| 34 | + GLOBAL_FUNC_DEF_A2(hccl_aiv_sync_rdma); | ||
| 35 | + SuperKernelBindA2(hccl_aiv_sync); | ||
| 36 | + SuperKernelBindA2(hccl_aiv_sync_rdma); | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + | ||
| @@ -226,7 +226,9 @@ HcclResult CollAllGatherAivRdmaExecutor::KernelRun(const OpParam ¶m, ExecMem | |||
| 226 | 226 | ||
| 227 | struct AivProfilingInfo aivProfilingInfo; | 227 | struct AivProfilingInfo aivProfilingInfo; |
| 228 | aivProfilingInfo.counter = opCounter_; | 228 | aivProfilingInfo.counter = opCounter_; |
| 229 | - | 229 | + if (aivClearEnable_) { |
| 230 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 231 | + } | ||
| 230 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); | 232 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); |
| 231 | HCCL_INFO("[CollAllGatherAivRdmaExecutor][KernelRun]allGather aiv run success."); | 233 | HCCL_INFO("[CollAllGatherAivRdmaExecutor][KernelRun]allGather aiv run success."); |
| 232 | return HCCL_SUCCESS; | 234 | return HCCL_SUCCESS; |
| @@ -214,6 +214,9 @@ HcclResult CollAllGatherMeshAivExecutor::KernelRun(const OpParam ¶m, ExecMem | |||
| 214 | algArgs.execTimeOutSet = true; | 214 | algArgs.execTimeOutSet = true; |
| 215 | struct AivProfilingInfo aivProfilingInfo; | 215 | struct AivProfilingInfo aivProfilingInfo; |
| 216 | aivProfilingInfo.counter = opCounter_; | 216 | aivProfilingInfo.counter = opCounter_; |
| 217 | + if (aivClearEnable_) { | ||
| 218 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 219 | + } | ||
| 217 | 220 | ||
| 218 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 221 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 219 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 222 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
Msrc/algorithm/impl/coll_executor/coll_all_gather/coll_all_gather_mesh_aiv_for_910_93_executor.cc+3-0
| @@ -218,6 +218,9 @@ HcclResult CollAllGatherMeshAivFor91093Executor::KernelRun(const OpParam ¶m, | |||
| 218 | algArgs.execTimeOutSet = true; | 218 | algArgs.execTimeOutSet = true; |
| 219 | struct AivProfilingInfo aivProfilingInfo; | 219 | struct AivProfilingInfo aivProfilingInfo; |
| 220 | aivProfilingInfo.counter = opCounter_; | 220 | aivProfilingInfo.counter = opCounter_; |
| 221 | + if (aivClearEnable_) { | ||
| 222 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 223 | + } | ||
| 221 | 224 | ||
| 222 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 225 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 223 | 226 | ||
Msrc/algorithm/impl/coll_executor/coll_all_gather/coll_all_gather_mesh_aiv_smallcount_executor.cc+3-0
| @@ -204,6 +204,9 @@ HcclResult CollAllGatherMeshAivSmallCountExecutor::KernelRun(const OpParam ¶ | |||
| 204 | algArgs.execTimeOutSet = true; | 204 | algArgs.execTimeOutSet = true; |
| 205 | struct AivProfilingInfo aivProfilingInfo; | 205 | struct AivProfilingInfo aivProfilingInfo; |
| 206 | aivProfilingInfo.counter = opCounter_; | 206 | aivProfilingInfo.counter = opCounter_; |
| 207 | + if (aivClearEnable_) { | ||
| 208 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 209 | + } | ||
| 207 | 210 | ||
| 208 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 211 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 209 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 212 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| @@ -140,6 +140,9 @@ HcclResult AllGatherVMeshAivExecutor::KernelRun(const OpParam ¶m, ExecMem &e | |||
| 140 | algArgs.execTimeOutSet = true; | 140 | algArgs.execTimeOutSet = true; |
| 141 | struct AivProfilingInfo aivProfilingInfo; | 141 | struct AivProfilingInfo aivProfilingInfo; |
| 142 | aivProfilingInfo.counter = opCounter_; | 142 | aivProfilingInfo.counter = opCounter_; |
| 143 | + if (aivClearEnable_) { | ||
| 144 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 145 | + } | ||
| 143 | 146 | ||
| 144 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); | 147 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); |
| 145 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 148 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
Msrc/algorithm/impl/coll_executor/coll_all_gather_v/coll_all_gatherv_mesh_aiv_smallcount_executor.cc+3-0
| @@ -137,6 +137,9 @@ HcclResult CollAllGatherVMeshAivSmallCountExecutor::KernelRun(const OpParam &par | |||
| 137 | algArgs.execTimeOutSet = true; | 137 | algArgs.execTimeOutSet = true; |
| 138 | struct AivProfilingInfo aivProfilingInfo; | 138 | struct AivProfilingInfo aivProfilingInfo; |
| 139 | aivProfilingInfo.counter = opCounter_; | 139 | aivProfilingInfo.counter = opCounter_; |
| 140 | + if (aivClearEnable_) { | ||
| 141 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 142 | + } | ||
| 140 | 143 | ||
| 141 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); | 144 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); |
| 142 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 145 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| @@ -148,6 +148,10 @@ HcclResult CollAllReduceAivDeterExecutor::KernelRun(const OpParam ¶m, ExecMe | |||
| 148 | aivProfilingInfo.counter = opCounter_; | 148 | aivProfilingInfo.counter = opCounter_; |
| 149 | HCCL_INFO("[CollAllReduceAivDeterExecutor][KernelRun]AllReduce bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); | 149 | HCCL_INFO("[CollAllReduceAivDeterExecutor][KernelRun]AllReduce bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); |
| 150 | 150 | ||
| 151 | + if (aivClearEnable_) { | ||
| 152 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 153 | + } | ||
| 154 | + | ||
| 151 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 155 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 152 | 156 | ||
| 153 | ExtraArgs extraArgs; | 157 | ExtraArgs extraArgs; |
| @@ -157,6 +157,10 @@ HcclResult CollAllReduceAivDeterSmallExecutor::KernelRun(const OpParam ¶m, E | |||
| 157 | 157 | ||
| 158 | HCCL_INFO("[CollAllReduceAivDeterSmallExecutor][KernelRun]AllReduce bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); | 158 | HCCL_INFO("[CollAllReduceAivDeterSmallExecutor][KernelRun]AllReduce bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); |
| 159 | 159 | ||
| 160 | + if (aivClearEnable_) { | ||
| 161 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 162 | + } | ||
| 163 | + | ||
| 160 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 164 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 161 | 165 | ||
| 162 | ExtraArgs extraArgs; | 166 | ExtraArgs extraArgs; |
| @@ -222,6 +222,9 @@ HcclResult CollAllReduceMeshAivExecutor::KernelRun(const OpParam ¶m, ExecMem | |||
| 222 | algArgs.execTimeOutSet = true; | 222 | algArgs.execTimeOutSet = true; |
| 223 | struct AivProfilingInfo aivProfilingInfo; | 223 | struct AivProfilingInfo aivProfilingInfo; |
| 224 | aivProfilingInfo.counter = opCounter_; | 224 | aivProfilingInfo.counter = opCounter_; |
| 225 | + if (aivClearEnable_) { | ||
| 226 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 227 | + } | ||
| 225 | 228 | ||
| 226 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 229 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 227 | 230 | ||
Msrc/algorithm/impl/coll_executor/coll_all_reduce/coll_all_reduce_mesh_aiv_for_910_93_executor.cc+3-0
| @@ -265,6 +265,9 @@ HcclResult CollAllReduceMeshAivFor91093Executor::KernelRun(const OpParam ¶m, | |||
| 265 | algArgs.deterministic = 1; | 265 | algArgs.deterministic = 1; |
| 266 | } | 266 | } |
| 267 | aivProfilingInfo.counter = opCounter_; | 267 | aivProfilingInfo.counter = opCounter_; |
| 268 | + if (aivClearEnable_) { | ||
| 269 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 270 | + } | ||
| 268 | 271 | ||
| 269 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 272 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 270 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 273 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
Msrc/algorithm/impl/coll_executor/coll_all_reduce/coll_all_reduce_mesh_aiv_smallcount_executor.cc+3-0
| @@ -201,6 +201,9 @@ HcclResult CollAllReduceMeshAivSmallCountExecutor::KernelRun(const OpParam ¶ | |||
| 201 | struct AivProfilingInfo aivProfilingInfo; | 201 | struct AivProfilingInfo aivProfilingInfo; |
| 202 | aivProfilingInfo.counter = opCounter_; | 202 | aivProfilingInfo.counter = opCounter_; |
| 203 | HCCL_DEBUG("[CollAllReduceMeshAivSmallCountExecutor][KernelRun]numBlocks is %u", numBlocks_); | 203 | HCCL_DEBUG("[CollAllReduceMeshAivSmallCountExecutor][KernelRun]numBlocks is %u", numBlocks_); |
| 204 | + if (aivClearEnable_) { | ||
| 205 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 206 | + } | ||
| 204 | 207 | ||
| 205 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 208 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 206 | 209 | ||
Msrc/algorithm/impl/coll_executor/coll_all_reduce/coll_all_reduce_mid_count_aiv_rdma_executor.cc+3-0
| @@ -167,6 +167,9 @@ HcclResult CollAllReduceMidCountAivRdmaExecutor::KernelRun(const OpParam ¶m, | |||
| 167 | algArgs.execTimeOutSet = true; | 167 | algArgs.execTimeOutSet = true; |
| 168 | struct AivProfilingInfo aivProfilingInfo; | 168 | struct AivProfilingInfo aivProfilingInfo; |
| 169 | aivProfilingInfo.counter = opCounter_; | 169 | aivProfilingInfo.counter = opCounter_; |
| 170 | + if (aivClearEnable_) { | ||
| 171 | + CHK_RET(ClearAivSyncBuf(flagBuffers, resourceArgs, topoArgs, algArgs)); | ||
| 172 | + } | ||
| 170 | 173 | ||
| 171 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); | 174 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); |
| 172 | 175 | ||
Msrc/algorithm/impl/coll_executor/coll_all_reduce/coll_all_reduce_small_count_aiv_rdma_executor.cc+3-0
| @@ -251,6 +251,9 @@ HcclResult CollAllReduceSmallCountAivRdmaExecutor::KernelRun(const OpParam ¶ | |||
| 251 | algArgs.execTimeOutSet = true; | 251 | algArgs.execTimeOutSet = true; |
| 252 | struct AivProfilingInfo aivProfilingInfo; | 252 | struct AivProfilingInfo aivProfilingInfo; |
| 253 | aivProfilingInfo.counter = opCounter_; | 253 | aivProfilingInfo.counter = opCounter_; |
| 254 | + if (aivClearEnable_) { | ||
| 255 | + CHK_RET(ClearAivSyncBuf(flagBuffers, resourceArgs, topoArgs, algArgs)); | ||
| 256 | + } | ||
| 254 | 257 | ||
| 255 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); | 258 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); |
| 256 | 259 | ||
| @@ -242,6 +242,9 @@ HcclResult CollAlltoAllMeshAivExecutor::KernelRun(const OpParam ¶m, ExecMem | |||
| 242 | HCCL_E_PARA); | 242 | HCCL_E_PARA); |
| 243 | numBlocks_ = numBlocks; | 243 | numBlocks_ = numBlocks; |
| 244 | resourceArgs.numBlocks = numBlocks_; | 244 | resourceArgs.numBlocks = numBlocks_; |
| 245 | + if (aivClearEnable_) { | ||
| 246 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 247 | + } | ||
| 245 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 248 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 246 | } else if (param.opType == HcclCMDType::HCCL_CMD_ALLTOALLVC || param.opType == HcclCMDType::HCCL_CMD_ALLTOALL) { | 249 | } else if (param.opType == HcclCMDType::HCCL_CMD_ALLTOALLVC || param.opType == HcclCMDType::HCCL_CMD_ALLTOALL) { |
| 247 | for (u32 i = 0; i < localRankSize; i++) { | 250 | for (u32 i = 0; i < localRankSize; i++) { |
| @@ -264,6 +267,9 @@ HcclResult CollAlltoAllMeshAivExecutor::KernelRun(const OpParam ¶m, ExecMem | |||
| 264 | HCCL_E_PARA); | 267 | HCCL_E_PARA); |
| 265 | numBlocks_ = numBlocks; | 268 | numBlocks_ = numBlocks; |
| 266 | resourceArgs.numBlocks = numBlocks_; | 269 | resourceArgs.numBlocks = numBlocks_; |
| 270 | + if (aivClearEnable_) { | ||
| 271 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 272 | + } | ||
| 267 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); | 273 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); |
| 268 | } else { | 274 | } else { |
| 269 | for (u32 i = 0; i < localRankSize; i++) { | 275 | for (u32 i = 0; i < localRankSize; i++) { |
| @@ -280,6 +286,9 @@ HcclResult CollAlltoAllMeshAivExecutor::KernelRun(const OpParam ¶m, ExecMem | |||
| 280 | HCCL_E_PARA); | 286 | HCCL_E_PARA); |
| 281 | numBlocks_ = numBlocks; | 287 | numBlocks_ = numBlocks; |
| 282 | resourceArgs.numBlocks = numBlocks_; | 288 | resourceArgs.numBlocks = numBlocks_; |
| 289 | + if (aivClearEnable_) { | ||
| 290 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 291 | + } | ||
| 283 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); | 292 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); |
| 284 | } | 293 | } |
| 285 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 294 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
Msrc/algorithm/impl/coll_executor/coll_all_to_all/coll_all_to_all_mesh_aiv_for_910_93_executor.cc+6-0
| @@ -208,9 +208,15 @@ HcclResult CollAlltoAllMeshAivFor91093Executor::KernelRun(const OpParam ¶m, | |||
| 208 | if (topoArgs.serverNum == 1) { | 208 | if (topoArgs.serverNum == 1) { |
| 209 | topoArgs.serverNum = TWO_SERVER_NUM; | 209 | topoArgs.serverNum = TWO_SERVER_NUM; |
| 210 | } | 210 | } |
| 211 | + if (aivClearEnable_) { | ||
| 212 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 213 | + } | ||
| 211 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 214 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 212 | } else { | 215 | } else { |
| 213 | algArgs.argsType = KernelArgsType::ARGS_TYPE_SUPERPOD; | 216 | algArgs.argsType = KernelArgsType::ARGS_TYPE_SUPERPOD; |
| 217 | + if (aivClearEnable_) { | ||
| 218 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 219 | + } | ||
| 214 | ExtraArgsV2 extraArgs; | 220 | ExtraArgsV2 extraArgs; |
| 215 | if (param.opType == HcclCMDType::HCCL_CMD_ALLTOALLVC) { | 221 | if (param.opType == HcclCMDType::HCCL_CMD_ALLTOALLVC) { |
| 216 | for (u32 i = 0; i < localRankSize; i++) { | 222 | for (u32 i = 0; i < localRankSize; i++) { |
Msrc/algorithm/impl/coll_executor/coll_all_to_all/coll_all_to_all_mesh_aiv_smallcount_executor.cc+3-0
| @@ -203,6 +203,9 @@ HcclResult CollAlltoAllMeshAivSmallCountExecutor::KernelRun(const OpParam ¶m | |||
| 203 | algArgs.execTimeOutSet = true; | 203 | algArgs.execTimeOutSet = true; |
| 204 | struct AivProfilingInfo aivProfilingInfo; | 204 | struct AivProfilingInfo aivProfilingInfo; |
| 205 | aivProfilingInfo.counter = opCounter_; | 205 | aivProfilingInfo.counter = opCounter_; |
| 206 | + if (aivClearEnable_) { | ||
| 207 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 208 | + } | ||
| 206 | 209 | ||
| 207 | // AllToAll pingpong 图模式走单算子归一流程 或者 单算子模式 | 210 | // AllToAll pingpong 图模式走单算子归一流程 或者 单算子模式 |
| 208 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 211 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| @@ -136,6 +136,9 @@ HcclResult CollRunAlltoAllStagedAivRdmaExecutor::RunAlltoAllStaged1InAIV(const O | |||
| 136 | struct AivProfilingInfo aivProfilingInfo; | 136 | struct AivProfilingInfo aivProfilingInfo; |
| 137 | aivProfilingInfo.counter = opCounter_; | 137 | aivProfilingInfo.counter = opCounter_; |
| 138 | HCCL_DEBUG("[CollRunAlltoAllStagedAivRdmaExecutor]RunAlltoAllStaged1InAIV for numBlocks is %u", numBlocks_); | 138 | HCCL_DEBUG("[CollRunAlltoAllStagedAivRdmaExecutor]RunAlltoAllStaged1InAIV for numBlocks is %u", numBlocks_); |
| 139 | + if (aivClearEnable_) { | ||
| 140 | + CHK_RET(ClearAivSyncBuf(flagBuffers, resourceArgs, topoArgs, algArgs)); | ||
| 141 | + } | ||
| 139 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); | 142 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); |
| 140 | return HCCL_SUCCESS; | 143 | return HCCL_SUCCESS; |
| 141 | } | 144 | } |
| @@ -147,6 +147,9 @@ HcclResult CollBroadcastMeshAivExecutor::KernelRun(const OpParam ¶m, ExecMem | |||
| 147 | algArgs.execTimeOutSet = true; | 147 | algArgs.execTimeOutSet = true; |
| 148 | struct AivProfilingInfo aivProfilingInfo; | 148 | struct AivProfilingInfo aivProfilingInfo; |
| 149 | aivProfilingInfo.counter = opCounter_; | 149 | aivProfilingInfo.counter = opCounter_; |
| 150 | + if (aivClearEnable_) { | ||
| 151 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 152 | + } | ||
| 150 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); // 执行kernelLaunch | 153 | ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); // 执行kernelLaunch |
| 151 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 154 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| 152 | HCCL_ERROR("[CollBroadcastMeshAivExecutor][KernelRun]broadcast aiv failed, return[%d]", ret), | 155 | HCCL_ERROR("[CollBroadcastMeshAivExecutor][KernelRun]broadcast aiv failed, return[%d]", ret), |
| @@ -191,6 +191,10 @@ HcclResult CollReduceScatterAivDeterExecutor::KernelRun(const OpParam ¶m, Ex | |||
| 191 | aivProfilingInfo.counter = opCounter_; | 191 | aivProfilingInfo.counter = opCounter_; |
| 192 | HCCL_INFO("[CollReduceScatterAivDeterExecutor][KernelRun]ReduceScatter bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); | 192 | HCCL_INFO("[CollReduceScatterAivDeterExecutor][KernelRun]ReduceScatter bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); |
| 193 | 193 | ||
| 194 | + if (aivClearEnable_) { | ||
| 195 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 196 | + } | ||
| 197 | + | ||
| 194 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 198 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 195 | 199 | ||
| 196 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 200 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
Msrc/algorithm/impl/coll_executor/coll_reduce_scatter/coll_reduce_scatter_aiv_deter_small_executor.cc+4-0
| @@ -198,6 +198,10 @@ HcclResult CollReduceScatterAivDeterSmallExecutor::KernelRun(const OpParam ¶ | |||
| 198 | aivProfilingInfo.counter = opCounter_; | 198 | aivProfilingInfo.counter = opCounter_; |
| 199 | HCCL_INFO("[CollReduceScatterAivDeterSmallExecutor][KernelRun]ReduceScatter bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); | 199 | HCCL_INFO("[CollReduceScatterAivDeterSmallExecutor][KernelRun]ReduceScatter bufferin[%d] bufferout[%d]",execMem.inputMem.size(), execMem.outputMem.size()); |
| 200 | 200 | ||
| 201 | + if (aivClearEnable_) { | ||
| 202 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 203 | + } | ||
| 204 | + | ||
| 201 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 205 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 202 | 206 | ||
| 203 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 207 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| @@ -177,6 +177,9 @@ HcclResult CollReduceScatterAivRdmaExecutor::KernelRun(const OpParam ¶m, Exe | |||
| 177 | algArgs.execTimeOutSet = true; | 177 | algArgs.execTimeOutSet = true; |
| 178 | struct AivProfilingInfo aivProfilingInfo; | 178 | struct AivProfilingInfo aivProfilingInfo; |
| 179 | aivProfilingInfo.counter = opCounter_; | 179 | aivProfilingInfo.counter = opCounter_; |
| 180 | + if (aivClearEnable_) { | ||
| 181 | + CHK_RET(ClearAivSyncBuf(flagBuffers, resourceArgs, topoArgs, algArgs)); | ||
| 182 | + } | ||
| 180 | 183 | ||
| 181 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); | 184 | CHK_RET(ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo)); |
| 182 | /* 第二步 节点间RS */ | 185 | /* 第二步 节点间RS */ |
| @@ -221,6 +221,9 @@ HcclResult CollReduceScatterMeshAivExecutor::KernelRun(const OpParam ¶m, Exe | |||
| 221 | algArgs.execTimeOut = topoMatcher_->GetExecTimeOutConfig(); | 221 | algArgs.execTimeOut = topoMatcher_->GetExecTimeOutConfig(); |
| 222 | algArgs.execTimeOutSet = true; | 222 | algArgs.execTimeOutSet = true; |
| 223 | aivProfilingInfo.counter = opCounter_; | 223 | aivProfilingInfo.counter = opCounter_; |
| 224 | + if (aivClearEnable_) { | ||
| 225 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 226 | + } | ||
| 224 | 227 | ||
| 225 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 228 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 226 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 229 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| @@ -334,6 +334,9 @@ HcclResult CollReduceScatterMeshAivFor91093Executor::KernelRun(const OpParam &pa | |||
| 334 | algArgs.execTimeOutSet = true; | 334 | algArgs.execTimeOutSet = true; |
| 335 | struct AivProfilingInfo aivProfilingInfo; | 335 | struct AivProfilingInfo aivProfilingInfo; |
| 336 | aivProfilingInfo.counter = opCounter_; | 336 | aivProfilingInfo.counter = opCounter_; |
| 337 | + if (aivClearEnable_) { | ||
| 338 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 339 | + } | ||
| 337 | 340 | ||
| 338 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 341 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 339 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 342 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| @@ -213,6 +213,9 @@ HcclResult CollReduceScatterMeshAivSmallCountExecutor::KernelRun(const OpParam & | |||
| 213 | algArgs.execTimeOutSet = true; | 213 | algArgs.execTimeOutSet = true; |
| 214 | struct AivProfilingInfo aivProfilingInfo; | 214 | struct AivProfilingInfo aivProfilingInfo; |
| 215 | aivProfilingInfo.counter = opCounter_; | 215 | aivProfilingInfo.counter = opCounter_; |
| 216 | + if (aivClearEnable_) { | ||
| 217 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 218 | + } | ||
| 216 | 219 | ||
| 217 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); | 220 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo); |
| 218 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 221 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| @@ -153,6 +153,9 @@ HcclResult CollReduceScatterVAIVBigCountExecutor::KernelRun(const OpParam ¶m | |||
| 153 | algArgs.execTimeOutSet = true; | 153 | algArgs.execTimeOutSet = true; |
| 154 | struct AivProfilingInfo aivProfilingInfo; | 154 | struct AivProfilingInfo aivProfilingInfo; |
| 155 | aivProfilingInfo.counter = opCounter_; | 155 | aivProfilingInfo.counter = opCounter_; |
| 156 | + if (aivClearEnable_) { | ||
| 157 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 158 | + } | ||
| 156 | 159 | ||
| 157 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); | 160 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); |
| 158 | CHK_PRT_RET(ret != HCCL_SUCCESS, HCCL_ERROR("[CollReduceScatterVAIVBigCountExecutor][KernelRun]" | 161 | CHK_PRT_RET(ret != HCCL_SUCCESS, HCCL_ERROR("[CollReduceScatterVAIVBigCountExecutor][KernelRun]" |
| @@ -137,6 +137,9 @@ HcclResult CollReduceScatterVMeshAivSmallCountExecutor::KernelRun(const OpParam | |||
| 137 | algArgs.execTimeOutSet = true; | 137 | algArgs.execTimeOutSet = true; |
| 138 | struct AivProfilingInfo aivProfilingInfo; | 138 | struct AivProfilingInfo aivProfilingInfo; |
| 139 | aivProfilingInfo.counter = opCounter_; | 139 | aivProfilingInfo.counter = opCounter_; |
| 140 | + if (aivClearEnable_) { | ||
| 141 | + CHK_RET(ClearAivSyncBuf(buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 142 | + } | ||
| 140 | 143 | ||
| 141 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); | 144 | HcclResult ret = ExecuteKernelLaunch(opArgs, topoArgs, resourceArgs, algArgs, extraArgs, aivProfilingInfo); |
| 142 | CHK_PRT_RET(ret != HCCL_SUCCESS, | 145 | CHK_PRT_RET(ret != HCCL_SUCCESS, |
| @@ -36,6 +36,9 @@ constexpr u32 RANK_FIVE = 5; | |||
| 36 | constexpr u32 RANK_SIX = 6; | 36 | constexpr u32 RANK_SIX = 6; |
| 37 | constexpr u32 RANK_SEVEN = 7; | 37 | constexpr u32 RANK_SEVEN = 7; |
| 38 | constexpr u32 MAX_ARGS_SIZE_A3_STRUCT = 9; | 38 | constexpr u32 MAX_ARGS_SIZE_A3_STRUCT = 9; |
| 39 | +constexpr u32 STEP_ONE = 1; | ||
| 40 | +constexpr u32 STEP_TWO = 2; | ||
| 41 | +constexpr u32 STEP_THREE = 3; | ||
| 39 | 42 | ||
| 40 | constexpr u32 AIV_BUFFER_PING_PONG_FACTOR = 2; | 43 | constexpr u32 AIV_BUFFER_PING_PONG_FACTOR = 2; |
| 41 | 44 | ||
| @@ -202,6 +205,13 @@ static std::vector<AivKernelInfo> g_allgathervAivKernelInfoList = { | |||
| 202 | }; | 205 | }; |
| 203 | static std::string g_allgathervAivBinaryName = "hccl_aiv_all_gather_v_op.o"; | 206 | static std::string g_allgathervAivBinaryName = "hccl_aiv_all_gather_v_op.o"; |
| 204 | 207 | ||
| 208 | +// 同步 | ||
| 209 | +static std::vector<AivKernelInfo> g_syncAivKernelInfoList = { | ||
| 210 | + {"hccl_aiv_sync", HcclDataType::HCCL_DATA_TYPE_RESERVED}, | ||
| 211 | + {"hccl_aiv_sync_rdma", HcclDataType::HCCL_DATA_TYPE_RESERVED, KernelArgsType::ARGS_TYPE_SUPERPOD}, | ||
| 212 | +}; | ||
| 213 | +static std::string g_syncAivBinaryName = "hccl_aiv_sync_op.o"; | ||
| 214 | + | ||
| 205 | static std::map<HcclCMDType, std::pair<std::string, std::vector<AivKernelInfo>>> g_aivKernelInfoMap = { | 215 | static std::map<HcclCMDType, std::pair<std::string, std::vector<AivKernelInfo>>> g_aivKernelInfoMap = { |
| 206 | {HcclCMDType::HCCL_CMD_ALLREDUCE, {g_allreduceAivBinaryName, g_allreduceAivKernelInfoList}}, | 216 | {HcclCMDType::HCCL_CMD_ALLREDUCE, {g_allreduceAivBinaryName, g_allreduceAivKernelInfoList}}, |
| 207 | {HcclCMDType::HCCL_CMD_REDUCE_SCATTER, {g_reducescatterAivBinaryName, g_reducescatterAivKernelInfoList}}, | 217 | {HcclCMDType::HCCL_CMD_REDUCE_SCATTER, {g_reducescatterAivBinaryName, g_reducescatterAivKernelInfoList}}, |
| @@ -212,6 +222,7 @@ static std::map<HcclCMDType, std::pair<std::string, std::vector<AivKernelInfo>>> | |||
| 212 | {HcclCMDType::HCCL_CMD_ALLTOALLVC, {g_alltoallvcAivBinaryName, g_alltoallvcAivKernelInfoList}}, | 222 | {HcclCMDType::HCCL_CMD_ALLTOALLVC, {g_alltoallvcAivBinaryName, g_alltoallvcAivKernelInfoList}}, |
| 213 | {HcclCMDType::HCCL_CMD_REDUCE_SCATTER_V, {g_reducescattervAivBinaryName, g_reducescattervAivKernelInfoList}}, | 223 | {HcclCMDType::HCCL_CMD_REDUCE_SCATTER_V, {g_reducescattervAivBinaryName, g_reducescattervAivKernelInfoList}}, |
| 214 | {HcclCMDType::HCCL_CMD_ALLGATHER_V, {g_allgathervAivBinaryName, g_allgathervAivKernelInfoList}}, | 224 | {HcclCMDType::HCCL_CMD_ALLGATHER_V, {g_allgathervAivBinaryName, g_allgathervAivKernelInfoList}}, |
| 225 | + {HcclCMDType::HCCL_CMD_INVALID, {g_syncAivBinaryName, g_syncAivKernelInfoList}}, | ||
| 215 | }; | 226 | }; |
| 216 | 227 | ||
| 217 | using AivKernelArgs = struct AivKernelArgsDef { | 228 | using AivKernelArgs = struct AivKernelArgsDef { |
| @@ -572,6 +583,153 @@ u32 GetAivTimeout(s32 execTimeOut, bool isSetByConfig) { | |||
| 572 | return timeout < AIV_TIMEOUT_MAX_US ? timeout : AIV_TIMEOUT_MAX_US; | 583 | return timeout < AIV_TIMEOUT_MAX_US ? timeout : AIV_TIMEOUT_MAX_US; |
| 573 | } | 584 | } |
| 574 | 585 | ||
| 586 | +HcclResult BarrierForMulServer(const AivResourceArgs &resourceArgs, s32 step, const AivTopoArgs &topoArgs, void* args, | ||
| 587 | + u32 argsSize, s32 execTimeOut, bool execTimeOutSet) | ||
| 588 | +{ | ||
| 589 | + uint64_t beginTime = 0; | ||
| 590 | + SetAivProfilingInfoBeginTime(beginTime); | ||
| 591 | + HcclResult ret = HcclResult::HCCL_E_PARA; | ||
| 592 | + aclrtLaunchKernelCfg cfg; | ||
| 593 | + aclrtLaunchKernelAttr attr[AIV_ATTRNUM_THREE]; | ||
| 594 | + attr[0].id = ACL_RT_LAUNCH_KERNEL_ATTR_SCHEM_MODE; | ||
| 595 | + attr[0].value.schemMode = 1; | ||
| 596 | + attr[1].id = ACL_RT_LAUNCH_KERNEL_ATTR_TIMEOUT_US; | ||
| 597 | + attr[1].value.timeoutUs.timeoutLow = GetAivTimeout(execTimeOut, execTimeOutSet); | ||
| 598 | + attr[1].value.timeoutUs.timeoutHigh = 0; | ||
| 599 | + attr[2].id = ACL_RT_LAUNCH_KERNEL_ATTR_ENGINE_TYPE; | ||
| 600 | + attr[2].value.engineType = ACL_RT_ENGINE_TYPE_AIV; | ||
| 601 | + cfg.numAttrs = AIV_ATTRNUM_THREE; | ||
| 602 | + cfg.attrs = attr; | ||
| 603 | + | ||
| 604 | + u32 rank = topoArgs.rank; | ||
| 605 | + u8* flagAddr = static_cast<u8 *>(resourceArgs.buffersIn[0]); | ||
| 606 | + | ||
| 607 | + aclrtFuncHandle funcHandle; | ||
| 608 | + s8* stubFunc = GetStubFunc(HcclCMDType::HCCL_CMD_INVALID, HcclDataType::HCCL_DATA_TYPE_RESERVED, | ||
| 609 | + KernelArgsType::ARGS_TYPE_SUPERPOD); | ||
| 610 | + ret = GetKernelFunc(funcHandle, stubFunc); | ||
| 611 | + CHK_PRT_RET(ret != HCCL_SUCCESS, HCCL_ERROR("[AIV][BarrierForMulServer] errNo[0x%016llx] GetKernelFunc failed, " | ||
| 612 | + "return[%d]", HCCL_ERROR_CODE(HCCL_E_RUNTIME), ret), HCCL_E_RUNTIME); | ||
| 613 | + aclError aclRet = aclrtLaunchKernelWithHostArgs(funcHandle, resourceArgs.numBlocks, resourceArgs.stream, | ||
| 614 | + &cfg, args, argsSize, nullptr, 0); | ||
| 615 | + if (aclRet == ACL_ERROR_RT_INVALID_HANDLE) { | ||
| 616 | + aclError aclGetRet = aclrtBinaryGetFunction(g_binHandleMap[HcclCMDType::HCCL_CMD_INVALID], g_aivNameMap[stubFunc].c_str(), &funcHandle); | ||
| 617 | + CHK_PRT_RET(aclGetRet != ACL_SUCCESS, HCCL_ERROR("[RegisterBinaryKernel]errNo[0x%016llx] get function from binary error.", aclRet), | ||
| 618 | + HCCL_E_NOT_FOUND); | ||
| 619 | + aclRet = aclrtLaunchKernelWithHostArgs(funcHandle, resourceArgs.numBlocks, resourceArgs.stream, | ||
| 620 | + &cfg, args, argsSize, nullptr, 0); | ||
| 621 | + } | ||
| 622 | + CHK_PRT_RET(aclRet != ACL_SUCCESS, HCCL_ERROR("[ExecuteKernelLaunchInner]errNo[0x%016llx] aclrtLaunchKernelWithHostArgs error[%d].", | ||
| 623 | + HCCL_ERROR_CODE(HCCL_E_RUNTIME), aclRet), HCCL_E_RUNTIME); | ||
| 624 | + | ||
| 625 | + struct TaskParaGeneral taskParaGeneral; | ||
| 626 | + TaskParaAiv taskParaAiv(HcclCMDType::HCCL_CMD_INVALID, step, 0, resourceArgs.numBlocks, topoArgs.rankSize, -1, | ||
| 627 | + flagAddr, rank); | ||
| 628 | + taskParaGeneral.isMainStream = true; | ||
| 629 | + taskParaGeneral.stream = resourceArgs.stream; | ||
| 630 | + taskParaGeneral.beginTime = beginTime; | ||
| 631 | + taskParaGeneral.aiv = taskParaAiv; | ||
| 632 | + | ||
| 633 | + AlgWrap::GetInstance().TaskAivProfiler(topoArgs.identify, taskParaGeneral); | ||
| 634 | + | ||
| 635 | + CHK_PRT_RET(ret != HCCL_SUCCESS, HCCL_ERROR("[AIV][BarrierForMulServer] errNo[0x%016llx] rtKernelLaunch aiv fail, " | ||
| 636 | + "return[%d]", HCCL_ERROR_CODE(HCCL_E_RUNTIME), ret), HCCL_E_RUNTIME); | ||
| 637 | + return HCCL_SUCCESS; | ||
| 638 | +} | ||
| 639 | + | ||
| 640 | +HcclResult LaunchSyncKernel(aclrtLaunchKernelCfg &cfg, AivKernelArgs &aivKernelArgs, rtStream_t stream, s32 step, const std::string& comm) | ||
| 641 | +{ | ||
| 642 | + uint64_t beginTime = 0; | ||
| 643 | + SetAivProfilingInfoBeginTime(beginTime); | ||
| 644 | + | ||
| 645 | + aclrtFuncHandle funcHandle; | ||
| 646 | + s8* stubFunc = GetStubFunc(HcclCMDType::HCCL_CMD_INVALID, HcclDataType::HCCL_DATA_TYPE_RESERVED); | ||
| 647 | + HcclResult ret = GetKernelFunc(funcHandle, stubFunc); | ||
| 648 | + CHK_PRT_RET(ret != HCCL_SUCCESS, HCCL_ERROR("[AIV][Barrier] errNo[0x%016llx] GetKernelFunc failed, " | ||
| 649 | + "return[%d]", HCCL_ERROR_CODE(HCCL_E_RUNTIME), ret), HCCL_E_RUNTIME); | ||
| 650 | + | ||
| 651 | + aivKernelArgs.tag = step; | ||
| 652 | + aclError aclRet = aclrtLaunchKernelWithHostArgs(funcHandle, aivKernelArgs.rankSize, stream, | ||
| 653 | + &cfg, &aivKernelArgs, sizeof(aivKernelArgs), nullptr, 0); | ||
| 654 | + if (aclRet == ACL_ERROR_RT_INVALID_HANDLE) { | ||
| 655 | + aclError aclGetRet = aclrtBinaryGetFunction(g_binHandleMap[HcclCMDType::HCCL_CMD_INVALID], g_aivNameMap[stubFunc].c_str(), &funcHandle); | ||
| 656 | + CHK_PRT_RET(aclGetRet != ACL_SUCCESS, HCCL_ERROR("[RegisterBinaryKernel]errNo[0x%016llx] get function from binary error.", aclRet), | ||
| 657 | + HCCL_E_NOT_FOUND); | ||
| 658 | + aclRet = aclrtLaunchKernelWithHostArgs(funcHandle, aivKernelArgs.rankSize, stream, | ||
| 659 | + &cfg, &aivKernelArgs, sizeof(aivKernelArgs), nullptr, 0); | ||
| 660 | + } | ||
| 661 | + CHK_PRT_RET(aclRet != ACL_SUCCESS, HCCL_ERROR("[RegisterBinaryKernel]errNo[0x%016llx] aclrtLaunchKernelWithHostArgs error[%d].", | ||
| 662 | + HCCL_ERROR_CODE(HCCL_E_RUNTIME), aclRet), HCCL_E_RUNTIME); | ||
| 663 | + | ||
| 664 | + struct TaskParaGeneral taskParaGeneral; | ||
| 665 | + u8* flagAddr = static_cast<u8 *>(const_cast<void*>(aivKernelArgs.buffersOut[aivKernelArgs.rank])); | ||
| 666 | + TaskParaAiv taskParaAiv(HcclCMDType::HCCL_CMD_INVALID, step, 0, aivKernelArgs.rankSize, aivKernelArgs.rankSize, -1, flagAddr, aivKernelArgs.rank); | ||
| 667 | + taskParaGeneral.isMainStream = true; | ||
| 668 | + taskParaGeneral.stream = stream; | ||
| 669 | + taskParaGeneral.beginTime = beginTime; | ||
| 670 | + taskParaGeneral.aiv = taskParaAiv; | ||
| 671 | + | ||
| 672 | + AlgWrap::GetInstance().TaskAivProfiler(comm, taskParaGeneral); | ||
| 673 | + return HCCL_SUCCESS; | ||
| 674 | +} | ||
| 675 | + | ||
| 676 | +HcclResult ClearAivSyncBuf(void** cclBuffersOut, const AivResourceArgs &resourceArgs, const AivTopoArgs &topoArgs, AivAlgArgs algArgs) | ||
| 677 | +{ | ||
| 678 | + if (algArgs.argsType == KernelArgsType::ARGS_TYPE_SERVER && (topoArgs.devType != DevType::DEV_TYPE_910_93 || topoArgs.serverNum == 1)) { | ||
| 679 | + u32 rankSize = topoArgs.rankSize; | ||
| 680 | + rtStream_t stream = resourceArgs.stream; | ||
| 681 | + const std::string& comm = topoArgs.identify; | ||
| 682 | + u32 numBlocks = resourceArgs.numBlocks; | ||
| 683 | + s32 execTimeOut = algArgs.execTimeOut; | ||
| 684 | + bool execTimeOutSet = algArgs.execTimeOutSet; | ||
| 685 | + | ||
| 686 | + CHK_PRT_RET(numBlocks < rankSize, | ||
| 687 | + HCCL_ERROR("[ClearAivSyncBuf]aivCore[%u] is invalid, at least need [%u].", numBlocks, rankSize), HCCL_E_PARA); | ||
| 688 | + | ||
| 689 | + aclrtLaunchKernelCfg cfg; | ||
| 690 | + aclrtLaunchKernelAttr attr[AIV_ATTRNUM_THREE]; | ||
| 691 | + attr[0].id = ACL_RT_LAUNCH_KERNEL_ATTR_SCHEM_MODE; | ||
| 692 | + attr[0].value.schemMode = 1; | ||
| 693 | + attr[1].id = ACL_RT_LAUNCH_KERNEL_ATTR_TIMEOUT_US; | ||
| 694 | + attr[1].value.timeoutUs.timeoutLow = GetAivTimeout(execTimeOut, execTimeOutSet); | ||
| 695 | + attr[1].value.timeoutUs.timeoutHigh = 0; | ||
| 696 | + attr[2].id = ACL_RT_LAUNCH_KERNEL_ATTR_ENGINE_TYPE; | ||
| 697 | + attr[2].value.engineType = ACL_RT_ENGINE_TYPE_AIV; | ||
| 698 | + cfg.numAttrs = AIV_ATTRNUM_THREE; | ||
| 699 | + cfg.attrs = attr; | ||
| 700 | + | ||
| 701 | + AivKernelArgs aivKernelArgs { | ||
| 702 | + cclBuffersOut, cclBuffersOut, nullptr, nullptr, topoArgs.rank, rankSize, 0, | ||
| 703 | + HcclDataType::HCCL_DATA_TYPE_RESERVED, HcclReduceOp::HCCL_REDUCE_RESERVED, 0, 0, rankSize | ||
| 704 | + }; | ||
| 705 | + | ||
| 706 | + CHK_RET(LaunchSyncKernel(cfg, aivKernelArgs, stream, STEP_ONE, comm)); | ||
| 707 | + CHK_RET(LaunchSyncKernel(cfg, aivKernelArgs, stream, STEP_TWO, comm)); | ||
| 708 | + CHK_RET(LaunchSyncKernel(cfg, aivKernelArgs, stream, STEP_THREE, comm)); | ||
| 709 | + } | ||
| 710 | + HCCL_INFO("[AIV][ClearAivSyncBuf] clearaiv done."); | ||
| 711 | + return HCCL_SUCCESS; | ||
| 712 | +} | ||
| 713 | + | ||
| 714 | +HcclResult ClearAivSyncBufForMulServer(const AivResourceArgs &resourceArgs, const AivTopoArgs &topoArgs, void* args, | ||
| 715 | + u32 argsSize, AivAlgArgs algArgs) | ||
| 716 | +{ | ||
| 717 | + CHK_RET(BarrierForMulServer(resourceArgs, 1, topoArgs, args, argsSize, algArgs.execTimeOut, algArgs.execTimeOutSet)); | ||
| 718 | + | ||
| 719 | + u8* flagAddr = static_cast<u8 *>(resourceArgs.buffersOut[0]); | ||
| 720 | + DeviceMem zeroMem = DeviceMem::create(flagAddr + AIV_FLAG_AREA_SIZE, AIV_FLAG_AREA_SIZE); | ||
| 721 | + DeviceMem flagMem = DeviceMem::create(flagAddr, AIV_FLAG_AREA_SIZE); | ||
| 722 | + | ||
| 723 | + CHK_RET(hrtMemAsyncCopy(flagMem.ptr(), AIV_FLAG_AREA_SIZE, zeroMem.ptr(), AIV_FLAG_AREA_SIZE, | ||
| 724 | + HcclRtMemcpyKind::HCCL_RT_MEMCPY_KIND_DEVICE_TO_DEVICE, resourceArgs.stream)); | ||
| 725 | + | ||
| 726 | + CHK_RET(BarrierForMulServer(resourceArgs, RESET_TAIL_SYNC_TAG, topoArgs, args, argsSize, algArgs.execTimeOut, | ||
| 727 | + algArgs.execTimeOutSet)); | ||
| 728 | + | ||
| 729 | + HCCL_INFO("[AIV][ClearAivSyncBufForMulServer] clearaiv done"); | ||
| 730 | + return HCCL_SUCCESS; | ||
| 731 | +} | ||
| 732 | + | ||
| 575 | void TaskAivProfilerWrap(const AivOpArgs& opArgs, const AivTopoArgs& topoArgs, | 733 | void TaskAivProfilerWrap(const AivOpArgs& opArgs, const AivTopoArgs& topoArgs, |
| 576 | const AivResourceArgs& resourceArgs, const AivAlgArgs& algArgs, const AivProfilingInfo& aivProfilingInfo, | 734 | const AivResourceArgs& resourceArgs, const AivAlgArgs& algArgs, const AivProfilingInfo& aivProfilingInfo, |
| 577 | void* flagMem) | 735 | void* flagMem) |
| @@ -649,6 +807,13 @@ HcclResult ExecuteKernelLaunchInner(const AivOpArgs &opArgs, const AivTopoArgs & | |||
| 649 | 807 | ||
| 650 | TaskAivProfilerWrap(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo, | 808 | TaskAivProfilerWrap(opArgs, topoArgs, resourceArgs, algArgs, aivProfilingInfo, |
| 651 | (algArgs.argsType != KernelArgsType::ARGS_TYPE_SERVER) ? resourceArgs.buffersOut[0]: resourceArgs.buffersOut[topoArgs.rank]); | 809 | (algArgs.argsType != KernelArgsType::ARGS_TYPE_SERVER) ? resourceArgs.buffersOut[0]: resourceArgs.buffersOut[topoArgs.rank]); |
| 810 | + if (resourceArgs.aivTag == TAG_RESET_COUNT) { | ||
| 811 | + if (algArgs.isNpuDirectRoce) { | ||
| 812 | + CHK_RET(ClearAivSyncBufForMulServer(resourceArgs, topoArgs, args, argsSize, algArgs)); | ||
| 813 | + } else { | ||
| 814 | + CHK_RET(ClearAivSyncBuf(resourceArgs.buffersOut, resourceArgs, topoArgs, algArgs)); | ||
| 815 | + } | ||
| 816 | + } | ||
| 652 | 817 | ||
| 653 | CHK_PRT_RET(ret != HCCL_SUCCESS, HCCL_ERROR("[AIV][ExecuteKernelLaunchInner] errNo[0x%016llx] rtKernelLaunch aiv fail, " | 818 | CHK_PRT_RET(ret != HCCL_SUCCESS, HCCL_ERROR("[AIV][ExecuteKernelLaunchInner] errNo[0x%016llx] rtKernelLaunch aiv fail, " |
| 654 | "return[%d]", HCCL_ERROR_CODE(HCCL_E_RUNTIME), ret), HCCL_E_RUNTIME); | 819 | "return[%d]", HCCL_ERROR_CODE(HCCL_E_RUNTIME), ret), HCCL_E_RUNTIME); |
| @@ -33,6 +33,15 @@ HcclResult UnRegisterAivKernel() | |||
| 33 | return HCCL_SUCCESS; | 33 | return HCCL_SUCCESS; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | +HcclResult ClearAivSyncBuf(void** cclBuffersOut, const AivResourceArgs &resourceArgs, const AivTopoArgs &topoArgs, AivAlgArgs algArgs) | ||
| 37 | +{ | ||
| 38 | + (void) cclBuffersOut; | ||
| 39 | + (void) resourceArgs; | ||
| 40 | + (void) topoArgs; | ||
| 41 | + (void) algArgs; | ||
| 42 | + return HCCL_SUCCESS; | ||
| 43 | +} | ||
| 44 | + | ||
| 36 | // KernelLaunch内部接口 | 45 | // KernelLaunch内部接口 |
| 37 | HcclResult ExecuteKernelLaunchInner(const AivOpArgs &opArgs, const AivTopoArgs &topoArgs, | 46 | HcclResult ExecuteKernelLaunchInner(const AivOpArgs &opArgs, const AivTopoArgs &topoArgs, |
| 38 | const AivResourceArgs &resourceArgs, const AivAlgArgs &algArgs, void* args, u32 argsSize, | 47 | const AivResourceArgs &resourceArgs, const AivAlgArgs &algArgs, void* args, u32 argsSize, |
| @@ -317,7 +317,10 @@ HcclResult ExecuteKernelLaunchImpl(const AivOpArgs &opArgs, const AivTopoArgs &t | |||
| 317 | 317 | ||
| 318 | HcclResult RegisterKernel(DevType deviceType); | 318 | HcclResult RegisterKernel(DevType deviceType); |
| 319 | HcclResult UnRegisterAivKernel(); | 319 | HcclResult UnRegisterAivKernel(); |
| 320 | - | 320 | + |
| 321 | +HcclResult ClearAivSyncBuf(void** cclBuffersOut, const AivResourceArgs &resourceArgs, | ||
| 322 | + const AivTopoArgs &topoArgs, AivAlgArgs algArgs = AivAlgArgs{}); | ||
| 323 | + | ||
| 321 | HcclResult ClearAivSyncBufForMulServer(const AivResourceArgs &resourceArgs, const AivTopoArgs &topoArgs, void* args, | 324 | HcclResult ClearAivSyncBufForMulServer(const AivResourceArgs &resourceArgs, const AivTopoArgs &topoArgs, void* args, |
| 322 | u32 argsSize); | 325 | u32 argsSize); |
| 323 | 326 | ||
| @@ -4155,6 +4155,9 @@ namespace hccl | |||
| 4155 | CHK_RET(RegisterDfxInfo(opParam, algType, resMap_[newTag].slaveStreams, selectAivAlg)); | 4155 | CHK_RET(RegisterDfxInfo(opParam, algType, resMap_[newTag].slaveStreams, selectAivAlg)); |
| 4156 | // 头计数 | 4156 | // 头计数 |
| 4157 | CHK_RET(StarsCounter(dispatcher_, opParam.stream, HEAD, opParam.aicpuUnfoldMode, retryEnable_, selectAivAlg)); | 4157 | CHK_RET(StarsCounter(dispatcher_, opParam.stream, HEAD, opParam.aicpuUnfoldMode, retryEnable_, selectAivAlg)); |
| 4158 | + if (aivClearEnable_) { | ||
| 4159 | + CHK_RET(ClearAivSyncBuf(cacheInfo.buffersOut, cacheInfo.resourceArgs, cacheInfo.topoArgs, cacheInfo.algArgs)); | ||
| 4160 | + } | ||
| 4158 | u64 dataSize = (opParam.opType == HcclCMDType::HCCL_CMD_ALLTOALL ? | 4161 | u64 dataSize = (opParam.opType == HcclCMDType::HCCL_CMD_ALLTOALL ? |
| 4159 | opParam.All2AllDataDes.sendCount * SIZE_TABLE[opParam.All2AllDataDes.sendType] : 0); | 4162 | opParam.All2AllDataDes.sendCount * SIZE_TABLE[opParam.All2AllDataDes.sendType] : 0); |
| 4160 | if (opType == HcclCMDType::HCCL_CMD_REDUCE_SCATTER_V || opType == HcclCMDType::HCCL_CMD_ALLGATHER_V || | 4163 | if (opType == HcclCMDType::HCCL_CMD_REDUCE_SCATTER_V || opType == HcclCMDType::HCCL_CMD_ALLGATHER_V || |
| @@ -49,6 +49,7 @@ protected: | |||
| 49 | std::string caseName = "analysis_result_" + std::string(test_info->test_case_name()) + "_" + std::string(test_info->name()); | 49 | std::string caseName = "analysis_result_" + std::string(test_info->test_case_name()) + "_" + std::string(test_info->name()); |
| 50 | Checker::SetDumpFileName(caseName); | 50 | Checker::SetDumpFileName(caseName); |
| 51 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 51 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 52 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | virtual void TearDown() | 55 | virtual void TearDown() |
| @@ -53,6 +53,7 @@ protected: | |||
| 53 | std::string caseName = "analysis_result_" + std::string(test_info->test_case_name()) + "_" + std::string(test_info->name()); | 53 | std::string caseName = "analysis_result_" + std::string(test_info->test_case_name()) + "_" + std::string(test_info->name()); |
| 54 | Checker::SetDumpFileName(caseName); | 54 | Checker::SetDumpFileName(caseName); |
| 55 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 55 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 56 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | virtual void TearDown() | 59 | virtual void TearDown() |
| @@ -253,6 +254,7 @@ TEST_F(AllReduceTest, allreduce_allReduceComm_executor_test) | |||
| 253 | TEST_F(AllReduceTest, allreduce_executor_test_loop) | 254 | TEST_F(AllReduceTest, allreduce_executor_test_loop) |
| 254 | { | 255 | { |
| 255 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 256 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 257 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 256 | RankTable_For_LLT gen; | 258 | RankTable_For_LLT gen; |
| 257 | TopoMeta topoMeta; | 259 | TopoMeta topoMeta; |
| 258 | gen.GenTopoMeta(topoMeta, 1, 1, 8); | 260 | gen.GenTopoMeta(topoMeta, 1, 1, 8); |
| @@ -1303,6 +1305,7 @@ TEST_F(AllReduceTest, allreduce_mix_AllReduceMixExecutor_deter_comm) | |||
| 1303 | TEST_F(AllReduceTest, allreduce_aiv_a2_AllReduceMeshAivExecutor) | 1305 | TEST_F(AllReduceTest, allreduce_aiv_a2_AllReduceMeshAivExecutor) |
| 1304 | { | 1306 | { |
| 1305 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 1307 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 1308 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 1306 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 1309 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 1307 | RankTable_For_LLT gen; | 1310 | RankTable_For_LLT gen; |
| 1308 | TopoMeta topoMeta; | 1311 | TopoMeta topoMeta; |
| @@ -1328,6 +1331,7 @@ TEST_F(AllReduceTest, allreduce_aiv_a2_AllReduceMeshAivExecutor) | |||
| 1328 | TEST_F(AllReduceTest, allreduce_aiv_a3_graph_AllReduceMeshAivSmallCountExecutor) | 1331 | TEST_F(AllReduceTest, allreduce_aiv_a3_graph_AllReduceMeshAivSmallCountExecutor) |
| 1329 | { | 1332 | { |
| 1330 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 1333 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 1334 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 1331 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 1335 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 1332 | RankTable_For_LLT gen; | 1336 | RankTable_For_LLT gen; |
| 1333 | TopoMeta topoMeta; | 1337 | TopoMeta topoMeta; |
| @@ -1721,6 +1725,7 @@ TEST_F(AllReduceTest, allreduce_aiv_determinstic_small_test) | |||
| 1721 | setenv("HCCL_DETERMINISTIC", "true", 1); | 1725 | setenv("HCCL_DETERMINISTIC", "true", 1); |
| 1722 | setenv("HCCL_OP_EXPANSION_MODE", "AIV", 1); | 1726 | setenv("HCCL_OP_EXPANSION_MODE", "AIV", 1); |
| 1723 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 1727 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 1728 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 1724 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 1729 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 1725 | 1730 | ||
| 1726 | CheckerOpParam checkerOpParam; | 1731 | CheckerOpParam checkerOpParam; |
| @@ -1749,6 +1754,7 @@ TEST_F(AllReduceTest, allreduce_aiv_determinstic_test) | |||
| 1749 | setenv("HCCL_DETERMINISTIC", "true", 1); | 1754 | setenv("HCCL_DETERMINISTIC", "true", 1); |
| 1750 | setenv("HCCL_OP_EXPANSION_MODE", "AIV", 1); | 1755 | setenv("HCCL_OP_EXPANSION_MODE", "AIV", 1); |
| 1751 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 1756 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 1757 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 1752 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 1758 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 1753 | 1759 | ||
| 1754 | CheckerOpParam checkerOpParam; | 1760 | CheckerOpParam checkerOpParam; |
| @@ -1777,6 +1783,7 @@ TEST_F(AllReduceTest, allreduce_aiv_determinstic_mid_test) | |||
| 1777 | setenv("HCCL_DETERMINISTIC", "true", 1); | 1783 | setenv("HCCL_DETERMINISTIC", "true", 1); |
| 1778 | setenv("HCCL_OP_EXPANSION_MODE", "AIV", 1); | 1784 | setenv("HCCL_OP_EXPANSION_MODE", "AIV", 1); |
| 1779 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 1785 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 1786 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 1780 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 1787 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 1781 | 1788 | ||
| 1782 | CheckerOpParam checkerOpParam; | 1789 | CheckerOpParam checkerOpParam; |
| @@ -574,6 +574,7 @@ TEST_F(AllToAllTest, alltoall_test_91093_opbase_AlltoAllMeshAivExecutor) | |||
| 574 | { | 574 | { |
| 575 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 575 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 576 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 576 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 577 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 577 | RankTable_For_LLT gen; | 578 | RankTable_For_LLT gen; |
| 578 | TopoMeta topoMeta; | 579 | TopoMeta topoMeta; |
| 579 | gen.GenTopoMeta(topoMeta, 1, 1, 16); | 580 | gen.GenTopoMeta(topoMeta, 1, 1, 16); |
| @@ -603,6 +604,7 @@ TEST_F(AllToAllTest, alltoall_test_a2_opbase_AlltoAllStagedAIVRdmaExecutor) | |||
| 603 | { | 604 | { |
| 604 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 605 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 605 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 606 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 607 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 606 | RankTable_For_LLT gen; | 608 | RankTable_For_LLT gen; |
| 607 | TopoMeta topoMeta; | 609 | TopoMeta topoMeta; |
| 608 | gen.GenTopoMeta(topoMeta, 1, 2, 8); | 610 | gen.GenTopoMeta(topoMeta, 1, 2, 8); |
| @@ -631,6 +633,7 @@ TEST_F(AllToAllTest, alltoall_test_91093_graph_AlltoAllMeshAivExecutor) | |||
| 631 | { | 633 | { |
| 632 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 634 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 633 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 635 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 636 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 634 | RankTable_For_LLT gen; | 637 | RankTable_For_LLT gen; |
| 635 | TopoMeta topoMeta; | 638 | TopoMeta topoMeta; |
| 636 | gen.GenTopoMeta(topoMeta, 1, 1, 16); | 639 | gen.GenTopoMeta(topoMeta, 1, 1, 16); |
| @@ -662,6 +665,7 @@ TEST_F(AllToAllTest, alltoall_test_91093_opbase_AlltoAllMeshAivFor91093Executor) | |||
| 662 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); | 665 | MOCKER(GetExternalInputHcclAivMode).stubs().will(returnValue(true)); |
| 663 | MOCKER_CPP(&AlltoAllOperator::IsSatisfyAlltoAllAivCondition).stubs().will(returnValue(true)); | 666 | MOCKER_CPP(&AlltoAllOperator::IsSatisfyAlltoAllAivCondition).stubs().will(returnValue(true)); |
| 664 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 667 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 668 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 665 | RankTable_For_LLT gen; | 669 | RankTable_For_LLT gen; |
| 666 | TopoMeta topoMeta; | 670 | TopoMeta topoMeta; |
| 667 | gen.GenTopoMeta(topoMeta, 1, 2, 16); | 671 | gen.GenTopoMeta(topoMeta, 1, 2, 16); |
| @@ -49,6 +49,7 @@ protected: | |||
| 49 | std::string caseName = "analysis_result_" + std::string(test_info->test_case_name()) + "_" + std::string(test_info->name()); | 49 | std::string caseName = "analysis_result_" + std::string(test_info->test_case_name()) + "_" + std::string(test_info->name()); |
| 50 | Checker::SetDumpFileName(caseName); | 50 | Checker::SetDumpFileName(caseName); |
| 51 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); | 51 | MOCKER(ExecuteKernelLaunch).stubs().will(returnValue(HCCL_SUCCESS)); |
| 52 | + MOCKER(ClearAivSyncBuf).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | virtual void TearDown() | 55 | virtual void TearDown() |
| @@ -210,6 +210,8 @@ static std::vector<AivKernelInfo> g_aivKernelInfoList = { | |||
| 210 | {"aiv_broadcast_int8_t", HcclCMDType::HCCL_CMD_BROADCAST, HcclDataType::HCCL_DATA_TYPE_INT8}, | 210 | {"aiv_broadcast_int8_t", HcclCMDType::HCCL_CMD_BROADCAST, HcclDataType::HCCL_DATA_TYPE_INT8}, |
| 211 | {"aiv_broadcast_uint8_t", HcclCMDType::HCCL_CMD_BROADCAST, HcclDataType::HCCL_DATA_TYPE_UINT8}, | 211 | {"aiv_broadcast_uint8_t", HcclCMDType::HCCL_CMD_BROADCAST, HcclDataType::HCCL_DATA_TYPE_UINT8}, |
| 212 | {"aiv_broadcast_bfloat16_t", HcclCMDType::HCCL_CMD_BROADCAST, HcclDataType::HCCL_DATA_TYPE_BFP16}, | 212 | {"aiv_broadcast_bfloat16_t", HcclCMDType::HCCL_CMD_BROADCAST, HcclDataType::HCCL_DATA_TYPE_BFP16}, |
| 213 | + // 同步 | ||
| 214 | + {"hccl_aiv_sync", HcclCMDType::HCCL_CMD_INVALID, HcclDataType::HCCL_DATA_TYPE_RESERVED}, | ||
| 213 | }; | 215 | }; |
| 214 | 216 | ||
| 215 | extern "C" { | 217 | extern "C" { |
| @@ -252,6 +254,7 @@ extern "C" { | |||
| 252 | extern void aiv_broadcast_int8_t(KERNEL_ARGS_DEF); | 254 | extern void aiv_broadcast_int8_t(KERNEL_ARGS_DEF); |
| 253 | extern void aiv_broadcast_uint8_t(KERNEL_ARGS_DEF); | 255 | extern void aiv_broadcast_uint8_t(KERNEL_ARGS_DEF); |
| 254 | extern void aiv_broadcast_bfloat16_t(KERNEL_ARGS_DEF); | 256 | extern void aiv_broadcast_bfloat16_t(KERNEL_ARGS_DEF); |
| 257 | + extern void hccl_aiv_sync(KERNEL_ARGS_DEF); | ||
| 255 | extern void aiv_all_to_all_half(EXTERN_KERNEL_ARGS_DEF); | 258 | extern void aiv_all_to_all_half(EXTERN_KERNEL_ARGS_DEF); |
| 256 | extern void aiv_all_to_all_int16_t(EXTERN_KERNEL_ARGS_DEF); | 259 | extern void aiv_all_to_all_int16_t(EXTERN_KERNEL_ARGS_DEF); |
| 257 | extern void aiv_all_to_all_uint16_t(EXTERN_KERNEL_ARGS_DEF); | 260 | extern void aiv_all_to_all_uint16_t(EXTERN_KERNEL_ARGS_DEF); |
| @@ -369,6 +372,7 @@ std::unordered_map<const char*, aivFunc> aivFuncMap = { | |||
| 369 | {"aiv_broadcast_int8_t", aiv_broadcast_int8_t}, | 372 | {"aiv_broadcast_int8_t", aiv_broadcast_int8_t}, |
| 370 | {"aiv_broadcast_uint8_t", aiv_broadcast_uint8_t}, | 373 | {"aiv_broadcast_uint8_t", aiv_broadcast_uint8_t}, |
| 371 | {"aiv_broadcast_bfloat16_t", aiv_broadcast_bfloat16_t}, | 374 | {"aiv_broadcast_bfloat16_t", aiv_broadcast_bfloat16_t}, |
| 375 | + {"hccl_aiv_sync", hccl_aiv_sync}, | ||
| 372 | }; | 376 | }; |
| 373 | 377 | ||
| 374 | std::unordered_map<const char*, aivFuncExtra> aivFuncExtraMap = { | 378 | std::unordered_map<const char*, aivFuncExtra> aivFuncExtraMap = { |
| @@ -695,4 +699,9 @@ void TaskAivProfilerWrap(const AivOpArgs& opArgs, const AivTopoArgs& topoArgs, | |||
| 695 | { | 699 | { |
| 696 | } | 700 | } |
| 697 | 701 | ||
| 702 | +HcclResult ClearAivSyncBuf(void** cclBuffersOut, const AivResourceArgs &resourceArgs, const AivTopoArgs &topoArgs, AivAlgArgs algArgs) | ||
| 703 | +{ | ||
| 704 | + return HCCL_SUCCESS; | ||
| 705 | +} | ||
| 706 | + | ||
| 698 | } | 707 | } |
| @@ -385,6 +385,45 @@ TEST_F(HcclImplTest, ut_SelectAlg_when_broadcast_910C_Expect_ReturnIs_BroadcastM | |||
| 385 | std::unique_ptr<BroadCastOperator> operation(new (std::nothrow) BroadCastOperator(algConfigurator.get(), cclBufferManager, dispatcher, topoMatcher)); | 385 | std::unique_ptr<BroadCastOperator> operation(new (std::nothrow) BroadCastOperator(algConfigurator.get(), cclBufferManager, dispatcher, topoMatcher)); |
| 386 | ret = operation->SelectAlg("", opParam, algName, newTag); | 386 | ret = operation->SelectAlg("", opParam, algName, newTag); |
| 387 | EXPECT_TRUE(algName == "BroadcastMeshAivExecutor"); | 387 | EXPECT_TRUE(algName == "BroadcastMeshAivExecutor"); |
| 388 | + | ||
| 389 | + MOCKER_CPP(&HcclCommunicator::HandleAclGraphFirstOpAivBuff) | ||
| 390 | + .stubs() | ||
| 391 | + .with(any()) | ||
| 392 | + .will(returnValue(HCCL_SUCCESS)); | ||
| 393 | + MOCKER_CPP(&HcclCommunicator::RegisterDfxInfo) | ||
| 394 | + .stubs() | ||
| 395 | + .with(any()) | ||
| 396 | + .will(returnValue(HCCL_SUCCESS)); | ||
| 397 | + MOCKER(StarsCounter).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 398 | + AivOpArgs opArgs{HcclCMDType::HCCL_CMD_BROADCAST, | ||
| 399 | + opParam.inputPtr, | ||
| 400 | + opParam.outputPtr, | ||
| 401 | + opParam.DataDes.count, | ||
| 402 | + opParam.DataDes.dataType, | ||
| 403 | + opParam.reduceType, | ||
| 404 | + opParam.root, | ||
| 405 | + 0}; | ||
| 406 | + AivTopoArgs topoArgs{0, 2}; | ||
| 407 | + topoArgs.identify = "test"; | ||
| 408 | + opParam.aivTag = 1; | ||
| 409 | + AivResourceArgs resourceArgs { | ||
| 410 | + opParam.tag, opParam.stream.ptr(), nullptr, nullptr, 4096, 1, opParam.aivTag | ||
| 411 | + }; | ||
| 412 | + AivAlgArgs algArgs{}; | ||
| 413 | + algArgs.execTimeOut = 1; | ||
| 414 | + algArgs.execTimeOutSet = true; | ||
| 415 | + struct AivProfilingInfo aivProfilingInfo; | ||
| 416 | + ExtraArgs extraArgs; | ||
| 417 | + HcclCacheInfo cacheInfo; | ||
| 418 | + cacheInfo.opArgs = opArgs; | ||
| 419 | + cacheInfo.topoArgs = topoArgs; | ||
| 420 | + cacheInfo.resourceArgs = resourceArgs; | ||
| 421 | + cacheInfo.algArgs = algArgs; | ||
| 422 | + cacheInfo.profilingInfo = aivProfilingInfo; | ||
| 423 | + cacheInfo.extraArgs = extraArgs; | ||
| 424 | + cacheInfo.isUseCache = true; | ||
| 425 | + implBase->SetClearAivSyncBuf(true); | ||
| 426 | + implBase->ExecOpCache(HcclCMDType::HCCL_CMD_BROADCAST, opParam, cacheInfo); | ||
| 388 | operation = nullptr; | 427 | operation = nullptr; |
| 389 | GlobalMockObject::verify(); | 428 | GlobalMockObject::verify(); |
| 390 | } | 429 | } |