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