LCOV - code coverage report
Current view: top level - legacy/ascend910/algorithm/base/alg_template/temp_reduce_scatter - reduce_scatter_ahc_broke.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 34 0
Test Date: 2026-07-28 12:11:00 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 "reduce_scatter_ahc_broke.h"
      12              : #include "alg_template_register.h"
      13              :  
      14              : namespace hccl {
      15              :  
      16            0 : ReduceScatterAHCBroke::ReduceScatterAHCBroke(const HcclDispatcher dispatcher)
      17            0 :     : ReduceScatterAHCBase(dispatcher)
      18              : {
      19            0 : }
      20              :  
      21            0 : ReduceScatterAHCBroke::~ReduceScatterAHCBroke()
      22              : {
      23            0 : }
      24              :  
      25            0 : HcclResult ReduceScatterAHCBroke::DisposeSubGroups(const u32 rank)
      26              : {
      27            0 :     CommAHCBaseInfo::DisposeSubGroups(rank, globalSubGroups_, level0SubGroups_, level1SubGroups_);
      28            0 :     return HCCL_SUCCESS;
      29              : }
      30              :  
      31            0 : HcclResult ReduceScatterAHCBroke::CommAHCInfoInit()
      32              : {
      33            0 :     commAHCBaseInfo_.reset(new (std::nothrow) CommBrokeAlignInfo(level0SubGroups_));
      34            0 :     CHK_SMART_PTR_NULL(commAHCBaseInfo_);
      35            0 :     CHK_RET(commAHCBaseInfo_->Init(AHCOpType::AHC_OP_TYPE_REDUCE_SCATTER, ahcAlgOption_));
      36            0 :     return HCCL_SUCCESS;
      37              : }
      38              :  
      39            0 : HcclResult ReduceScatterAHCBroke::RunInterReduceScatter(const u32 rank, const std::vector<LINK> &links,
      40              :     const std::unique_ptr<CommAHCBaseInfo> &commAHCBaseInfo)
      41              : {
      42              :     // 获取当前rank的组间rank
      43            0 :     HCCL_INFO("[ReduceScatterAHCBroke][RunInterReduceScatter] begin inter ReduceScatter rank[%u]", rank);
      44              :   
      45              :     // 创建执行算子实列
      46            0 :     std::unique_ptr<AlgTemplateBase> tempAlg;
      47            0 :     commAHCBaseInfo->GetInterAlgTemplateOpInstance(AHCOpType::AHC_OP_TYPE_REDUCE_SCATTER, tempAlg, dispatcher_, reduceAttr_,
      48            0 :         extendFlag_, ahcExtendPreparePara_);
      49              :  
      50            0 :     std::vector<std::vector<Slice>> interSlicesVector;
      51            0 :     std::vector<std::vector<LINK>> interLinksVector;
      52            0 :     std::vector<u32>                interRankList;
      53            0 :     CHK_RET(commAHCBaseInfo->CalcInterSlicesAndLinks(rank, DataUnitSize(dataType_), count_, links, interLinksVector, interSlicesVector, interRankList));
      54              :  
      55            0 :     HCCL_DEBUG("[ReduceScatterAHCBroke][RunInterReduceScatter] run inst rank[%u]",
      56              :         rank);
      57              :  
      58            0 :     for (u32 i = 0; i < interLinksVector.size(); i++) {
      59            0 :         std::vector<Slice> interSlices = interSlicesVector[i];
      60            0 :         std::vector<LINK> interLinks = interLinksVector[i];
      61            0 :         if (interLinks.size() <= 1) {
      62            0 :             continue;
      63              :         }
      64            0 :         HCCL_DEBUG("[ReduceScatterAHCBroke][AHCDEBUG] rank[%u] group[%u] interRank[%u]", rank, i, interRankList[i]);
      65            0 :         CHK_RET(RunInstance(interRankList[i], interLinks, interSlices, tempAlg, AHCOpType::AHC_OP_TYPE_REDUCE_SCATTER));
      66            0 :     }
      67              :  
      68            0 :     HCCL_DEBUG("[ReduceScatterAHCBroke][RunInterReduceScatter] end inter ReduceScatter rank[%u]", rank);
      69              :  
      70            0 :     return HCCL_SUCCESS;
      71            0 : }
      72              : REGISTER_TEMPLATE(TemplateType::TEMPLATE_REDUCESCATTER_AHC_BROKE, ReduceScatterAHCBroke);
      73              : }
        

Generated by: LCOV version 2.0-1