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_ALL_GATHER_SEQ_EXECUTOR
12 : #define HCCLV2_ALL_GATHER_SEQ_EXECUTOR
13 :
14 : #include "temp_all_gather_ring.h"
15 : #include "temp_all_gather_mesh.h"
16 : #include "coll_alg_base.h"
17 : #include "topo_match_mesh_ring.h"
18 :
19 : namespace Hccl {
20 : template <typename AlgTopoMatch, typename AlgTemp0, typename AlgTemp1> class AllGatherSeqExecutor : public CollAlgBase {
21 : public:
22 : explicit AllGatherSeqExecutor();
23 : ~AllGatherSeqExecutor() override;
24 :
25 0 : std::string Describe() const override
26 : {
27 0 : return "All Gather Sequential Executor.";
28 : }
29 :
30 : HcclResult GenPrimQues(const RankGraph *rankGraph, const CollAlgOperator &op, const CollAlgParams ¶ms,
31 : PrimQuePtr primQue) override;
32 : HcclResult CalcResOffload(const RankGraph *rankGraph, const u64 &dataSize,
33 : CollOffloadOpResReq &resReq) override;
34 : HcclResult CalcRes(const RankGraph *rankGraph, CollAlgResReq &algResReq) override;
35 :
36 : HcclResult GenPrimQuesAIC(const AlgTopoInfo &topoInfo, const CollAlgOperator &op, const CollAlgParams ¶ms,
37 : ConnectedLinkMgr *linkMgr, PrimQuePtr primQue) override;
38 :
39 : private:
40 : HcclResult GenPrimQues4Offload(AlgTemplateBase &tempAlg0, AlgTemplateBase &tempAlg1);
41 : HcclResult GenPrimQues4Opbase(const u32 dataSizePerVolume, AlgTemplateBase &tempAlg0, AlgTemplateBase &tempAlg1);
42 :
43 : HcclResult PrepRes(const RankGraph *rankGraph, const LinkReq &linkReq, ResLinks &resLinks);
44 :
45 : std::vector<std::vector<RankId>> virtRanks_;
46 : std::vector<std::map<RankId, u32>> virtRankMap_; // map<virtRank, virtRankOrder>
47 : std::vector<std::vector<std::vector<RankId>>> vTopo_;
48 :
49 : std::vector<u32> tempRankSizes_;
50 : std::vector<std::vector<PrimQuePtr>> tempRequiredQues_;
51 : std::vector<ResLinks> tempResLinks_;
52 : };
53 :
54 : } // namespace Hccl
55 :
56 : #endif // HCCLV2_ALL_GATHER_SEQ_EXECUTOR
|