LCOV - code coverage report
Current view: top level - legacy/ascend910/algorithm/impl/coll_executor/coll_reduce_scatter_v - coll_aligned_reduce_scatter_v_double_ring_for_910_93_executor.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 26 0
Test Date: 2026-08-18 17:47:01 Functions: 0.0 % 4 0

            Line data    Source code
       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              : #include "coll_aligned_reduce_scatter_v_double_ring_for_910_93_executor.h"
      12              : #include <numeric>
      13              : 
      14              : namespace hccl {
      15              : 
      16            0 : CollAlignedReduceScatterVDoubleRingFor91093Executor::CollAlignedReduceScatterVDoubleRingFor91093Executor(
      17            0 :     const HcclDispatcher dispatcher, std::unique_ptr<TopoMatcher>& topoMatcher)
      18            0 :     : CollAlignedReduceScatterDoubleRingFor91093Executor(dispatcher, topoMatcher)
      19              : {
      20            0 :     isReduceScatterV_ = true;
      21              :     desc_.level1SupportedAlgos
      22            0 :         = {AlgTypeLevel1::ALG_LEVEL1_NHR, AlgTypeLevel1::ALG_LEVEL1_NB, AlgTypeLevel1::ALG_LEVEL1_RING};
      23            0 : }
      24              : 
      25            0 : bool CollAlignedReduceScatterVDoubleRingFor91093Executor::IsUnifiedMarch(const OpParam& param) const
      26              : {
      27              :     (void)param;
      28            0 :     return false;
      29              : }
      30              : 
      31            0 : u64 CollAlignedReduceScatterVDoubleRingFor91093Executor::CalcLoopMaxCount(const u32 unitSize)
      32              : {
      33              :     // 中转内存单次最多能够接受的output count,这里不除以RankSize,因为每次循环可能会减少需要参与通信的Rank
      34            0 :     return inCCLbufferSize_ / HCCL_MIN_SLICE_ALIGN * HCCL_MIN_SLICE_ALIGN / unitSize;
      35              : }
      36              : 
      37            0 : bool CollAlignedReduceScatterVDoubleRingFor91093Executor::IsHugeData(const u64 curSize, OpParam* param)
      38              : {
      39              :     u32 level2RankSize;
      40            0 :     if (algType_.algoLevel1 == AlgTypeLevel1::ALG_LEVEL1_AHC
      41            0 :         || algType_.algoLevel1 == AlgTypeLevel1::ALG_LEVEL1_AHC_BROKE) {
      42              :         // AHC非对称场景下没有L2
      43            0 :         level2RankSize = 1;
      44              :     } else {
      45              :         // 多QP哈希散列开启且RDMA通信下,强制刷新子图
      46              :         // 这里如果CheckCommSize返回ERROR,相当于HugeData true,防止GetSubCommInfo越界
      47            0 :         CHK_RET(CheckCommSize(COMM_LEVEL2, COMM_INDEX_0 + 1));
      48            0 :         SubCommInfo level2CommInfo = GetSubCommInfo(COMM_LEVEL2, COMM_INDEX_0);
      49            0 :         level2RankSize = level2CommInfo.localRankSize;
      50            0 :     }
      51              : 
      52            0 :     const HcclDataType dataType = param->GetDataType();
      53            0 :     const u64 TBE_REDUCE_MAX_COUNT = INT32_MAX;
      54            0 :     u64 curCount = curSize / SIZE_TABLE[dataType];
      55            0 :     bool issupportRDMAInlineReduce = IsSupportRDMAReduce(dataType, param->reduceType);
      56            0 :     bool hugeData = (curSize * level2RankSize > RDMA_SEND_MAX_SIZE) || (curSize > SDMA_SEND_MAX_SIZE)
      57            0 :                     || ((!isSupportSDMAReduce_) && (curCount > TBE_REDUCE_MAX_COUNT))
      58            0 :                     || ((!issupportRDMAInlineReduce) && (curCount * level2RankSize > TBE_REDUCE_MAX_COUNT));
      59            0 :     return hugeData;
      60              : }
      61              : 
      62              : REGISTER_EXEC(
      63              :     "AlignedReduceScatterVDoubleRingFor91093Executor", AlignedReduceScatterVDoubleRingFor91093,
      64              :     CollAlignedReduceScatterVDoubleRingFor91093Executor);
      65              : } // namespace hccl
        

Generated by: LCOV version 2.0-1