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 COLL_RUN_ALLTOALL_STAGED_AIV_RDMA_EXECUTOR_H
12 : #define COLL_RUN_ALLTOALL_STAGED_AIV_RDMA_EXECUTOR_H
13 : #include "coll_all_to_all_executor.h"
14 : #include "hccl_aiv.h"
15 :
16 : namespace hccl {
17 : class CollRunAlltoAllStagedAivRdmaExecutor : public CollAlltoAllExecutor {
18 :
19 : public:
20 : CollRunAlltoAllStagedAivRdmaExecutor(const HcclDispatcher dispatcher, std::unique_ptr<TopoMatcher> &topoMatcher);
21 0 : ~CollRunAlltoAllStagedAivRdmaExecutor() override = default;
22 :
23 : HcclResult Orchestrate(OpParam& param, AlgResourceResponse& algRes) override;
24 :
25 : private:
26 : HcclResult CalcLevel0CommInfo(TransportMemType inputType, TransportMemType outputType,
27 : std::vector<LevelNSubCommTransport>& opTransport) override;
28 : HcclResult CalcLevel1CommInfo(TransportMemType inputType, TransportMemType outputType,
29 : std::vector<LevelNSubCommTransport>& opTransport) override;
30 : HcclResult CalcStreamNum(u32& streamNum) override;
31 : HcclResult CalcScratchMemSize(u64& scratchMemSize) override;
32 : HcclResult CalcCommInfo(std::vector<LevelNSubCommTransport>& opTransport) override;
33 : HcclResult KernelRun(const OpParam ¶m, ExecMem &execMem) override;
34 :
35 : HcclResult RunAlltoAllStaged1InAIV(const OpParam ¶m, ExecMem &execMem);
36 : HcclResult PrepareAivBuffers(DeviceMem &inputMem, DeviceMem &outputMem, void **dataBuffers, void **flagBuffers);
37 : HcclResult RunAlltoAllStaged2(const OpParam ¶m, ExecMem &execMem);
38 : void CalcInterMeshAggregationAlltoAllMemInfo(const OpParam ¶m,
39 : std::map<u32, std::list<OneSendRecvAddrInfo>> &sendAddrInfosInter,
40 : std::map<u32, std::list<OneSendRecvAddrInfo>> &recvAddrInfosInter);
41 : HcclResult CalNumBlocks(u32& numBlocks, u32 rankSize, u64 dataSize = 0, HcclCMDType cmdType = HcclCMDType::HCCL_CMD_INVALID) override;
42 :
43 : /* *************** 算法参数 *************** */
44 : u32 sendDataSize_ = 0;
45 : u32 recvDataSize_ = 0;
46 : SubCommInfo innerCommInfo_ = {0, 0, std::vector<LINK>(), std::vector<LINK>()};
47 : SubCommInfo outerCommInfo_ = {0, 0, std::vector<LINK>(), std::vector<LINK>()};
48 : };
49 :
50 : } // namespace hccl
51 :
52 : #endif
|