LCOV - code coverage report
Current view: top level - legacy/ascend950/service/collective/alg/coll_alg_factory/alg_executor/ins_alg_executor/all_reduce - ins_all_reduce_parallel_executor.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 2 0
Test Date: 2026-08-04 10:52:23 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_ALL_REDUCE_PARALLEL_EXECUTOR_H
      12              : #define HCCLV2_INS_ALL_REDUCE_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 InsAllReduceParallelExecutor : public InsCollAlgBase {
      20              : public:
      21              :     explicit InsAllReduceParallelExecutor();
      22              :     ~InsAllReduceParallelExecutor() override;
      23              : 
      24            0 :     std::string Describe() const override
      25              :     {
      26            0 :         return "Instruction based All Reduce Parallel Executor.";
      27              :     }
      28              : 
      29              :     HcclResult CalcResOffload(const RankGraph *rankGraph, const u64 &dataSize,
      30              :                               CollOffloadOpResReq &resReq) override;
      31              : 
      32              :     HcclResult CalcRes(const RankGraph *rankGraph, CollAlgResReq &algResReq) override;
      33              :     // HOST 接口
      34              :     HcclResult Orchestrate(const RankGraph *rankGraph, const CollAlgOperator &op, const CollAlgParams &params,
      35              :                           InsQuePtr insQue) override;
      36              :     // AICPU 接口
      37              :     HcclResult Orchestrate(const AlgTopoInfo &topoInfo, const CollAlgOperator &op, const CollAlgParams &params,
      38              :                              ConnectedLinkMgr *linkMgr, InsQuePtr insQue) override;
      39              : 
      40              : private:
      41              :     HcclResult GenInsQues(InsAlgTemplate0 &tempAlgIntra, InsAlgTemplate1 &tempAlgInter);
      42              :     void GenTemplateAlgParams0(const u64 dataOffset, const u64 dataCount, const u64 scratchOffset,TemplateDataParams &tempAlgParams) const;
      43              :     void GenTemplateAlgParams1(const u64 dataOffset, const u64 dataCount, const u64 scratchOffset,TemplateDataParams &tempAlgParams) const;
      44              :     HcclResult CalcSendDataSize(u64 &memBlockSize, float &SplitRate, u32 &multipleIntra, u32 &multipleInter);
      45              :     
      46              :     void GetParallelDataSplitRate(std::vector<float> &splitDataSize) const;
      47              :     HcclResult PrepareResForTemplate(const RankGraph *rankGraph, InsAlgTemplate0 &tempAlgIntra, InsAlgTemplate1 &tempAlgInter);
      48              :     HcclResult PrepareResForTemplate(ConnectedLinkMgr *linkMgr, InsAlgTemplate0 &tempAlgIntra, InsAlgTemplate1 &tempAlgInter);
      49              :     
      50              :     u32 rankSizeLevel0_{0};
      51              :     u32 rankSizeLevel1_{0};
      52              : 
      53              :     std::vector<std::vector<RankId>>              virtRanks_;
      54              :     std::vector<std::map<RankId, u32>>            virtRankMap_; // map<virtRank, virtRankOrder>
      55              :     std::vector<std::vector<std::vector<RankId>>> vTopo_;
      56              : 
      57              :     std::vector<InsQuePtr> requiredQue_;
      58              :     std::vector<InsQuePtr> intraQue_;
      59              :     std::vector<InsQuePtr> interQue_;
      60              :     std::vector<InsQuePtr> syncQueues_;
      61              :     ResLinks               intraLinks_;
      62              :     ResLinks               interLinks_;
      63              : 
      64              :     u64 interScratchOffset0{0};
      65              :     u64 interScratchOffset1{0};
      66              :     u64 Intra0ScratchSize{0};
      67              :     u64 Intra1ScratchSize{0};
      68              :     u64 Inter0ScratchSize{0};
      69              :     u64 Inter1ScratchSize{0};
      70              :     float dataSplitRate{0.5};
      71              : };
      72              : 
      73              : } // namespace Hccl
      74              : 
      75              : #endif // HCCLV2_INS_ALL_REDUCE_PARALLEL_EXECUTOR_H
        

Generated by: LCOV version 2.0-1