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 : #include "log.h"
12 :
13 : #include "alg_data_trans_wrapper.h"
14 : #include "ins_alg_template/ins_temp_broadcast_nhr.h"
15 :
16 : namespace Hccl {
17 0 : InsTempBroadcastNHR::InsTempBroadcastNHR(const RankId virtualRank, const u32 tempRankSize,
18 : const std::vector<std::vector<RankId>> &tempVTopo,
19 0 : const std::map<RankId, u32> &tempVirtRankMap)
20 0 : : InsAlgTemplateBase(virtualRank, tempRankSize, tempVTopo, tempVirtRankMap)
21 : {
22 0 : }
23 :
24 0 : InsTempBroadcastNHR::~InsTempBroadcastNHR()
25 : {
26 0 : }
27 :
28 0 : HcclResult InsTempBroadcastNHR::CalcRes(AlgTempResReq &tempResReq)
29 : {
30 : // NHR 需要的 que Num 为 1
31 0 : tempResReq.queNum = 1;
32 0 : tempResReq.streamNum = tempResReq.queNum;
33 0 : tempResReq.queNotifys = CreateMasterSlaveQueNotifiesRequest(tempResReq.queNum);
34 0 : CHK_PRT_RET(CalcResLinksNHR(myRank_, tempRankSize_, tempVTopo_, tempResReq) != HcclResult::HCCL_SUCCESS,
35 : HCCL_ERROR("[CollAlgFactory] [InsTempBroadCastNHR] Rank [%d], resLinks calculation error!", myRank_),
36 : HcclResult::HCCL_E_INTERNAL);
37 :
38 0 : return HcclResult::HCCL_SUCCESS;
39 : }
40 :
41 0 : u32 InsTempBroadcastNHR::CalcScratchMultiple(BufferType inBuffType, BufferType outBuffType)
42 : {
43 : (void) inBuffType;
44 : (void) outBuffType;
45 0 : if (op_.opMode == OpMode::OPBASE) {
46 0 : return 1;
47 : } else {
48 0 : return 0;
49 : }
50 : }
51 :
52 : // SliceInfoVec for NHR
53 0 : HcclResult InsTempBroadcastNHR::CalcDataSliceInfo(const u64 dataSize, RankSliceInfo &sliceInfoVec)
54 : {
55 0 : AllignInfo allignInfo = {false, 0, dataType_};
56 :
57 : u64 unitAllignSize;
58 0 : CHK_RET(GetUnitAllignSize(allignInfo, unitAllignSize));
59 0 : sliceInfoVec.clear();
60 0 : sliceInfoVec.resize(tempRankSize_);
61 :
62 0 : u64 chunkSize = RoundUp(dataSize, (tempRankSize_ * unitAllignSize)) * unitAllignSize;
63 :
64 0 : u64 accumOff = 0;
65 0 : for (u32 rankIdx = 0; rankIdx < tempRankSize_; rankIdx++) {
66 0 : u64 currChunkSize = ((dataSize - accumOff) > chunkSize) ? chunkSize : (dataSize - accumOff);
67 0 : SliceInfo slice = {accumOff, currChunkSize};
68 0 : sliceInfoVec[rankIdx].push_back(slice);
69 0 : accumOff += currChunkSize;
70 : }
71 :
72 0 : CHK_PRT_RET((sliceInfoVec[tempRankSize_ - 1][0].offset + sliceInfoVec[tempRankSize_ - 1][0].size != dataSize),
73 : HCCL_ERROR("[InsTempBroadcastNHR] Rank [%d], SliceInfo calculation error!", myRank_),
74 : HcclResult::HCCL_E_INTERNAL);
75 :
76 0 : return HcclResult::HCCL_SUCCESS;
77 : }
78 :
79 0 : HcclResult InsTempBroadcastNHR::PostCopy(const TemplateDataParams &tempAlgParams,
80 : std::vector<InsQuePtr> &tempInsQues) const
81 : {
82 0 : if (opMode_ == OpMode::OPBASE && (u32(myRank_) != root_)) {
83 0 : HCCL_INFO("[InsTempBroadcastNHR][PostCopy] Opbase && isBottom, copy from outBuff to userOut");
84 0 : u64 inOffset = tempAlgParams.buffInfo.scratchBuffBaseOff;
85 :
86 0 : DataSlice usrInSlice = DataSlice(BufferType::SCRATCH, inOffset, tempAlgParams.sliceSize);
87 0 : DataSlice usrOutSlice = DataSlice(BufferType::INPUT, tempAlgParams.buffInfo.outBuffBaseOff,
88 0 : tempAlgParams.sliceSize);
89 :
90 0 : HCCL_INFO("PostCopy usrInSlice: %s, usrOutSlice: %s",
91 : usrInSlice.Describe().c_str(), usrOutSlice.Describe().c_str());
92 :
93 0 : CHK_RET(LocalCopy(tempInsQues[0], usrInSlice, usrOutSlice));
94 : } else {
95 0 : HCCL_INFO("[InsTempBroadcastNHR][PostCopy] Offload Model, skip postcopy");
96 : }
97 :
98 0 : return HcclResult::HCCL_SUCCESS;
99 : }
100 :
101 0 : HcclResult InsTempBroadcastNHR::PreCopy(const TemplateDataParams &tempAlgParams,
102 : std::vector<InsQuePtr> &tempInsQues) const
103 : {
104 0 : if (opMode_ == OpMode::OPBASE && (u32(myRank_) == root_)){
105 0 : DataSlice usrInSlice = DataSlice(BufferType::INPUT, tempAlgParams.buffInfo.inBuffBaseOff,
106 0 : tempAlgParams.sliceSize);
107 0 : DataSlice usrOutSlice = DataSlice(BufferType::SCRATCH, tempAlgParams.buffInfo.scratchBuffBaseOff,
108 0 : tempAlgParams.sliceSize);
109 0 : CHK_PRT_RET(LocalCopy(tempInsQues[0], usrInSlice, usrOutSlice),
110 : HCCL_ERROR("[InsTempBroadcastNHR] RunScatter userIn to cclIn copy failed"),
111 :
112 : HcclResult::HCCL_E_INTERNAL);
113 : } else {
114 0 : HCCL_INFO("[InsTempBroadcastNHR][PostCopy] Offload Model, skip postcopy");
115 : }
116 :
117 0 : return HcclResult::HCCL_SUCCESS;
118 : }
119 :
120 0 : HcclResult InsTempBroadcastNHR::GetAllGatherStepInfo(u32 step, u32 nSteps, AicpuNHRStepInfo &stepInfo)
121 : {
122 0 : u32 rankIdx = tempVirtRankMap_[myRank_];
123 0 : stepInfo.txSliceIdxs.clear();
124 0 : stepInfo.rxSliceIdxs.clear();
125 0 : stepInfo.step = step;
126 0 : stepInfo.myRank = rankIdx;
127 :
128 : // 计算通信对象
129 0 : u32 deltaRank = 1 << (nSteps - 1 - step);
130 0 : u32 recvFrom = (rankIdx + tempRankSize_ - deltaRank) % tempRankSize_;
131 0 : u32 sendTo = (rankIdx + deltaRank) % tempRankSize_;
132 :
133 : // 数据份数和数据编号增量
134 0 : u32 nSlices = (tempRankSize_ - 1 + (1 << (nSteps - 1 - step))) / (1 << (nSteps - step));
135 0 : u32 deltaSliceIndex = 1 << (nSteps - step);
136 0 : u32 txSliceIdx = rankIdx;
137 0 : u32 rxSliceIdx = (rankIdx - (1 << (nSteps - 1 - step)) + tempRankSize_) % tempRankSize_;
138 :
139 0 : stepInfo.nSlices = nSlices;
140 0 : stepInfo.toRank = sendTo;
141 0 : stepInfo.fromRank = recvFrom;
142 :
143 0 : for (u32 i = 0; i < nSlices; i++) {
144 0 : stepInfo.txSliceIdxs.push_back(txSliceIdx);
145 0 : stepInfo.rxSliceIdxs.push_back(rxSliceIdx);
146 :
147 0 : HCCL_DEBUG("[InsTempBroadcastNHR][GetStepInfoForAllGather] i[%u] txSliceIdx[%u] rxSliceIdx[%u]",
148 : i, txSliceIdx, rxSliceIdx);
149 :
150 0 : txSliceIdx = (txSliceIdx + tempRankSize_ - deltaSliceIndex) % tempRankSize_;
151 0 : rxSliceIdx = (rxSliceIdx + tempRankSize_ - deltaSliceIndex) % tempRankSize_;
152 : }
153 0 : return HcclResult::HCCL_SUCCESS;
154 : }
155 :
156 : // NHR每步的算法描述原理函数
157 0 : HcclResult InsTempBroadcastNHR::GetScatterStepInfo(u32 step, u32 nSteps, AicpuNHRStepInfo &stepInfo) const
158 : {
159 0 : u32 rankIdx = tempVirtRankMap_.at(myRank_);
160 0 : u32 rootIdx = tempVirtRankMap_.at(root_);
161 0 : u32 rankSize = tempRankSize_;
162 :
163 0 : stepInfo.txSliceIdxs.clear();
164 0 : stepInfo.rxSliceIdxs.clear();
165 0 : stepInfo.nSlices = 0;
166 0 : stepInfo.toRank = INVALID_U32;
167 0 : stepInfo.fromRank = INVALID_U32;
168 0 : stepInfo.step = step;
169 0 : stepInfo.myRank = rankIdx;
170 :
171 0 : u32 deltaRoot = (rootIdx + rankSize - rankIdx) % rankSize;
172 0 : u32 deltaRankPair = 1 << step;
173 :
174 : // 数据份数和数据编号增量
175 0 : u32 nSlices = (rankSize - 1 + (1 << step)) / (1 << (step + 1));
176 0 : u32 deltaSliceIndex = 1 << (step + 1);
177 :
178 : // 判断是否是2的幂
179 0 : u32 nRanks = 0; // 本步需要进行收/发的rank数
180 0 : bool isPerfect = (rankSize & (rankSize - 1)) == 0;
181 0 : if (!isPerfect && step == nSteps - 1) {
182 0 : nRanks = rankSize - deltaRankPair;
183 : } else {
184 0 : nRanks = deltaRankPair;
185 : }
186 :
187 0 : if (deltaRoot < nRanks) { // 需要发
188 0 : u32 sendTo = (rankIdx + rankSize - deltaRankPair) % rankSize;
189 0 : u32 txSliceIdx = sendTo;
190 0 : for (u32 i = 0; i < nSlices; i++) {
191 0 : u32 targetTxSliceIdx = txSliceIdx;
192 0 : stepInfo.txSliceIdxs.push_back(targetTxSliceIdx);
193 0 : txSliceIdx = (txSliceIdx + rankSize - deltaSliceIndex) % rankSize;
194 : }
195 :
196 0 : stepInfo.toRank = sendTo;
197 0 : stepInfo.nSlices = nSlices;
198 0 : } else if (deltaRoot >= deltaRankPair && deltaRoot < nRanks + deltaRankPair) { // 需要收
199 0 : u32 recvFrom = (rankIdx + deltaRankPair) % rankSize;
200 0 : u32 rxSliceIdx = rankIdx;
201 0 : for (u32 i = 0; i < nSlices; i++) {
202 0 : u32 targetRxSliceIdx = rxSliceIdx;
203 0 : stepInfo.rxSliceIdxs.push_back(targetRxSliceIdx);
204 0 : rxSliceIdx = (rxSliceIdx + rankSize - deltaSliceIndex) % rankSize;
205 : }
206 :
207 0 : stepInfo.fromRank = recvFrom;
208 0 : stepInfo.nSlices = nSlices;
209 : }
210 0 : return HcclResult::HCCL_SUCCESS;
211 : }
212 :
213 0 : HcclResult InsTempBroadcastNHR::RunScatter(const RankSliceInfo &sliceInfoVec,
214 : const ResLinks &tempLinks, std::vector<InsQuePtr> &tempInsQues)
215 : {
216 : // nhr主体部分,从ScratchIn计算,结果放至ScratchOut上, 该部分均从inType搬运到outType
217 0 : u32 nSteps = GetNHRStepNum(tempRankSize_);
218 0 : for (u32 step = 0; step < nSteps; step++) {
219 0 : AicpuNHRStepInfo stepInfo;
220 0 : CHK_RET(GetScatterStepInfo(step, nSteps, stepInfo));
221 0 : CHK_PRT_RET(BatchTxRx(stepInfo, tempLinks, tempInsQues[0], sliceInfoVec),
222 : HCCL_ERROR("[InsTempBroadcastNHR] BatchTxRx failed"),
223 : HcclResult::HCCL_E_INTERNAL);
224 0 : }
225 :
226 0 : return HcclResult::HCCL_SUCCESS;
227 : }
228 :
229 0 : RankId InsTempBroadcastNHR::GetRankFromMap(const u32 rankIdx) const
230 : {
231 0 : RankId rank = -1;
232 0 : for (auto &pair : tempVirtRankMap_) {
233 0 : if (pair.second == rankIdx) {
234 0 : rank = pair.first;
235 0 : break;
236 : }
237 : }
238 0 : return rank;
239 : }
240 :
241 0 : HcclResult InsTempBroadcastNHR::RunAllGather(const RankSliceInfo &sliceInfoVec,
242 : const ResLinks &tempLinks, std::vector<InsQuePtr> &tempInsQues)
243 : {
244 0 : u32 nSteps = GetNHRStepNum(tempRankSize_);
245 :
246 0 : BufferType buffType = opMode_ == OpMode::OPBASE ? buffInfo_.scratBuffType : buffInfo_.outBuffType;
247 0 : u64 memOffset = opMode_ == OpMode::OPBASE ? buffInfo_.scratchBuffBaseOff : buffInfo_.outBuffBaseOff;
248 :
249 0 : for (u32 step = 0; step < nSteps; step++) {
250 0 : AicpuNHRStepInfo stepInfo;
251 0 : CHK_RET(GetAllGatherStepInfo(step, nSteps, stepInfo));
252 :
253 0 : const std::vector<LinkData> &linkRecv = tempLinks.at(GetRankFromMap(stepInfo.fromRank));
254 0 : const std::vector<LinkData> &linkSend = tempLinks.at(GetRankFromMap(stepInfo.toRank));
255 :
256 0 : std::vector<DataSlice> txSlices;
257 0 : std::vector<DataSlice> rxSlices;
258 :
259 0 : HCCL_DEBUG("[InsTempBroadcastNHR] rank[%d] rankSize[%u] recvFrom[%u] sendTo[%u] step[%u] nSteps[%u] nSlices[%u]",
260 : myRank_, tempRankSize_, stepInfo.fromRank, stepInfo.toRank, step, nSteps, stepInfo.nSlices);
261 :
262 0 : for (u32 i = 0; i < stepInfo.nSlices; i++) {
263 0 : u64 txOffset = sliceInfoVec[stepInfo.txSliceIdxs[i]][0].offset + memOffset;
264 0 : u64 txSize = sliceInfoVec[stepInfo.txSliceIdxs[i]][0].size;
265 0 : u64 rxOffset = sliceInfoVec[stepInfo.rxSliceIdxs[i]][0].offset + memOffset;
266 0 : u64 rxSize = sliceInfoVec[stepInfo.rxSliceIdxs[i]][0].size;
267 0 : DataSlice txSlice = DataSlice(buffType, txOffset, txSize);
268 0 : DataSlice rxSlice = DataSlice(buffType, rxOffset, rxSize);
269 0 : txSlices.push_back(txSlice);
270 0 : rxSlices.push_back(rxSlice);
271 : }
272 :
273 0 : TxRxLinks sendRecvLinks(linkSend[0], linkRecv[0]);
274 0 : TxRxSlicesList sendRecvSlicesList({txSlices, txSlices}, {rxSlices, rxSlices});
275 :
276 0 : SendRecvInfo sendRecvInfo(sendRecvLinks, sendRecvSlicesList);
277 0 : CHK_PRT_RET(SendRecv(sendRecvInfo, tempInsQues[0], 0, true, dmaMode_), HCCL_ERROR("[InsTempBroadcastNHR] RunAllGather send failed"),
278 : HcclResult::HCCL_E_INTERNAL);
279 0 : }
280 0 : return HcclResult::HCCL_SUCCESS;
281 : }
282 :
283 : // Send multiple DataSlices
284 0 : HcclResult InsTempBroadcastNHR::BatchTxRx(AicpuNHRStepInfo &stepInfo, const ResLinks &tempLinks, InsQuePtr &queue,
285 : const RankSliceInfo &sliceInfoVec)
286 : {
287 0 : BufferType memType = (opMode_ == OpMode::OPBASE) ? BufferType::SCRATCH : BufferType::INPUT;
288 0 : u64 memOffset = (opMode_ == OpMode::OPBASE) ? buffInfo_.scratchBuffBaseOff : buffInfo_.inBuffBaseOff;
289 : // 只有Tx,使用send指令
290 0 : if (stepInfo.txSliceIdxs.size() > 0 && stepInfo.rxSliceIdxs.size() == 0) {
291 0 : CHK_RET(BatchSend(stepInfo, tempLinks, queue, sliceInfoVec, memType, memOffset));
292 : }
293 : // 只有Rx,使用recv指令
294 0 : else if (stepInfo.txSliceIdxs.size() == 0 && stepInfo.rxSliceIdxs.size() > 0) {
295 0 : CHK_RET(BatchRecv(stepInfo, tempLinks, queue, sliceInfoVec, memType, memOffset));
296 : }
297 : // 既有Tx又有Rx,使用SendRecv指令
298 0 : else if (stepInfo.txSliceIdxs.size() > 0 && stepInfo.rxSliceIdxs.size() > 0) {
299 0 : CHK_RET(BatchSR(stepInfo, tempLinks, queue, sliceInfoVec, memType, memOffset));
300 : }
301 0 : return HcclResult::HCCL_SUCCESS;
302 : }
303 :
304 0 : HcclResult InsTempBroadcastNHR::BatchSend(AicpuNHRStepInfo &stepInfo, const ResLinks &tempLinks, InsQuePtr &queue,
305 : const RankSliceInfo &sliceInfoVec, BufferType memType, u64 memOffset) const
306 : {
307 0 : const LinkData &linkSend = tempLinks.at(GetRankFromMap(stepInfo.toRank))[0];
308 0 : std::vector<DataSlice> txSlices;
309 0 : for (u32 i = 0; i < stepInfo.txSliceIdxs.size(); i++) {
310 0 : u32 txId = stepInfo.txSliceIdxs[i];
311 0 : DataSlice txSrcDstSlice = DataSlice( memType, memOffset + sliceInfoVec[txId][0].offset, sliceInfoVec[txId][0].size );
312 0 : txSlices.push_back(txSrcDstSlice);
313 : }
314 0 : SlicesList txSlicesList(txSlices, txSlices);
315 0 : DataInfo sendData(linkSend, txSlicesList);
316 0 : CHK_PRT_RET(Send(sendData, queue), HCCL_ERROR("[InsTempBroadcastNHR] BatchSend failed"),
317 : HcclResult::HCCL_E_INTERNAL);
318 0 : return HcclResult::HCCL_SUCCESS;
319 0 : }
320 :
321 0 : HcclResult InsTempBroadcastNHR::BatchRecv(AicpuNHRStepInfo &stepInfo, const ResLinks &tempLinks, InsQuePtr &queue,
322 : const RankSliceInfo &sliceInfoVec, BufferType memType, u64 memOffset) const
323 : {
324 0 : const LinkData &linkRecv = tempLinks.at(GetRankFromMap(stepInfo.fromRank))[0];
325 0 : std::vector<DataSlice> rxSlices;
326 0 : for (u32 i = 0; i < stepInfo.rxSliceIdxs.size(); i++) {
327 0 : u32 rxId = stepInfo.rxSliceIdxs[i];
328 0 : DataSlice rxSrcDstSlice = DataSlice( memType, memOffset + sliceInfoVec[rxId][0].offset, sliceInfoVec[rxId][0].size );
329 0 : rxSlices.push_back(rxSrcDstSlice);
330 : }
331 0 : SlicesList rxSlicesList(rxSlices, rxSlices);
332 0 : DataInfo recvData(linkRecv, rxSlicesList);
333 0 : CHK_PRT_RET(Recv(recvData, queue), HCCL_ERROR("[InsTempBroadcastNHR] BatchTxRx Recv failed"),
334 : HcclResult::HCCL_E_INTERNAL);
335 0 : return HcclResult::HCCL_SUCCESS;
336 0 : }
337 :
338 0 : HcclResult InsTempBroadcastNHR::BatchSR(AicpuNHRStepInfo &stepInfo, const ResLinks &tempLinks, InsQuePtr &queue,
339 : const RankSliceInfo &sliceInfoVec, BufferType memType, u64 memOffset)const
340 : {
341 0 : const LinkData &linkSend = tempLinks.at(GetRankFromMap(stepInfo.toRank))[0];
342 0 : const LinkData &linkRecv = tempLinks.at(GetRankFromMap(stepInfo.fromRank))[0];
343 0 : TxRxLinks linkSendRecv = {linkSend, linkRecv};
344 :
345 0 : std::vector<DataSlice> txSlices;
346 0 : for (u32 i = 0; i < stepInfo.txSliceIdxs.size(); i++) {
347 0 : u32 txId = stepInfo.txSliceIdxs[i];
348 0 : DataSlice txSrcDstSlice = DataSlice( memType, memOffset + sliceInfoVec[txId][0].offset, sliceInfoVec[txId][0].size );
349 0 : txSlices.push_back(txSrcDstSlice);
350 : }
351 0 : SlicesList txSlicesList(txSlices, txSlices);
352 0 : std::vector<DataSlice> rxSlices;
353 0 : for (u32 i = 0; i < stepInfo.rxSliceIdxs.size(); i++) {
354 0 : u32 rxId = stepInfo.rxSliceIdxs[i];
355 0 : DataSlice rxSrcDstSlice = DataSlice( memType, memOffset + sliceInfoVec[rxId][0].offset, sliceInfoVec[rxId][0].size );
356 0 : rxSlices.push_back(rxSrcDstSlice);
357 : }
358 0 : SlicesList rxSlicesList(rxSlices, rxSlices);
359 0 : TxRxSlicesList txRxSlicesList(txSlicesList, rxSlicesList);
360 0 : SendRecvInfo sendRecvInfo(linkSendRecv, txRxSlicesList);
361 0 : CHK_PRT_RET(SendRecv(sendRecvInfo, queue, 0, true, dmaMode_), HCCL_ERROR("[InsTempBroadcastNHR] BatchTxRx SendRecv failed"),
362 : HcclResult::HCCL_E_INTERNAL);
363 0 : return HcclResult::HCCL_SUCCESS;
364 0 : }
365 :
366 0 : HcclResult InsTempBroadcastNHR::GenExtIns(const TempFuncs &tempFuncs, const TemplateDataParams &templateDataParams,
367 : const ResLinks &tempLinks, std::vector<InsQuePtr> &tempInsQues)
368 : {
369 0 : if (IsPcieLink(tempLinks)) {
370 0 : dmaMode_ = DmaMode::GET;
371 : }
372 0 : opMode_ = tempFuncs.opMode;
373 0 : enableCounterNotify_ = tempFuncs.enableCounterNotify;
374 0 : buffInfo_ = templateDataParams.buffInfo;
375 0 : HCCL_INFO("[InsTempBroadcastNHR] BroadcastNHR entry.");
376 :
377 0 : RankSliceInfo sliceInfoVec;
378 0 : CHK_RET(CalcDataSliceInfo(templateDataParams.sliceSize, sliceInfoVec));
379 :
380 0 : queNum_ = tempVTopo_.size();;
381 0 : CHK_PRT_RET(queNum_ != tempInsQues.size(),
382 : HCCL_ERROR("[CollAlgFactory] [InsTempBroadcastNHR] Rank [%d], requiredQue Error.", myRank_),
383 : HcclResult::HCCL_E_INTERNAL);
384 :
385 0 : HCCL_INFO("[InsTempBroadcastNHR Run]RankID:[%d], root:[%u]", myRank_, root_);
386 :
387 0 : CHK_RET(PreCopy(templateDataParams, tempInsQues));
388 0 : CHK_RET(RunScatter(sliceInfoVec, tempLinks, tempInsQues));
389 0 : CHK_RET(RunAllGather(sliceInfoVec, tempLinks, tempInsQues));
390 0 : CHK_RET(PostCopy(templateDataParams, tempInsQues));
391 :
392 0 : HCCL_INFO("[InsTempBroadcastNHR] BroadcastNHR finish.");
393 :
394 0 : return HcclResult::HCCL_SUCCESS;
395 0 : }
396 :
397 : } // namespace Hccl
|