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_V2_INS_RECV_EXECUTOR_H
12 : #define HCCLV2_V2_INS_RECV_EXECUTOR_H
13 :
14 : #include "ins_coll_alg_base.h"
15 :
16 : namespace Hccl {
17 :
18 : class InsV2RecvExecutor : public InsCollAlgBase {
19 : public:
20 : explicit InsV2RecvExecutor();
21 : ~InsV2RecvExecutor() override;
22 :
23 0 : std::string Describe() const override { return "Instruction based Recv Executor."; }
24 :
25 : HcclResult CalcResOffload(const RankGraph* rankGraph, const u64& dataSize, CollOffloadOpResReq& resReq) override;
26 :
27 : HcclResult CalcRes(const RankGraph* rankGraph, CollAlgResReq& algResReq) override;
28 :
29 : HcclResult Orchestrate(
30 : const RankGraph* rankGraph, const CollAlgOperator& op, const CollAlgParams& params, InsQuePtr insQue) override;
31 :
32 : HcclResult Orchestrate(
33 : const AlgTopoInfo& topoInfo, const CollAlgOperator& op, const CollAlgParams& params, ConnectedLinkMgr* linkMgr,
34 : InsQuePtr insQue) override;
35 : HcclResult
36 : ExecAiv(const CollAlgOperator& op, const CollAlgParams& params, LinkData& recvLinkData, InsQuePtr insQue);
37 : HcclResult CalNumBlocks(u32& numBlocks, u64 dataSize, u32 numBlocksLimit) override;
38 :
39 : private:
40 : std::vector<RankId> virtRanks_;
41 : std::map<RankId, u32> virtRankMap_; // map<virtRank, virtRankOrder>
42 : std::vector<std::vector<RankId>> vTopo_;
43 : u32 sliceId_{0}; // 用于组装aivTag
44 : };
45 :
46 : } // namespace Hccl
47 : #endif // HCCLV2_V2_INS_RECV_EXECUTOR_H
|