LCOV - code coverage report
Current view: top level - legacy/ascend910/algorithm/impl/coll_executor/coll_reduce_scatter - coll_reduce_scatter_ars_for_910_93_executor.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 47 0
Test Date: 2026-08-18 17:47:01 Functions: 0.0 % 6 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_reduce_scatter_ars_for_910_93_executor.h"
      12              : 
      13              : namespace hccl {
      14            0 : CollReduceScatterARSFor91093Executor::CollReduceScatterARSFor91093Executor(
      15            0 :     const HcclDispatcher dispatcher, std::unique_ptr<TopoMatcher>& topoMatcher)
      16            0 :     : CollReduceScatterRingFor91093Executor(dispatcher, topoMatcher)
      17              : {
      18            0 :     DMAReduceFlag_ = false;
      19            0 : }
      20              : 
      21            0 : HcclResult CollReduceScatterARSFor91093Executor::CalcStreamNum(u32& streamNum)
      22              : {
      23            0 :     u32 totalStreamNum = LEVEL0_PLANE_NUM_IN_NPRING_SINGLE;
      24            0 :     if ((intraRingSize_ > FACTOR_TWO) && topoAttr_.isARSDoubleRing) {
      25            0 :         totalStreamNum = LEVEL0_PLANE_NUM_IN_NPRING_DOUBLE;
      26              :     }
      27            0 :     streamNum = totalStreamNum - 1;
      28            0 :     HCCL_INFO("[CalcStreamNum] tag[%s] streamNum[%u]", tag_.c_str(), streamNum);
      29            0 :     return HCCL_SUCCESS;
      30              : }
      31              : 
      32            0 : HcclResult CollReduceScatterARSFor91093Executor::CalcLevel0CommInfo(
      33              :     TransportMemType inputType, TransportMemType outputType, std::vector<LevelNSubCommTransport>& opTransport)
      34              : {
      35            0 :     CHK_RET(SetCommInfoForARS(intraRingSize_));
      36            0 :     CommParaInfo commParaLevel0(COMM_LEVEL0, CommType::COMM_TAG_RING_INNER);
      37            0 :     CHK_RET(CalcCommPlaneInfo(tag_, commParaLevel0, opTransport[COMM_LEVEL0], inputType, outputType));
      38            0 :     CommParaInfo commARSIntra(COMM_LEVEL0_LOGICAL, CommType::COMM_TAG_RING_INNER);
      39            0 :     CHK_RET(CalcCommPlaneInfo(tag_, commARSIntra, opTransport[COMM_LEVEL0_LOGICAL], inputType, outputType));
      40            0 :     return HCCL_SUCCESS;
      41            0 : }
      42              : 
      43            0 : HcclResult CollReduceScatterARSFor91093Executor::CalcLevel1CommInfo(
      44              :     TransportMemType inputType, TransportMemType outputType, std::vector<LevelNSubCommTransport>& opTransport)
      45              : {
      46            0 :     if (algType_.algoLevel1 == AlgTypeLevel1::ALG_LEVEL1_RING) {
      47            0 :         HCCL_DEBUG("[CalcARSInterCommInfo] use ring comm type");
      48            0 :         CommParaInfo commARSInter(COMM_LEVEL1_LOGICAL, CommType::COMM_TAG_RING_INNER);
      49            0 :         CHK_RET(CalcCommPlaneInfo(tag_, commARSInter, opTransport[COMM_LEVEL1_LOGICAL], inputType, outputType));
      50            0 :     } else if (algType_.algoLevel1 == AlgTypeLevel1::ALG_LEVEL1_NB) {
      51            0 :         HCCL_DEBUG("[CalcARSInterCommInfo] use NB comm type");
      52            0 :         CommParaInfo commARSInter(COMM_LEVEL1_LOGICAL, CommType::COMM_TAG_NONUNIFORM_BRUCK);
      53            0 :         CHK_RET(CalcCommPlaneInfo(tag_, commARSInter, opTransport[COMM_LEVEL1_LOGICAL], inputType, outputType));
      54            0 :     } else {
      55            0 :         HCCL_DEBUG("[CalcARSInterCommInfo] use NHR comm type");
      56            0 :         CommParaInfo commARSInter(COMM_LEVEL1_LOGICAL, CommType::COMM_TAG_NONUNIFORM_HIERARCHICAL_RING);
      57            0 :         CHK_RET(CalcCommPlaneInfo(tag_, commARSInter, opTransport[COMM_LEVEL1_LOGICAL], inputType, outputType));
      58            0 :     }
      59            0 :     return HCCL_SUCCESS;
      60              : }
      61              : 
      62            0 : HcclResult CollReduceScatterARSFor91093Executor::GetLevelCommInfo()
      63              : {
      64            0 :     logicalLevel0plane_ = COMM_LEVEL0_LOGICAL;
      65            0 :     CHK_RET(CheckCommSize(logicalLevel0plane_, COMM_INDEX_0 + 1));
      66            0 :     logicalLevel0CommInfo_ = GetSubCommInfo(logicalLevel0plane_, COMM_INDEX_0);
      67            0 :     logicalLevel1plane_ = COMM_LEVEL1_LOGICAL;
      68            0 :     CHK_RET(CheckCommSize(logicalLevel1plane_, logicalLevel0CommInfo_.localRank + 1));
      69            0 :     logicalLevel1CommInfo_ = GetSubCommInfo(logicalLevel1plane_, logicalLevel0CommInfo_.localRank);
      70            0 :     return HCCL_SUCCESS;
      71              : }
      72              : 
      73            0 : HcclResult CollReduceScatterARSFor91093Executor::CalcOptimalIntraRing(const OpParam& param)
      74              : {
      75              :     intraRingSize_
      76            0 :         = CalcOptimalIntraRingsize(param.DataDes.count, param.DataDes.dataType, HcclCMDType::HCCL_CMD_REDUCE_SCATTER);
      77            0 :     HCCL_INFO("intraRingSize_[%u]", intraRingSize_);
      78            0 :     return HCCL_SUCCESS;
      79              : }
      80              : REGISTER_EXEC("ReduceScatterARSFor91093Executor", ReduceScatterARSFor91093, CollReduceScatterARSFor91093Executor);
      81              : } // namespace hccl
        

Generated by: LCOV version 2.0-1