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_GATHER_SOLE_EXECUTOR
12 : #define HCCLV2_INS_ALL_GATHER_SOLE_EXECUTOR
13 : #include "ins_coll_alg_base.h"
14 :
15 : namespace Hccl {
16 :
17 : template <typename AlgTopoMatch, typename InsAlgTemplate>
18 : class InsAllGatherSoleExecutor : public InsCollAlgBase {
19 : public:
20 : explicit InsAllGatherSoleExecutor();
21 : ~InsAllGatherSoleExecutor() override;
22 :
23 0 : std::string Describe() const override { return "Instruction based All Gather Sole Executor."; }
24 :
25 : HcclResult CalcRes(const RankGraph* rankGraph, CollAlgResReq& algResReq) override;
26 : HcclResult Orchestrate(
27 : const RankGraph* rankGraph, const CollAlgOperator& op, const CollAlgParams& params, InsQuePtr insQue) override;
28 : HcclResult CalcResOffload(const RankGraph* rankGraph, const u64& dataSize, CollOffloadOpResReq& resReq) override;
29 : HcclResult Orchestrate(
30 : const AlgTopoInfo& topoInfo, const CollAlgOperator& op, const CollAlgParams& params, ConnectedLinkMgr* linkMgr,
31 : InsQuePtr insQue) override;
32 :
33 : private:
34 : HcclResult GenInsQues4Offload(InsAlgTemplate& tempAlg);
35 : HcclResult GenInsQues4Opbase(InsAlgTemplate& tempAlg);
36 :
37 : std::vector<RankId> virtRanks_;
38 : std::map<RankId, u32> virtRankMap_; // map<virtRank, virtRankOrder>
39 : std::vector<std::vector<RankId>> vTopo_;
40 :
41 : std::vector<InsQuePtr> requiredQue_;
42 : ResLinks tempResLinks_;
43 : };
44 :
45 : } // namespace Hccl
46 :
47 : #endif // HCCLV2_ALL_GATHER_SOLE_EXECUTOR
|