LCOV - code coverage report
Current view: top level - legacy/ascend950/service/collective/alg/coll_alg_factory/alg_template/prim_alg_template - temp_reduce_scatter_concurr_mesh.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 2 0
Test Date: 2026-07-28 12:11:00 Functions: 0.0 % 1 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              : #ifndef HCCLV2_TEMP_REDUCE_SCATTER_CONCURR_MESH
      12              : #define HCCLV2_TEMP_REDUCE_SCATTER_CONCURR_MESH
      13              : 
      14              : #include "string_util.h"
      15              : 
      16              : #include "alg_template_base_v2.h"
      17              : 
      18              : namespace Hccl {
      19              : 
      20              : class TempReduceScatterConcurrMesh : public AlgTemplateBase {
      21              : public:
      22              :     explicit TempReduceScatterConcurrMesh(const RankId virtualRank, const u32 tempRankSize,
      23              :                                           const std::vector<std::vector<RankId>> &tempVTopo,
      24              :                                           const std::map<RankId, u32>            &tempVirtRankMap);
      25              :     ~TempReduceScatterConcurrMesh() override;
      26              : 
      27            0 :     std::string Describe() const override
      28              :     {
      29              :         return StringFormat("Template of reduce scatter multi-dimensional concurrent mesh with tempRankSize [%u].",
      30            0 :                             tempRankSize_);
      31              :     }
      32              : 
      33              :     HcclResult GenPrimQue(const TempFuncs &tempFuncs, const RankSliceInfo &sliceInfoVec, const BuffInfo &buffInfo,
      34              :                           const ResLinks &tempLinks, std::vector<PrimQuePtr> &tempPrimQues) override;
      35              :     using AlgTemplateBase::CalcSliceInfo;
      36              :     HcclResult CalcSliceInfo(const AllignInfo &allignInfo, const bool forAllReduce, const u64 dataSize,
      37              :                              RankSliceInfo &sliceInfoVec) override;
      38              :     using AlgTemplateBase::CalcRes;
      39              :     HcclResult CalcRes(const bool forAllReduce, AlgTempResReq &tempResReq, u32 &requiredScratchMultiplier) override;
      40              : 
      41              : private:
      42              :     HcclResult CalcSliceInfoAllReduce(const AllignInfo &allignInfo, const u64 dataSize, RankSliceInfo &sliceInfoVec);
      43              : 
      44              :     HcclResult PostCopyOffload(const RankSliceInfo &sliceInfoVec, std::vector<PrimQuePtr> &tempPrimQues);
      45              : 
      46              :     HcclResult RunOneDimMesh(const RankSliceInfo &sliceInfoVec, const ResLinks &tempLinks,
      47              :                              std::vector<PrimQuePtr> &tempPrimQues);
      48              :     HcclResult RunMesh(const u32 myAlgRank, const std::vector<RankId> &vTopo, const RankSliceInfo &sliceInfoVec,
      49              :                        const ResLinks &tempLinks, std::vector<PrimQuePtr> &tempPrimQues);
      50              :     HcclResult RunConcurrMesh(const RankSliceInfo &sliceInfoVec, const ResLinks &tempLinks,
      51              :                               std::vector<PrimQuePtr> &tempPrimQues);
      52              :     HcclResult RunSingleDimension(const u32 &step, const u32 &dim, const RankSliceInfo &sliceInfoVec,
      53              :                                   const ResLinks &tempLinks, std::vector<PrimQuePtr> &dimPrimQues);
      54              : 
      55              :     std::unique_ptr<PrimSendReduce> RunSendReduce(const RankSliceInfo    &sliceInfoVec,
      56              :                                                   const std::vector<u32> &sendChunkIdxs, const u32 &sliceIdx,
      57              :                                                   const RankId &neighborRank, const LinkData &priorLinkData);
      58              :     std::unique_ptr<PrimRecvReduce> RunRecvReduce(const RankSliceInfo    &sliceInfoVec,
      59              :                                                   const std::vector<u32> &recvChunkIdxs, const u32 &sliceIdx,
      60              :                                                   const RankId &neighborRank, const LinkData &priorLinkData);
      61              : };
      62              : 
      63              : } // namespace Hccl
      64              : 
      65              : #endif // !HCCLV2_TEMP_REDUCE_SCATTER_CONCURR_MESH
        

Generated by: LCOV version 2.0-1