LCOV - code coverage report
Current view: top level - legacy/ascend950/service/collective/alg/coll_alg_factory/alg_executor/ins_alg_executor/reduce_scatter - ins_reduce_scatter_parallel_executor.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 % 5 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_REDUCE_SCATTER_PARALLEL_EXECUTOR_H
      12              : #define HCCLV2_INS_REDUCE_SCATTER_PARALLEL_EXECUTOR_H
      13              : #include "ins_coll_alg_base.h"
      14              : 
      15              : namespace Hccl {
      16              : 
      17              : 
      18              : template <typename AlgTopoMatch, typename InsAlgTemplate0, typename InsAlgTemplate1>
      19              : class InsReduceScatterParallelExecutor : public InsCollAlgBase {
      20              : public:
      21              :     explicit InsReduceScatterParallelExecutor();
      22              :     ~InsReduceScatterParallelExecutor() override;
      23              : 
      24            0 :     std::string Describe() const override
      25              :     {
      26            0 :         return "Instruction based Reduce Scatter Parallel Executor.";
      27              :     }
      28              : 
      29              :     HcclResult CalcRes(const RankGraph *rankGraph, CollAlgResReq &algResReq) override;
      30              :     HcclResult CalcResOffload(const RankGraph *rankGraph, const u64 &dataSize,
      31              :                               CollOffloadOpResReq &resReq) override;
      32              :     // HOST
      33              :     HcclResult Orchestrate(const RankGraph *rankGraph, const CollAlgOperator &op, const CollAlgParams &params,
      34              :                           InsQuePtr insQue) override;
      35              :     // AICPU
      36              :     HcclResult Orchestrate(const AlgTopoInfo &topoInfo, const CollAlgOperator &op, const CollAlgParams &params,
      37              :                              ConnectedLinkMgr *linkMgr, InsQuePtr insQue) override;
      38              : 
      39              : private:
      40              :     HcclResult GenInsQuesHost(InsAlgTemplate0 &tempAlgIntra, InsAlgTemplate1 &tempAlgInter);
      41              :     void GenTemplateAlgParamsIntra0(const u64 dataOffset, const u64 dataCountPerLoopAixs0, std::vector<u64> &scratchOffVec, TemplateDataParams &tempAlgParamsIntra0) const;
      42              :     void GenTemplateAlgParamsIntra1(const u64 dataOffset, const u64 dataCountPerLoopAixs1, std::vector<u64> &scratchOffVec, TemplateDataParams &tempAlgParamsIntra1) const;
      43              :     void GenTemplateAlgParamsInter0(const u64 dataOffset, const u64 dataCountPerLoopAixs0, std::vector<u64> &scratchOffVec, TemplateDataParams &tempAlgParamsInter0) const;
      44              :     void GenTemplateAlgParamsInter1(const u64 dataOffset, const u64 dataCountPerLoopAixs1, std::vector<u64> &scratchOffVec, TemplateDataParams &tempAlgParamsInter1) const;
      45              :     void GetParallelDataSplit(std::vector<float> &splitDataSize) const;
      46              :     HcclResult PrepareResForTemplate(const RankGraph *rankGraph, InsAlgTemplate0 &tempAlgIntra, InsAlgTemplate1 &tempAlgInter);
      47              :     HcclResult PrepareResForTemplate(ConnectedLinkMgr *linkMgr, InsAlgTemplate0 &tempAlgIntra, InsAlgTemplate1 &tempAlgInter);
      48              : 
      49              :     const RankGraph *rankGraph_ = nullptr;
      50              : 
      51              :     std::vector<std::vector<std::vector<RankId>>> vTopo_;
      52              :     std::vector<std::vector<RankId>>              virtRanks_;
      53              :     std::vector<std::map<RankId, u32>>            virtRankMap_; // map<virtRank, virtRankOrder>
      54              :     
      55              :     u32 rankSizeLevel0_{0};
      56              :     u32 rankSizeLevel1_{0};
      57              : 
      58              :     uint64_t rankIdxLevel0_{0};
      59              :     uint64_t rankIdxLevel1_{0};
      60              : 
      61              :     ResLinks               intraLinks_;
      62              :     ResLinks               interLinks_;
      63              :     std::vector<InsQuePtr> requireQue_;
      64              :     std::vector<InsQuePtr> intraQue_;
      65              :     std::vector<InsQuePtr> interQue_;
      66              :     std::vector<InsQuePtr> syncQueues_;
      67              : 
      68              :     const RankGraph *rankGraphPtr_ = nullptr;
      69              : };
      70              : 
      71              : } // namespace Hccl
      72              : 
      73              : #endif // HCCLV2_INS_REDUCE_SCATTER_PARALLEL_EXECUTOR_H
        

Generated by: LCOV version 2.0-1