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_ALL_GATHER_DOUBLE_RING_MID_COUNT_EXECUTOR_H
12 : #define COLL_ALL_GATHER_DOUBLE_RING_MID_COUNT_EXECUTOR_H
13 : #include "coll_all_gather_ring_for_910_93_executor.h"
14 : namespace hccl {
15 : class CollAllGatherSemiRingExecutor : public CollAllGatherRingFor91093Executor {
16 : public:
17 : explicit CollAllGatherSemiRingExecutor(const HcclDispatcher dispatcher, std::unique_ptr<TopoMatcher>& topoMatcher);
18 0 : ~CollAllGatherSemiRingExecutor() override = default;
19 :
20 : private:
21 : /* *************** 资源计算 *************** */
22 : HcclResult CalcStreamNum(u32& streamNum) override;
23 : HcclResult CalcNotifyNum(u32 streamNum, u32& notifyNum) override;
24 : HcclResult CalcLevel0CommInfo(
25 : TransportMemType inputType, TransportMemType outputType,
26 : std::vector<LevelNSubCommTransport>& opTransport) override;
27 :
28 : /* *************** 算法编排 *************** */
29 : HcclResult DoubleRingMidCountAllGather(
30 : const std::string& tag, DeviceMem& inputMem, DeviceMem& outputMem, const u64 count,
31 : const HcclDataType& dataType, const std::vector<std::vector<Slice>>& multRingsSliceZero, const Stream& stream,
32 : s32 profStage, const u64 baseOffset = 0, const HcomCollOpInfo* opInfo = nullptr,
33 : const std::vector<std::vector<Slice>>& multRingsUserMemSlice = std::vector<std::vector<Slice>>(0));
34 : HcclResult RunIntraSeverAllGather(
35 : const std::string& tag, DeviceMem& inputMem, DeviceMem& outputMem, const u64 count,
36 : const HcclDataType& dataType, const std::vector<std::vector<Slice>>& multRingsSliceZero, const Stream& stream,
37 : s32 profStage, const u64 baseOffset = 0, const HcomCollOpInfo* opInfo = nullptr,
38 : const std::vector<std::vector<Slice>>& multRingsUserMemSlice = std::vector<std::vector<Slice>>(0)) override;
39 : };
40 :
41 : } // namespace hccl
42 :
43 : #endif
|