LCOV - code coverage report
Current view: top level - legacy/ascend950/service/collective/alg/coll_alg_factory/alg_template/ins_alg_template - ins_temp_reduce_scatter_nhr.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 5 0
Test Date: 2026-07-28 12:11:00 Functions: 0.0 % 2 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_INS_TEMP_REDUCE_SCATTER_NHR
      12              : #define HCCLV2_INS_TEMP_REDUCE_SCATTER_NHR
      13              : 
      14              : #include "string_util.h"
      15              : #include "ins_temp_all_gather_nhr.h"
      16              : #include "ins_alg_template_base.h"
      17              : namespace Hccl {
      18              : 
      19              : class InsTempReduceScatterNHR : public InsAlgTemplateBase {
      20              : public:
      21              :     explicit InsTempReduceScatterNHR(const RankId virtualRank, const u32 tempRankSize,
      22              :                                    const std::vector<std::vector<RankId>> &tempVTopo,
      23              :                                    const std::map<RankId, u32>            &tempVirtRankMap);
      24              :     ~InsTempReduceScatterNHR() override;
      25              : 
      26            0 :     std::string Describe() const override
      27              :     {
      28            0 :         return StringFormat("Template of reduce scatter NHR with tempRankSize [%u].", tempRankSize_);
      29              :     }
      30              : 
      31              :     HcclResult Run(const TempFuncs &tempFuncs, const RankSliceInfo &sliceInfoVec, const BuffInfo &buffInfo,
      32              :                          const ResLinks &tempLinks, std::vector<InsQuePtr> &tempInsQues) override;
      33              :     HcclResult CalcSliceInfo(const AllignInfo &allignInfo, const u64 dataSize, RankSliceInfo &sliceInfoVec) override;
      34              :     HcclResult CalcRes(AlgTempResReq &tempResReq) override;
      35              :     HcclResult PreCopy(const TempFuncs &tempFuncs, const RankSliceInfo &sliceInfoVec,
      36              :         std::vector<InsQuePtr> &tempInsQues);
      37              :     HcclResult PostCopy(const TempFuncs &tempFuncs, const RankSliceInfo &sliceInfoVec,
      38              :         std::vector<InsQuePtr> &tempInsQues);
      39              :     HcclResult GetScratchBufferInfo(const uint64_t scratchBufferSize, DataType dataType) const;
      40              :     HcclResult GenExtIns(const TempFuncs &tempFuncs,
      41              :                         const TemplateDataParams &tempAlgParams,
      42              :                         const ResLinks &tempLinks,
      43              :                         std::vector<InsQuePtr> &tempInsQues);
      44            0 :     u32 CalcScratchMultiple(const BufferType &inBufferTpye, const BufferType &outBufferTpye) const
      45              :     {
      46              :         (void) inBufferTpye;
      47              :         (void) outBufferTpye;
      48            0 :         HCCL_INFO(
      49              :             "[InsTempReduceScatterNHR][CalcScratchMultiple] templateScratchMultiplier[%llu]", tempRankSize_);
      50            0 :         return tempRankSize_;
      51              :     }
      52              : private:
      53              :     HcclResult MultiSliceLocalCopy(InsQuePtr &insQue, const std::vector<DataSlice> &srcList,
      54              :                                                 const std::vector<DataSlice> &dstList) const;
      55              :     HcclResult RunReduceScatter(const RankSliceInfo &sliceInfoVec, const ResLinks &tempLinks,
      56              :         std::vector<InsQuePtr> &tempInsQues);
      57              :     HcclResult GetStepInfoList(std::vector<AicpuNHRStepInfo> &stepInfoList);
      58              :     RankId GetRankFromMap(const u32 rankIdx);
      59              :     HcclResult LocalDataCopy(std::vector<InsQuePtr> &tempInsQues, const TempFuncs &tempFuncs, u32 linkIdx);
      60              :     HcclResult RunNHR(std::vector<InsQuePtr> &tempInsQues, u32 linkIdx);
      61              :     HcclResult PostLocalCopy(std::vector<InsQuePtr> &tempInsQues, u32 linkIdx);
      62              :     TemplateDataParams tempAlgParams_;
      63              :     ResLinks           tempLinks_;
      64              :     vector<u64> processSize_{0};
      65              :     vector<u64> linkSliceOffsetVec_{0};
      66              : };
      67              : 
      68              : } // namespace Hccl
      69              : 
      70              : #endif // !HCCLV2_INS_TEMP_REDUCE_SCATTER_NHR
        

Generated by: LCOV version 2.0-1