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