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-08-18 17:47:01 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(
      23              :         const RankId virtualRank, const u32 tempRankSize, 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(
      30            0 :             "Template of reduce scatter multi-dimensional concurrent mesh with tempRankSize [%u].", tempRankSize_);
      31              :     }
      32              : 
      33              :     HcclResult GenPrimQue(
      34              :         const TempFuncs& tempFuncs, const RankSliceInfo& sliceInfoVec, const BuffInfo& buffInfo,
      35              :         const ResLinks& tempLinks, std::vector<PrimQuePtr>& tempPrimQues) override;
      36              :     using AlgTemplateBase::CalcSliceInfo;
      37              :     HcclResult CalcSliceInfo(
      38              :         const AllignInfo& allignInfo, const bool forAllReduce, const u64 dataSize,
      39              :         RankSliceInfo& sliceInfoVec) override;
      40              :     using AlgTemplateBase::CalcRes;
      41              :     HcclResult CalcRes(const bool forAllReduce, AlgTempResReq& tempResReq, u32& requiredScratchMultiplier) override;
      42              : 
      43              : private:
      44              :     HcclResult CalcSliceInfoAllReduce(const AllignInfo& allignInfo, const u64 dataSize, RankSliceInfo& sliceInfoVec);
      45              : 
      46              :     HcclResult PostCopyOffload(const RankSliceInfo& sliceInfoVec, std::vector<PrimQuePtr>& tempPrimQues);
      47              : 
      48              :     HcclResult
      49              :     RunOneDimMesh(const RankSliceInfo& sliceInfoVec, const ResLinks& tempLinks, std::vector<PrimQuePtr>& tempPrimQues);
      50              :     HcclResult RunMesh(
      51              :         const u32 myAlgRank, const std::vector<RankId>& vTopo, const RankSliceInfo& sliceInfoVec,
      52              :         const ResLinks& tempLinks, std::vector<PrimQuePtr>& tempPrimQues);
      53              :     HcclResult
      54              :     RunConcurrMesh(const RankSliceInfo& sliceInfoVec, const ResLinks& tempLinks, std::vector<PrimQuePtr>& tempPrimQues);
      55              :     HcclResult RunSingleDimension(
      56              :         const u32& step, const u32& dim, const RankSliceInfo& sliceInfoVec, const ResLinks& tempLinks,
      57              :         std::vector<PrimQuePtr>& dimPrimQues);
      58              : 
      59              :     std::unique_ptr<PrimSendReduce> RunSendReduce(
      60              :         const RankSliceInfo& sliceInfoVec, const std::vector<u32>& sendChunkIdxs, const u32& sliceIdx,
      61              :         const RankId& neighborRank, const LinkData& priorLinkData);
      62              :     std::unique_ptr<PrimRecvReduce> RunRecvReduce(
      63              :         const RankSliceInfo& sliceInfoVec, const std::vector<u32>& recvChunkIdxs, const u32& sliceIdx,
      64              :         const RankId& neighborRank, const LinkData& priorLinkData);
      65              : };
      66              : 
      67              : } // namespace Hccl
      68              : 
      69              : #endif // !HCCLV2_TEMP_REDUCE_SCATTER_CONCURR_MESH
        

Generated by: LCOV version 2.0-1