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 <memory>
12 : #include <atomic>
13 : #include <chrono>
14 : #include <thread>
15 : #include <algorithm>
16 : #include <numeric>
17 : #include <unordered_set>
18 : #include <sys/time.h>
19 : #include "hccl_aiv.h"
20 : #include "hccl_communicator.h"
21 :
22 : using namespace std;
23 :
24 : constexpr u32 MODULE_NUM_FOUR = 4;
25 :
26 : namespace hccl
27 : {
28 1 : HcclCommunicator::HcclCommunicator()
29 1 : : dispatcher_(nullptr), vDispatcher_(nullptr), notifyPool_(nullptr),
30 1 : initializedFlag_(ATOMIC_FLAG_INIT), userRank_(INVALID_VALUE_RANKID), realUserRank_(INVALID_VALUE_RANKID),
31 3 : userRankSize_(INVALID_VALUE_RANKSIZE), drvInit_(false), inlineReduceSwitchOn_(true),
32 1 : nicDeployment_(NICDeployment::NIC_DEPLOYMENT_DEVICE), devicePhyId_(INVALID_UINT),
33 2 : deviceLogicId_(-1), localRank_(INVALID_VALUE_RANKID), hostSocketHandle_(nullptr),
34 2 : isUsedRdmaLevel0_(false), nicInitialized_(0), hcomGroupNicInit_(false),
35 2 : profilingMode_(HcomProfilingMode::PROFILING_CLOSE), raResourceInit_(false),
36 1 : interServer_(false), isSingleMeshAggregation_(false), cclBufferManager_(CCLBufferManager()),
37 1 : isExecuteProfilingInit_(false), deviceType_(DevType::DEV_TYPE_COUNT),
38 1 : commHandle_(nullptr),
39 3 : commWorkMode_(WorkMode::HCCL_MODE_NORMAL), meshAggregationRankSize_(0), isHaveCpuRank_(false), ranktableCrc_(0),
40 1 : multiModuleDiffDeviceNumMode_(false), multiSuperPodDiffServerNumMode_(false),
41 1 : isStandardCard_(false), is310PDuoCard_(false), hccsPortNum_(-1),
42 2 : loopBackIp_(HcclIpAddress(COMM_LOOPBACK_IP)), profilingInitiated_(false), callbackThreadId_(INVALID_U64),
43 1 : role_(SERVER_ROLE_SOCKET),
44 1 : isHostUseDevNic_(false),
45 771 : isAllRankSamePlane_(false), serverNum_(0), moduleNum_(0)
46 : {
47 1 : }
48 :
49 0 : HcclCommunicator::HcclCommunicator(const CommConfig &commConfig)
50 0 : : dispatcher_(nullptr), vDispatcher_(nullptr), notifyPool_(nullptr),
51 0 : initializedFlag_(ATOMIC_FLAG_INIT), userRank_(INVALID_VALUE_RANKID), realUserRank_(INVALID_VALUE_RANKID),
52 0 : userRankSize_(INVALID_VALUE_RANKSIZE), drvInit_(false), inlineReduceSwitchOn_(true),
53 0 : nicDeployment_(NICDeployment::NIC_DEPLOYMENT_DEVICE), devicePhyId_(INVALID_UINT),
54 0 : deviceLogicId_(-1), localRank_(INVALID_VALUE_RANKID), hostSocketHandle_(nullptr),
55 0 : isUsedRdmaLevel0_(false), nicInitialized_(0), hcomGroupNicInit_(false),
56 0 : profilingMode_(HcomProfilingMode::PROFILING_CLOSE), raResourceInit_(false),
57 0 : interServer_(false), isSingleMeshAggregation_(false), cclBufferManager_(CCLBufferManager()),
58 0 : isExecuteProfilingInit_(false), deviceType_(DevType::DEV_TYPE_COUNT),
59 0 : commHandle_(nullptr),
60 0 : commWorkMode_(WorkMode::HCCL_MODE_NORMAL), meshAggregationRankSize_(0), isHaveCpuRank_(false), ranktableCrc_(0),
61 0 : multiModuleDiffDeviceNumMode_(false), multiSuperPodDiffServerNumMode_(false),
62 0 : isStandardCard_(false), is310PDuoCard_(false), hccsPortNum_(-1),
63 0 : loopBackIp_(HcclIpAddress(COMM_LOOPBACK_IP)), profilingInitiated_(false), callbackThreadId_(INVALID_U64),
64 0 : role_(SERVER_ROLE_SOCKET),
65 0 : isHostUseDevNic_(false),
66 0 : isAllRankSamePlane_(false), serverNum_(0), moduleNum_(0)
67 : {
68 0 : commConfig_ = commConfig;
69 0 : }
70 :
71 9 : HcclCommunicator::~HcclCommunicator()
72 : {
73 11 : }
74 :
75 1 : HcclResult HcclCommunicator::Init(HcclCommParams ¶ms, const RankTable_t &rankTable)
76 : {
77 1 : return HCCL_SUCCESS;
78 : }
79 :
80 1 : HcclResult HcclCommunicator::Init(HcclCommParams ¶ms, const std::vector<RankInfo> &rankList,
81 : WorldGroupInfo &groupCommonData)
82 : {
83 1 : return HCCL_SUCCESS;
84 : }
85 :
86 0 : HcclResult HcclCommunicator::InitOneSidedService(const RankTable_t &rankTable)
87 : {
88 0 : return HCCL_SUCCESS;
89 : }
90 :
91 1 : HcclResult HcclCommunicator::InitOneSidedServiceNetDevCtx(u32 remoteRankId)
92 : {
93 1 : return HCCL_SUCCESS;
94 : }
95 :
96 1 : HcclResult HcclCommunicator::DeInitOneSidedServiceNetDevCtx()
97 : {
98 1 : return HCCL_SUCCESS;
99 : }
100 :
101 1 : HcclResult HcclCommunicator::GetOneSidedService(IHcclOneSidedService **service)
102 : {
103 1 : return HCCL_SUCCESS;
104 : }
105 :
106 0 : HcclResult HcclCommunicator::OneSidedServiceStartListen(NicType nicType, HcclNetDevCtx netDevCtx)
107 : {
108 0 : return HCCL_SUCCESS;
109 : }
110 :
111 0 : HcclResult HcclCommunicator::GetOneSidedServiceDevIpAndPort(NicType nicType, HcclIpAddress& ipAddress, u32& port)
112 : {
113 0 : return HCCL_SUCCESS;
114 : }
115 :
116 1 : HcclResult HcclCommunicator::DeinitOneSidedService()
117 : {
118 1 : return HCCL_SUCCESS;
119 : }
120 :
121 0 : bool HcclCommunicator::IsSupportSymmetricMemory(HcclCMDType opType, OpParam &opParam)
122 : {
123 0 : return false;
124 : }
125 :
126 1 : bool HcclCommunicator::IsSupportZeroCopy(const OpParam &opParam)
127 : {
128 1 : return false;
129 : }
130 :
131 1 : HcclResult HcclCommunicator::PrepareZeroCopy(const std::string &algName, const AlgDesc &algDesc, OpParam &opParam)
132 : {
133 1 : return HCCL_SUCCESS;
134 : }
135 :
136 1 : HcclResult HcclCommunicator::UpdateZeroCopy(const OpParam &opParam, const AlgResourceResponse &algResource)
137 : {
138 1 : return HCCL_SUCCESS;
139 : }
140 :
141 1 : HcclResult HcclCommunicator::BuildZeroCopyParam()
142 : {
143 1 : return HCCL_SUCCESS;
144 : }
145 :
146 1 : HcclResult HcclCommunicator::InitCommParams(HcclCommParams ¶ms)
147 : {
148 1 : return HCCL_SUCCESS;
149 : }
150 :
151 1 : bool HcclCommunicator::Is310PDuoCard()
152 : {
153 1 : return false;
154 : }
155 :
156 : // 910B A+X 在RDMA未启用情况下,两模块间的device数目需要一致且两模块中使用的卡都在同一平面上
157 1 : HcclResult HcclCommunicator::CheckSingleServerComm(const std::vector<RankInfo_t> &rankList) const
158 : {
159 1 : return HCCL_SUCCESS;
160 : }
161 :
162 1 : HcclResult HcclCommunicator::CheckDataType(const HcclDataType dataType, bool needReduce)
163 : {
164 1 : return HCCL_SUCCESS;
165 : }
166 :
167 1 : HcclResult HcclCommunicator::InitZeroCopyMemoryAgent()
168 : {
169 1 : return HCCL_SUCCESS;
170 : }
171 :
172 1 : HcclResult HcclCommunicator::DeinitZeroCopyMemoryAgent(bool inDestructor)
173 : {
174 1 : return HCCL_SUCCESS;
175 : }
176 :
177 0 : u8 HcclCommunicator::GetConfigAclGraphZeroCopyEnable()
178 : {
179 0 : return 0;
180 : }
181 :
182 1 : HcclResult HcclCommunicator::ClearResMap(const std::string &tag, bool &findTag, bool aclGraphDestroyCbk)
183 : {
184 : (void)aclGraphDestroyCbk;
185 1 : return HCCL_SUCCESS;
186 : }
187 :
188 1 : HcclResult HcclCommunicator::ClearOpResource(const std::string &tag, bool aclGraphDestroyCbk)
189 : {
190 : (void)aclGraphDestroyCbk;
191 1 : return HCCL_SUCCESS;
192 : }
193 :
194 1 : HcclResult HcclCommunicator::CreateOpBasedResources(const HcclCMDType &opType, const std::string &tag,
195 : const HcomCollOpInfo &opInfo)
196 : {
197 1 : return HCCL_E_NOT_SUPPORT;
198 : }
199 :
200 1 : HcclResult HcclCommunicator::CreateRemoteOpBasedResources(u64 memSize, const std::string &tag)
201 : {
202 1 : return HCCL_E_NOT_SUPPORT;
203 : }
204 :
205 1 : HcclResult HcclCommunicator::DestroyRemoteOpBasedMem(const std::string &tag)
206 : {
207 1 : return HCCL_E_NOT_SUPPORT;
208 : }
209 :
210 1 : bool HcclCommunicator::IsAtomicInit()
211 : {
212 1 : return false;
213 : }
214 :
215 1 : bool HcclCommunicator::IsNeedNicInit()
216 : {
217 1 : return false;
218 : }
219 :
220 1 : HcclResult HcclCommunicator::GetBandWidthPerNPU(u32 level, float &bandWidth)
221 : {
222 1 : return HCCL_E_NOT_SUPPORT;
223 : }
224 :
225 1 : HcclResult HcclCommunicator::GetDeviceNumPerAggregation(u32 &deviceNumPerAggregation)
226 : {
227 1 : return HCCL_SUCCESS;
228 : }
229 :
230 1 : HcclResult HcclCommunicator::InitHccpChannel()
231 : {
232 1 : return HCCL_SUCCESS;
233 : }
234 :
235 0 : std::vector<RankInfo> HcclCommunicator::GetRankLists()
236 : {
237 0 : return {};
238 : }
239 :
240 1 : HcclResult HcclCommunicator::CheckReduceDataType(const HcclDataType dataType, const HcclReduceOp op)
241 : {
242 1 : return HCCL_SUCCESS;
243 : }
244 :
245 1 : HcclResult HcclCommunicator::GetAlgType(AlgType &algType, HcclCMDType opType)
246 : {
247 1 : return HCCL_E_NOT_SUPPORT;
248 : }
249 :
250 1 : HcclResult HcclCommunicator::GetCommParams(HcclCommParams ¶ms)
251 : {
252 1 : return HCCL_E_NOT_SUPPORT;
253 : }
254 :
255 1 : HcclResult HcclCommunicator::GetCommRankTable(RankTable_t &rankTable)
256 : {
257 1 : return HCCL_E_NOT_SUPPORT;
258 : }
259 :
260 1 : HcclResult HcclCommunicator::InitPara()
261 : {
262 1 : return HCCL_SUCCESS;
263 : }
264 :
265 1 : bool HcclCommunicator::IsStandardCard()
266 : {
267 1 : return false;
268 : }
269 :
270 1 : HcclResult HcclCommunicator::InitOpRetry()
271 : {
272 1 : return HCCL_SUCCESS;
273 : }
274 :
275 1 : bool HcclCommunicator::CompareWithServerId(const ServerInfo_t &left, const ServerInfo_t &right)
276 : {
277 1 : return false;
278 : }
279 :
280 1 : bool HcclCommunicator::CompareWithNicName(const NetworkInfo_t &left, const NetworkInfo_t &right)
281 : {
282 1 : return false;
283 : }
284 :
285 1 : bool HcclCommunicator::CompareWithUserRank(const RankInfo &left, const RankInfo &right)
286 : {
287 1 : return false;
288 : }
289 :
290 1 : HcclResult HcclCommunicator::InitPreResource(const RankTable_t &rankTable)
291 : {
292 1 : return HCCL_SUCCESS;
293 : }
294 :
295 1 : HcclResult HcclCommunicator::InitTcpMode(const RankTable_t &rankTable) const
296 : {
297 1 : return HCCL_SUCCESS;
298 : }
299 :
300 1 : bool HcclCommunicator::IsEnableBackupLink()
301 : {
302 1 : return false;
303 : }
304 :
305 1 : HcclResult HcclCommunicator::InitRaResource()
306 : {
307 1 : return HCCL_SUCCESS;
308 : }
309 :
310 1 : HcclResult HcclCommunicator::DisablePreResource()
311 : {
312 1 : return HCCL_SUCCESS;
313 : }
314 :
315 1 : HcclResult HcclCommunicator::GetWorkspaceSubStreamNum(u64 count, HcclDataType dataType, HcclReduceOp op,
316 : const std::string &algName, u64 &streamNum, u64 dataSize, bool ifAiv, HcclCMDType opType)
317 : {
318 1 : return HCCL_SUCCESS;
319 : }
320 :
321 1 : HcclResult HcclCommunicator::DestroyNetworkResources()
322 : {
323 1 : return HCCL_SUCCESS;
324 : }
325 :
326 1 : HcclResult HcclCommunicator::SetWorkspaceResource(const std::string &tag, void *memPtr, u64 &maxSize,
327 : std::vector<rtStream_t> &stream)
328 : {
329 1 : return HCCL_E_NOT_SUPPORT;
330 : }
331 :
332 1 : void HcclCommunicator::DestroyWorkspaceResource(const std::string &tag)
333 : {
334 1 : }
335 :
336 1 : HcclResult HcclCommunicator::AtomicInitSet()
337 : {
338 1 : return HCCL_SUCCESS;
339 : }
340 :
341 1 : void HcclCommunicator::AtomicInitClear()
342 : {
343 1 : }
344 :
345 1 : u32 HcclCommunicator::GetUserRank()
346 : {
347 1 : return 0;
348 : }
349 :
350 1 : u32 HcclCommunicator::GetGroupRank()
351 : {
352 1 : return 0;
353 : }
354 :
355 1 : u32 HcclCommunicator::GetRankSize()
356 : {
357 1 : return 0;
358 : }
359 :
360 1 : bool HcclCommunicator::GetNicInitialized()
361 : {
362 1 : return false;
363 : }
364 :
365 : /*
366 : 1. 选择算法
367 : 2. 计算resource,存到request内
368 : 3. 创建和分配资源
369 : */
370 1 : HcclResult HcclCommunicator::HcclSelectAlg(HcclCMDType opType, u64 count, void* counts, HcclDataType dataType,
371 : HcclReduceOp op, int32_t aivCoreLimit, bool &ifAiv, std::string &algName)
372 : {
373 1 : return HCCL_SUCCESS;
374 : }
375 :
376 1 : HcclResult HcclCommunicator::HcclCalcNumBlocks(HcclCMDType opType, u64 count, void* counts, HcclDataType dataType, int32_t aivCoreLimit,
377 : std::string &algName, u32 &numBlocks)
378 : {
379 1 : return HCCL_SUCCESS;
380 : }
381 :
382 1 : HcclResult HcclCommunicator::HcclGetAlgExecParam(const std::string &tag, HcclCMDType opType, u64 count, void *inputPtr, void *outputPtr,
383 : bool clearEnable, HcclDataType dataType, HcclReduceOp op, void *&commContext, u64 &len, u32 aivCoreLimit)
384 : {
385 1 : return HCCL_SUCCESS;
386 : }
387 :
388 0 : HcclResult HcclCommunicator::GetAivTag(s32 tagNum, bool isCapture, s32 &aivTag)
389 : {
390 0 : return HCCL_SUCCESS;
391 : }
392 :
393 1 : HcclResult HcclCommunicator::CheckDeviceType(const DevType deviceType) const
394 : {
395 1 : return HCCL_SUCCESS;
396 : }
397 :
398 1 : HcclResult HcclCommunicator::CheckReductionOp(const HcclReduceOp op) const
399 : {
400 1 : return HCCL_SUCCESS;
401 : }
402 :
403 1 : HcclResult HcclCommunicator::CheckUserRank(const u32 userRank) const
404 : {
405 1 : return HCCL_SUCCESS;
406 : }
407 :
408 1 : HcclResult HcclCommunicator::CheckCount(const u64 count) const
409 : {
410 1 : return HCCL_SUCCESS;
411 : }
412 :
413 1 : HcclResult HcclCommunicator::GetGroupRanksInfo(const std::vector<u32> &groupRanks, std::vector<RankInfo> &ranksInfo)
414 : {
415 1 : return HCCL_SUCCESS;
416 : }
417 :
418 1 : HcclResult HcclCommunicator::GetGroupCommonData(WorldGroupInfo &groupCommonData) const
419 : {
420 1 : return HCCL_SUCCESS;
421 : }
422 :
423 1 : HcclResult HcclCommunicator::GetWorkspaceMemSize(const std::string &opType, u64 count, HcclDataType dataType,
424 : u32 &rankSize, u64 &memSize, DevType &deviceType) const
425 : {
426 1 : return HCCL_E_NOT_SUPPORT;
427 : }
428 :
429 1 : DeviceMem HcclCommunicator::GetWorkspaceScracthMem(const std::string &tag, u64 allocMemSize)
430 : {
431 1 : return DeviceMem();
432 : }
433 :
434 1 : std::vector<Stream> HcclCommunicator::GetWorkspaceSubStreams(const std::string &tag, u32 num)
435 : {
436 1 : return {};
437 : }
438 :
439 1 : HcclResult HcclCommunicator::InitProfiling()
440 : {
441 1 : return HCCL_SUCCESS;
442 : }
443 :
444 1 : HcclResult HcclCommunicator::DeinitProfiling()
445 : {
446 1 : return HCCL_SUCCESS;
447 : }
448 :
449 1 : HcclResult HcclCommunicator::RegistTaskExceptionHandler() const
450 : {
451 1 : return HCCL_SUCCESS;
452 : }
453 :
454 1 : HcclResult HcclCommunicator::UnRegistTaskExceptionHandler() const
455 : {
456 1 : return HCCL_SUCCESS;
457 : }
458 :
459 1 : HcclResult HcclCommunicator::GetInCCLbuffer(void *&buffer, u64 &size)
460 : {
461 1 : return HCCL_E_NOT_SUPPORT;
462 : }
463 :
464 1 : HcclResult HcclCommunicator::GetOutCCLbuffer(void *&buffer, u64 &size)
465 : {
466 1 : return HCCL_E_NOT_SUPPORT;
467 : }
468 :
469 1 : void HcclCommunicator::ReleaseCommCCLbuffer()
470 : {
471 1 : }
472 :
473 1 : HcclResult HcclCommunicator::ReleaseCommInfos()
474 : {
475 1 : return HCCL_SUCCESS;
476 : }
477 :
478 1 : HcclResult HcclCommunicator::InitProfiler()
479 : {
480 1 : return HCCL_SUCCESS;
481 : }
482 :
483 1 : HcclResult HcclCommunicator::CreateCommCCLbuffer()
484 : {
485 1 : return HCCL_E_NOT_SUPPORT;
486 : }
487 :
488 1 : HcclResult HcclCommunicator::InitCCLbuffer(u64 inCCLbufferSize, u64 outCCLbufferSize)
489 : {
490 1 : return HCCL_E_NOT_SUPPORT;
491 : }
492 :
493 1 : u32 HcclCommunicator::GetLocalNicPort(NicType nicType)
494 : {
495 1 : return 0;
496 : }
497 :
498 1 : HcclResult HcclCommunicator::InitNic(bool isMC2ReInit)
499 : {
500 1 : return HCCL_SUCCESS;
501 : }
502 :
503 1 : HcclResult HcclCommunicator::DeinitNic()
504 : {
505 1 : return HCCL_SUCCESS;
506 : }
507 :
508 1 : HcclResult HcclCommunicator::RegisterRanksToDca()
509 : {
510 1 : return HCCL_E_NOT_SUPPORT;
511 : }
512 :
513 1 : HcclResult HcclCommunicator::RegisterToHeartBeat()
514 : {
515 1 : return HCCL_E_NOT_SUPPORT;
516 : }
517 :
518 0 : HcclResult HcclCommunicator::AddOpInfoToHeartBeat(const OpInfoDesc &opInfo, const std::string &tag)
519 : {
520 0 : return HCCL_E_NOT_SUPPORT;
521 : }
522 :
523 0 : void HcclCommunicator::DeleteOpInfoToHeartBeat()
524 : {
525 0 : }
526 :
527 1 : HcclResult HcclCommunicator::RegisterToHeartBeat(u32 peerRankId, string &tag)
528 : {
529 1 : return HCCL_E_NOT_SUPPORT;
530 : }
531 :
532 1 : void HcclCommunicator::UnRegisterToHeartBeat()
533 : {
534 1 : }
535 :
536 0 : void HcclCommunicator::UnRegisterToCommConfiger()
537 : {
538 0 : }
539 :
540 1 : HcclResult HcclCommunicator::SetGlobalWorkSpace(std::vector<void *> &globalWorkSpaceAddr)
541 : {
542 1 : return HCCL_SUCCESS;
543 : }
544 :
545 1 : HcclResult HcclCommunicator::GetandClearOverFlowTasks(std::vector<HcclDumpInfo> &hcclDumpInfo)
546 : {
547 1 : return HCCL_SUCCESS;
548 : }
549 :
550 1 : HcclResult HcclCommunicator::GetDeviceId(s32 &deviceId) const
551 : {
552 1 : return HCCL_SUCCESS;
553 : }
554 :
555 1 : HcclResult HcclCommunicator::GetCqeError(HcclResult &result)
556 : {
557 1 : return HCCL_SUCCESS;
558 : }
559 :
560 0 : HcclResult HcclCommunicator::GetOpInconsistentError(HcclResult &result)
561 : {
562 0 : return HCCL_SUCCESS;
563 : }
564 :
565 1 : HcclResult HcclCommunicator::SupportDeterministicOptim(bool &isDeterministicOptim)
566 : {
567 1 : return HCCL_SUCCESS;
568 : }
569 :
570 1 : HcclResult HcclCommunicator::GetHccsLinkNum(u32 &numHccsLink)
571 : {
572 1 : return HCCL_SUCCESS;
573 : }
574 :
575 1 : HcclResult HcclCommunicator::AllGather(const std::string &tag, void *inputPtr, void *outputPtr, u64 inputCount,
576 : HcclDataType dataType, HcclRtStream stream, HcomCollOpInfo *opInfo)
577 : {
578 1 : return HCCL_SUCCESS;
579 : }
580 :
581 1 : HcclResult HcclCommunicator::AllGatherV(const std::string &tag, const void *sendBuf, u64 sendCount, const void *recvBuf,
582 : const void *recvCounts, const void *rdispls, HcclDataType dataType, HcclRtStream stream)
583 : {
584 1 : return HCCL_SUCCESS;
585 : }
586 :
587 1 : HcclResult HcclCommunicator::AicpuUnfold(const std::string &tag, void *inputPtr, void *outputPtr, u64 count,
588 : HcclDataType dataType, HcclReduceOp op, HcclRtStream stream, HcclCMDType cmdType)
589 : {
590 1 : return HCCL_SUCCESS;
591 : }
592 :
593 1 : HcclResult HcclCommunicator::AllGatherOutPlace(const std::string &tag, void *inputPtr, void *outputPtr,
594 : u64 inputCount, HcclDataType dataType, HcclRtStream stream)
595 : {
596 1 : return HCCL_SUCCESS;
597 : }
598 :
599 1 : HcclResult HcclCommunicator::AllGatherVOutPlace(const std::string &tag, void *inputPtr, void *outputPtr,
600 : u64 inputCount, const void *outputCounts, const void *outputDispls, HcclDataType dataType, HcclRtStream stream)
601 : {
602 1 : return HCCL_SUCCESS;
603 : }
604 :
605 1 : void HcclCommunicator::GetAndSetSyncMode(SyncMode &preSyncMode, SyncMode newSyncMode)
606 : {
607 1 : }
608 :
609 1 : void HcclCommunicator::RestorePreSyncMode(SyncMode preSyncMode, SyncMode newSyncMode)
610 : {
611 1 : }
612 :
613 1 : HcclResult HcclCommunicator::AllReduce(const std::string &tag, void *inputPtr, void *outputPtr, u64 count,
614 : HcclDataType dataType, HcclReduceOp op, HcclRtStream stream,
615 : SyncMode syncMode, const HcomCollOpInfo *opInfo)
616 : {
617 1 : return HCCL_SUCCESS;
618 : }
619 :
620 1 : HcclResult HcclCommunicator::AllReduceAicpuUnfold(const std::string &tag, void *inputPtr, void *outputPtr, u64 count,
621 : HcclDataType dataType, HcclReduceOp op, HcclRtStream stream)
622 : {
623 1 : return HCCL_SUCCESS;
624 : }
625 :
626 1 : HcclResult HcclCommunicator::AllReduceOutPlace(const std::string &tag, void *inputPtr, void *outputPtr, u64 count,
627 : HcclDataType dataType, HcclReduceOp op, HcclRtStream stream,
628 : SyncMode syncMode)
629 : {
630 1 : return HCCL_SUCCESS;
631 : }
632 :
633 1 : HcclResult HcclCommunicator::AlltoAllV(const void *sendBuf, const void *sendCounts, const void *sdispls,
634 : HcclDataType sendType, const void *recvBuf, const void *recvCounts, const void *rdispls, HcclDataType recvType,
635 : rtStream_t stream, const std::string &tag)
636 : {
637 1 : return HCCL_SUCCESS;
638 : }
639 :
640 1 : HcclResult HcclCommunicator::AlltoAllVOutPlace(const void *sendBuf, const void *sendCounts, const void *sdispls,
641 : HcclDataType sendType, const void *recvBuf, const void *recvCounts, const void *rdispls, HcclDataType recvType,
642 : rtStream_t stream, const std::string &tag)
643 : {
644 1 : return HCCL_SUCCESS;
645 : }
646 :
647 1 : HcclResult HcclCommunicator::AlltoAllVC(const void *sendBuf, const void *sendCountMatrix, HcclDataType sendType,
648 : const void *recvBuf, HcclDataType recvType, rtStream_t stream, const std::string &tag)
649 : {
650 1 : return HCCL_SUCCESS;
651 : }
652 :
653 1 : HcclResult HcclCommunicator::AlltoAllVCOutPlace(const void *sendBuf, const void *sendCountMatrix, HcclDataType sendType,
654 : const void *recvBuf, HcclDataType recvType, rtStream_t stream, const std::string &tag)
655 : {
656 1 : return HCCL_SUCCESS;
657 : }
658 :
659 1 : HcclResult HcclCommunicator::AlltoAll(const void *sendBuf, u64 sendCount, HcclDataType sendType,
660 : const void *recvBuf, u64 recvCount, HcclDataType recvType, rtStream_t stream, const std::string &tag)
661 : {
662 1 : return HCCL_SUCCESS;
663 : }
664 :
665 1 : HcclResult HcclCommunicator::Broadcast(const std::string &tag, void *ptr, u64 count, HcclDataType dataType, u32 root,
666 : HcclRtStream stream)
667 : {
668 1 : return HCCL_SUCCESS;
669 : }
670 :
671 1 : HcclResult HcclCommunicator::BroadcastOutPlace(const std::string &tag, void *ptr, u64 count, HcclDataType dataType,
672 : u32 root, HcclRtStream stream)
673 : {
674 1 : return HCCL_SUCCESS;
675 : }
676 :
677 1 : HcclResult HcclCommunicator::Scatter(const std::string &tag, void *inputPtr, void *outputPtr, u64 recvCount,
678 : HcclDataType dataType, u32 root, HcclRtStream stream)
679 : {
680 1 : return HCCL_SUCCESS;
681 : }
682 :
683 1 : HcclResult HcclCommunicator::ScatterOutPlace(const std::string &tag, void *inputPtr, void *outputPtr, u64 recvCount,
684 : HcclDataType dataType, u32 root, HcclRtStream stream)
685 : {
686 1 : return HCCL_SUCCESS;
687 : }
688 :
689 1 : HcclResult HcclCommunicator::Reduce(const std::string &tag, void *inputPtr, void *outputPtr, u64 count,
690 : HcclDataType dataType, HcclReduceOp op, u32 root, HcclRtStream stream)
691 : {
692 1 : return HCCL_SUCCESS;
693 : }
694 :
695 1 : HcclResult HcclCommunicator::ReduceOutPlace(const std::string &tag, void *inputPtr, void *outputPtr, u64 count,
696 : HcclDataType dataType, HcclReduceOp op, u32 root, HcclRtStream stream)
697 : {
698 1 : return HCCL_SUCCESS;
699 : }
700 :
701 1 : HcclResult HcclCommunicator::ReduceScatter(const std::string &tag, void *inputPtr, void *outputPtr, u64 count,
702 : HcclDataType dataType, HcclReduceOp op, HcclRtStream stream, HcomCollOpInfo *opInfo)
703 : {
704 1 : return HCCL_SUCCESS;
705 : }
706 :
707 1 : HcclResult HcclCommunicator::ReduceScatterOutPlace(const std::string &tag, void *inputPtr, void *outputPtr,
708 : u64 count, HcclDataType dataType, HcclReduceOp op, HcclRtStream stream)
709 : {
710 1 : return HCCL_SUCCESS;
711 : }
712 :
713 1 : HcclResult HcclCommunicator::ReduceScatterV(const std::string &tag, void *inputPtr,
714 : const void *inputCounts, const void *inputDispls, void *outputPtr, u64 outputCount,
715 : HcclDataType dataType, HcclReduceOp op, HcclRtStream stream, HcomCollOpInfo *opInfo)
716 : {
717 1 : return HCCL_SUCCESS;
718 : }
719 :
720 1 : HcclResult HcclCommunicator::ReduceScatterVOutPlace(const std::string &tag, void *inputPtr, void *outputPtr,
721 : const void *inputCounts, const void *inputDispls, u64 outputCount,
722 : HcclDataType dataType, HcclReduceOp op, HcclRtStream stream)
723 : {
724 1 : return HCCL_SUCCESS;
725 : }
726 :
727 1 : HcclResult HcclCommunicator::BatchSendRecv(const std::string &tag, HcclSendRecvItem *sendRecvItemsPtr, u32 itemNum,
728 : rtStream_t stream)
729 : {
730 1 : return HCCL_SUCCESS;
731 : }
732 :
733 1 : HcclResult HcclCommunicator::Send(const std::string &tag, void *inputPtr, u64 count, HcclDataType dataType,
734 : u32 destRank, rtStream_t stream, u32 srTag, u32 localGroupRank)
735 : {
736 1 : return HCCL_SUCCESS;
737 : }
738 :
739 1 : HcclResult HcclCommunicator::SendOutPlace(const std::string &tag, void *inputPtr, u64 count, HcclDataType dataType,
740 : u32 destRank, rtStream_t stream)
741 : {
742 1 : return HCCL_SUCCESS;
743 : }
744 :
745 1 : HcclResult HcclCommunicator::Receive(const std::string &tag, void *outputPtr, u64 count, HcclDataType dataType,
746 : u32 srcRank, rtStream_t stream, u32 srTag, u32 localGroupRank)
747 : {
748 1 : return HCCL_SUCCESS;
749 : }
750 :
751 1 : HcclResult HcclCommunicator::ReceiveOutPlace(const std::string &tag, void *outputPtr, u64 count,
752 : HcclDataType dataType, u32 srcRank, rtStream_t stream)
753 : {
754 1 : return HCCL_SUCCESS;
755 : }
756 :
757 1 : HcclResult HcclCommunicator::RegressCalPreOp(AlltoAllOperator *&alltoAllOperator, const OpParam &opParam,
758 : std::unique_ptr<PreProcessMetaInfo> &preMetaInfo)
759 : {
760 1 : return HCCL_SUCCESS;
761 : }
762 :
763 1 : HcclResult HcclCommunicator::RegressCalPreOp(AlltoAllOperator *&alltoAllOperator, const OpParam &opParam,
764 : std::unique_ptr<PreProcessMetaInfo> &preMetaInfo, Stream &preProcessStream)
765 : {
766 1 : return HCCL_SUCCESS;
767 : }
768 :
769 1 : HcclResult HcclCommunicator::ExecOp(HcclCMDType opType, OpParam &opParam, bool isCustom)
770 : {
771 1 : return HCCL_SUCCESS;
772 : }
773 :
774 1 : HcclResult HcclCommunicator::FreeScratchMemOnOpBaseMode(DeviceMem &scratchMem, const OpParam &opParam,
775 : const HcclCMDType &opType)
776 : {
777 1 : return HCCL_SUCCESS;
778 : }
779 :
780 1 : HcclResult HcclCommunicator::ExecOpAlltoAll(HcclCMDType opType, OpParam &opParam, bool isCustom)
781 : {
782 1 : return HCCL_SUCCESS;
783 : }
784 :
785 1 : HcclResult HcclCommunicator::HandleAclGraphFirstOpAivBuff(rtStream_t mainStream)
786 : {
787 1 : return HCCL_SUCCESS;
788 : }
789 :
790 1 : bool HcclCommunicator::StreamIsCapture(rtStream_t mainStream)
791 : {
792 1 : bool isCapture = false;
793 1 : return isCapture;
794 : }
795 :
796 1 : HcclResult HcclCommunicator::CaptureSlaveStreams(rtStream_t mainStream, vector<Stream> &slaveStreams)
797 : {
798 1 : return HCCL_SUCCESS;
799 : }
800 :
801 1 : HcclResult HcclCommunicator::BuildOpLocalScratchMemResParam(
802 : const AlgResourceResponse &algResource, const std::string &newTag, LocalResInfoV2 *localResHostPtr)
803 : {
804 1 : return HCCL_SUCCESS;
805 : }
806 :
807 1 : HcclResult HcclCommunicator::CheckSetRetryStateToWaitResume()
808 : {
809 1 : return HCCL_SUCCESS;
810 : }
811 :
812 0 : bool HcclCommunicator::HasRoceTransportLinks(OpCommTransport &opTransportReq)
813 : {
814 : (void)opTransportReq;
815 0 : return false;
816 : }
817 :
818 0 : HcclResult HcclCommunicator::AicpuKfcClearOpResLaunch(const std::unordered_set<std::string> &tags)
819 : {
820 : (void)tags;
821 0 : return HCCL_SUCCESS;
822 : }
823 :
824 0 : HcclResult HcclCommunicator::ClearAclgraphHostLinks(const std::unordered_set<std::string> &tags)
825 : {
826 : (void)tags;
827 0 : return HCCL_SUCCESS;
828 : }
829 :
830 1 : HcclResult HcclCommunicator::BuildOpLocalResParam(const AlgResourceResponse &algResource, const std::string &newTag)
831 : {
832 1 : return HCCL_SUCCESS;
833 : }
834 :
835 0 : HcclResult HcclCommunicator::InitAndCheckAicpuOrderNotify(u8 &orderLaunchMode)
836 : {
837 0 : return HCCL_SUCCESS;
838 : }
839 :
840 1 : HcclResult HcclCommunicator::AllocAndGetStreamContextBuff(u32 streamId, u64 &addr, u64 &size)
841 : {
842 1 : return HCCL_SUCCESS;
843 : }
844 :
845 1 : u32 HcclCommunicator::UpdateOpIndex(const OpParam &opParam)
846 : {
847 1 : return 0;
848 : }
849 :
850 1 : HcclResult HcclCommunicator::BuildAicpuCustomParam()
851 : {
852 1 : return HCCL_SUCCESS;
853 : }
854 :
855 0 : HcclResult HcclCommunicator::BuildAiRmaInfoParam(const std::string &newTag, const std::string &algName, const HcclCMDType opType)
856 : {
857 0 : return HCCL_SUCCESS;
858 : }
859 :
860 0 : HcclResult HcclCommunicator::BuildAicpuOrderLaunchNotify()
861 : {
862 0 : return HCCL_SUCCESS;
863 : }
864 :
865 : template <typename T>
866 : HcclResult HcclCommunicator::CopyVectorToDeviceMem(const u64 len, DeviceMem &dstDeviceMem, const std::vector<T> &srcVec)
867 : {
868 : return HCCL_SUCCESS;
869 : }
870 :
871 1 : HcclResult HcclCommunicator::BuildOpTopoResTlvParam(const std::string &algName,
872 : const std::vector<std::vector<std::vector<u32>>> &inputVectorInfo, DeviceMem &dstTlvDeviceMem, u64 &tlvLen)
873 : {
874 1 : return HCCL_SUCCESS;
875 : }
876 :
877 1 : HcclResult HcclCommunicator::BuildOpTopoResVectorTlvParam(const std::string &algName,
878 : const std::vector<std::vector<std::vector<std::vector<u32>>>> &inputVectorInfo, DeviceMem &dstTlvDeviceMem, u64 &tlvLen)
879 : {
880 1 : return HCCL_SUCCESS;
881 : }
882 :
883 1 : HcclResult HcclCommunicator::BuildPairLinkCounter(const std::string &algName)
884 : {
885 1 : return HCCL_SUCCESS;
886 : }
887 :
888 1 : HcclResult HcclCommunicator::BuildIsUsedRdmaRank(const std::string &algName)
889 : {
890 1 : return HCCL_SUCCESS;
891 : }
892 :
893 1 : HcclResult HcclCommunicator::BuildNicList(const std::string &algName)
894 : {
895 1 : return HCCL_SUCCESS;
896 : }
897 :
898 1 : HcclResult HcclCommunicator::BuildBridgeRank(const std::string &algName)
899 : {
900 1 : return HCCL_SUCCESS;
901 : }
902 :
903 1 : HcclResult HcclCommunicator::BuildCommPlanRank(const std::string &algName)
904 : {
905 1 : return HCCL_SUCCESS;
906 : }
907 :
908 1 : HcclResult HcclCommunicator::BuildServerAndsuperPodRank(const std::string &algName)
909 : {
910 1 : return HCCL_SUCCESS;
911 : }
912 :
913 1 : HcclResult HcclCommunicator::BuildOpRetryParam(const AlgResourceResponse &algResource, const std::string &newTag)
914 : {
915 1 : return HCCL_SUCCESS;
916 : }
917 :
918 1 : HcclResult HcclCommunicator::BuildCommPlaneSubGroupRank(const std::string &algName)
919 : {
920 1 : return HCCL_SUCCESS;
921 : }
922 :
923 0 : HcclResult HcclCommunicator::BuildHierarchicalAlgOption(u32 *ahcConfInfo)
924 : {
925 0 : return HCCL_SUCCESS;
926 : }
927 :
928 1 : HcclResult HcclCommunicator::BuildOpTopoResParam(const std::string &algName, const AlgResourceResponse &algResource)
929 : {
930 1 : return HCCL_SUCCESS;
931 : }
932 :
933 1 : HcclResult HcclCommunicator::BuildOpRemoteLinkP2pResParam(const LINK &link, HccltagRemoteResV3 &tagRemoteRes,
934 : TransportLinkType linkType)
935 : {
936 1 : return HCCL_SUCCESS;
937 : }
938 :
939 1 : HcclResult HcclCommunicator::BuildOpRemoteLinkRoceResParam(const LINK &link, HccltagRemoteResV3 &tagRemoteRes,
940 : bool isBackup, bool isRetry, bool isSecondBuild)
941 : {
942 1 : return HCCL_SUCCESS;
943 : }
944 :
945 : template <typename T>
946 : HcclResult HcclCommunicator::CreateListNode(T **resHostPtr, T **resDevicePtr)
947 : {
948 : return HCCL_SUCCESS;
949 : }
950 :
951 1 : HcclResult HcclCommunicator::BuildRemoteResByTag(const std::string &newTag, const u32 &usrRankId,
952 : HcclRankRelationResV2 *&rankRelationResHostPtr, HcclRankRelationResV2 *&rankRelationResDevicePtr, bool isBackup,
953 : bool isRetry)
954 : {
955 1 : return HCCL_SUCCESS;
956 : }
957 :
958 1 : HcclResult HcclCommunicator::BuildRelationResByRemoteRankId(const TransportRequest &transportRequest, const LINK &link,
959 : HcclRankRelationResV2 *&rankRelationResHostPtr, HcclRankRelationResV2 *&rankRelationResDevicePtr)
960 : {
961 1 : return HCCL_SUCCESS;
962 : }
963 :
964 1 : HcclResult HcclCommunicator::ParseRemoteDataToMem(const OpCommTransport &opTransportResponse, const std::string &newTag,
965 : const HcclCMDType opType, bool isBackup, bool isRetry)
966 : {
967 1 : return HCCL_SUCCESS;
968 : }
969 :
970 1 : HcclResult HcclCommunicator::BuildOpRemoteResParam(const AlgResourceResponse &algResource, const std::string &newTag,
971 : const HcclCMDType opType, bool isRetry)
972 : {
973 1 : return HCCL_SUCCESS;
974 : }
975 :
976 1 : HcclResult HcclCommunicator::CopyHostListResToDeviceParam(const std::string &newTag, const ListCommon *headHostList, const u64 size)
977 : {
978 1 : return HCCL_SUCCESS;
979 : }
980 :
981 0 : HcclResult HcclCommunicator::CopyHostAirmaInfoToDeviceParam(const std::string &newTag, const HcclCMDType opType, const rtStream_t aiCpuStream)
982 : {
983 0 : return HCCL_SUCCESS;
984 : }
985 :
986 1 : HcclResult HcclCommunicator::CopyHostOpResToDeviceParam(const std::string &newTag)
987 : {
988 1 : return HCCL_SUCCESS;
989 : }
990 :
991 1 : HcclResult HcclCommunicator::BuildOpResParam(
992 : const std::string &algName, const AlgResourceResponse &algResource, const std::string &newTag,
993 : const HcclCMDType opType, const rtStream_t aicpuStream)
994 : {
995 1 : return HCCL_SUCCESS;
996 : }
997 :
998 1 : HcclResult HcclCommunicator::BuildCustomOpResParam()
999 : {
1000 1 : return HCCL_SUCCESS;
1001 : }
1002 :
1003 1 : HcclResult HcclCommunicator::RegisterDfxInfo(const OpParam ¶m, AlgType algType,
1004 : const std::vector<Stream> &slaveStreams, bool isAiv, const std::string &newTag)
1005 : {
1006 1 : return HCCL_SUCCESS;
1007 : }
1008 :
1009 1 : HcclResult HcclCommunicator::GetReportHcclMC2Info(const Stream &kfcStream, const std::vector<Stream> &aicpuStreams)
1010 : {
1011 1 : return HCCL_SUCCESS;
1012 : }
1013 :
1014 1 : HcclResult HcclCommunicator::OrchestrateAicpu(const HcclCMDType &opType, const std::string &algName,
1015 : const OpParam ¶m, const AlgResourceResponse &algResource, const std::string &newTag, AlgType algType,
1016 : bool isCustom, bool needIncreLink, bool needRecreateAlltoallComm)
1017 : {
1018 1 : return HCCL_SUCCESS;
1019 : }
1020 :
1021 1 : HcclResult HcclCommunicator::CalcTinySendRecvMem(const OpParam &opParam, AlgResourceResponse &algResResponse,
1022 : DeviceMem &tinySendRecvMem)
1023 : {
1024 1 : return HCCL_SUCCESS;
1025 : }
1026 :
1027 1 : HcclResult HcclCommunicator::AllocAlgNotifys(const std::string &tag, const NotifyLoadType notifyLoadType, const u32 notifyNum,
1028 : std::vector<std::shared_ptr<LocalNotify>> ¬ifiesMain, std::vector<std::shared_ptr<LocalNotify>> ¬ifiesAux)
1029 : {
1030 1 : return HCCL_SUCCESS;
1031 : }
1032 :
1033 1 : HcclResult HcclCommunicator::AllocAlgResource(const std::string &newTag, HcclCMDType opType, const OpParam &opParam,
1034 : AlgResourceRequest &resRequest, AlgResourceResponse &algResResponse, bool selectAivAlg)
1035 : {
1036 1 : SaveLinkRes(algResResponse.opTransportResponse);
1037 1 : SaveLinkRes(algResResponse.opTransportResponseBackUp);
1038 :
1039 1 : return HCCL_SUCCESS;
1040 : }
1041 :
1042 1 : HcclResult HcclCommunicator::IncreAllocLink(const std::string &newTag, const OpParam &opParam,
1043 : AlgResourceRequest &resRequest, AlgResourceResponse &algResResponse)
1044 : {
1045 1 : SaveLinkRes(algResResponse.opTransportResponse);
1046 1 : SaveLinkRes(algResResponse.opTransportResponseBackUp);
1047 1 : return HCCL_SUCCESS;
1048 : }
1049 :
1050 1 : HcclResult HcclCommunicator::SetDevicePid(s32 devicePid)
1051 : {
1052 1 : return HCCL_SUCCESS;
1053 : }
1054 :
1055 1 : void HcclCommunicator::ReleaseWorkSpacebuffer()
1056 : {
1057 1 : }
1058 :
1059 1 : HcclResult HcclCommunicator::AllocAndClearDeviceMem(u64 size, std::shared_ptr<DeviceMem> &bufferPtr) const
1060 : {
1061 1 : return HCCL_SUCCESS;
1062 : }
1063 :
1064 1 : HcclResult HcclCommunicator::AllocAndClearHostMem(u64 size, std::shared_ptr<HostMem> &bufferPtr) const
1065 : {
1066 1 : return HCCL_SUCCESS;
1067 : }
1068 :
1069 1 : HcclResult HcclCommunicator::CreateWorkSpace(u64 size, DeviceMem &buffer) const
1070 : {
1071 1 : return HCCL_SUCCESS;
1072 : }
1073 :
1074 1 : HcclResult HcclCommunicator::GetWorkSpace(u64 *workSpaceSize, u64 *workSpace) const
1075 : {
1076 1 : return HCCL_SUCCESS;
1077 : }
1078 :
1079 1 : HcclResult HcclCommunicator::InitWorkSpace()
1080 : {
1081 1 : return HCCL_SUCCESS;
1082 : }
1083 :
1084 1 : HcclResult HcclCommunicator::FillOpParam(const HcclCMDType commType, OpParam &opParam,
1085 : const uint64_t count, void *pCount, void *pDispls)
1086 : {
1087 1 : return HCCL_SUCCESS;
1088 : }
1089 :
1090 1 : HcclResult HcclCommunicator::AllocComResource(const string &newTag, const string &algName,
1091 : const HcclCMDType commType, const OpParam &opParam, rtStream_t stream, bool isNeedHostSlaveStream)
1092 : {
1093 1 : return HCCL_SUCCESS;
1094 : }
1095 :
1096 1 : HcclResult HcclCommunicator::AllocComResourceByTiling(const std::string &algConfig, void *param)
1097 : {
1098 1 : return HCCL_SUCCESS;
1099 : }
1100 :
1101 1 : HcclResult HcclCommunicator::CreateCommResource(const std::string &tag, rtStream_t aiCpuStream, bool isOpbaseMode,
1102 : void **commContext, const std::string &algConfig)
1103 : {
1104 1 : return HCCL_SUCCESS;
1105 : }
1106 :
1107 1 : HcclResult HcclCommunicator::Mc2CreateAndLaunchContext(rtStream_t aiCpuStream, bool isOpbaseMode, void **commContext, const string &tag)
1108 : {
1109 1 : return HCCL_SUCCESS;
1110 : }
1111 :
1112 1 : HcclResult HcclCommunicator::GetAiCpuNotifyData(const std::shared_ptr<LocalNotify> &localNotify,
1113 : HcclSignalInfo ¬ifyInfo)
1114 : {
1115 1 : return HCCL_SUCCESS;
1116 : }
1117 :
1118 1 : HcclResult HcclCommunicator::CreateAndGetAiCpuNotify(std::shared_ptr<LocalNotify> &localNotify,
1119 : HcclSignalInfo ¬ifyInfo)
1120 : {
1121 1 : return HCCL_SUCCESS;
1122 : }
1123 :
1124 1 : HcclResult HcclCommunicator::Mc2AiCpuStreamAllocAndGet(u32 streamMode, rtStream_t &aiCpuStream)
1125 : {
1126 1 : return HCCL_SUCCESS;
1127 : }
1128 :
1129 1 : HcclResult HcclCommunicator::Mc2AiCpuInitStreamAllocAndGet(u32 streamMode, rtStream_t &aiCpuStream)
1130 : {
1131 1 : return HCCL_SUCCESS;
1132 : }
1133 :
1134 0 : HcclResult HcclCommunicator::AicpuResourceInit(const std::string &algName,
1135 : const AlgResourceResponse &algResource, const std::string &newTag, const rtStream_t &aicpuStream,
1136 : const HcclCMDType opType, bool isCustom)
1137 : {
1138 0 : return HCCL_SUCCESS;
1139 : }
1140 :
1141 1 : HcclResult HcclCommunicator::AiCpuKernelLaunch(const rtStream_t stm, u64 addr, const std::string &kernelName)
1142 : {
1143 1 : return HCCL_SUCCESS;
1144 : }
1145 :
1146 0 : HcclResult HcclCommunicator::LoadAICPUKernel(void)
1147 : {
1148 0 : return HCCL_SUCCESS;
1149 : }
1150 :
1151 0 : void HcclCommunicator::UnloadAICPUKernel(void)
1152 : {
1153 0 : return;
1154 : }
1155 :
1156 0 : HcclResult HcclCommunicator::LoadCustomKernel(void)
1157 : {
1158 0 : return HCCL_SUCCESS;
1159 : }
1160 :
1161 0 : void HcclCommunicator::UnloadCustomKernel(void)
1162 : {
1163 0 : return;
1164 : }
1165 :
1166 1 : HcclResult HcclCommunicator::AicpuKfcTilingDataLaunch(const OpParam &opParam, const HcclCMDType &opType,
1167 : const DeviceMem &deviceContext, const std::string &kernelName, const AicpuOpTiling opTilingInfo)
1168 : {
1169 1 : return HCCL_SUCCESS;
1170 : }
1171 :
1172 0 : HcclResult AicpuInitOpTilingDataAicpuCache(const OpParam &opParam, const HcclCMDType &opType, struct OpTilingData *opTilingData)
1173 : {
1174 0 : return HCCL_SUCCESS;
1175 : }
1176 :
1177 1 : HcclResult HcclCommunicator::AicpuInitOpTilingDataBuf(const OpParam &opParam, const HcclCMDType &opType,
1178 : const std::string &kernelName, const AicpuOpTiling opTilingInfo, u64 dynamicDataSize)
1179 : {
1180 1 : return HCCL_SUCCESS;
1181 : }
1182 :
1183 1 : HcclResult HcclCommunicator::AicpuKfcTilingDataLaunchIn(const OpParam &opParam, const DeviceMem &deviceContext,
1184 : const std::string &kernelName, const AicpuOpTiling opTilingInfo, u64 opTilingDataSize, bool isCustom)
1185 : {
1186 1 : return HCCL_SUCCESS;
1187 : }
1188 :
1189 1 : HcclResult HcclCommunicator::AicpuKfcTilingDataLaunchExt(const OpParam &opParam, const HcclCMDType &opType,
1190 : const DeviceMem &deviceContext, const std::string &kernelName, const AicpuOpTiling opTilingInfo,
1191 : bool isCustom)
1192 : {
1193 1 : return HCCL_SUCCESS;
1194 : }
1195 :
1196 1 : HcclResult HcclCommunicator::AicpuUnfoldKernelLaunch(void *inputPtr, void *outputPtr, const rtStream_t stm, u64 addr,
1197 : void *tilingDataPtr, u32 tilingDataSize, const std::string &kernelName, HcclWorkflowMode mode, const std::string &tag)
1198 : {
1199 1 : return HCCL_SUCCESS;
1200 : }
1201 :
1202 2 : HcclResult HcclCommunicator::AicpuUnfoldKernelLaunchV2(void *inputPtr, void *outputPtr, const rtStream_t stm,
1203 : u64 addr, void *tilingDataPtr, u32 tilingDataSize, const std::string &kernelName, HcclWorkflowMode mode,
1204 : const std::string &tag, bool isCustom)
1205 : {
1206 2 : return HCCL_SUCCESS;
1207 : }
1208 :
1209 1 : HcclResult HcclCommunicator::InitCombinOpara()
1210 : {
1211 1 : return HCCL_SUCCESS;
1212 : }
1213 :
1214 1 : bool HcclCommunicator::GetCommResource(const std::string &tag, void **commContext)
1215 : {
1216 1 : return false;
1217 : }
1218 :
1219 1 : bool HcclCommunicator::GetCommResource(void *&commContext)
1220 : {
1221 1 : return false;
1222 : }
1223 :
1224 1 : HcclResult HcclCommunicator::GetAicpuOpStreamNotify(HcclRtStream *opStream, u8 aicpuNotifyNum, void **aicpuNotify)
1225 : {
1226 1 : return HCCL_SUCCESS;
1227 : }
1228 :
1229 1 : HcclResult HcclCommunicator::GetAicpuOpStreamAndNotify(HcclRtStream *opStream, u8 aicpuNotifyNum, void **aicpuNotify)
1230 : {
1231 1 : return HCCL_SUCCESS;
1232 : }
1233 :
1234 1 : HcclResult HcclCommunicator::SetAicpuNotifyInvalid()
1235 : {
1236 1 : return HCCL_SUCCESS;
1237 : }
1238 :
1239 1 : HcclResult HcclCommunicator::ReplaceCommInfoByTag(const std::string &tag, std::unique_ptr<CommInfo> &commInfo)
1240 : {
1241 1 : return HCCL_SUCCESS;
1242 : }
1243 :
1244 1 : HcclResult HcclCommunicator::CreateMutiStreamResFor310P(const std::string &tag, level1StreamInfo_t &streamInfo)
1245 : {
1246 1 : return HCCL_SUCCESS;
1247 : }
1248 :
1249 1 : HcclResult HcclCommunicator::CreateCommAndStreamRes(const std::string &tag, Stream &stream)
1250 : {
1251 1 : return HCCL_SUCCESS;
1252 : }
1253 :
1254 1 : HcclResult HcclCommunicator::GetComm(const std::string &tag, CommBase **comm)
1255 : {
1256 1 : return HCCL_SUCCESS;
1257 : }
1258 :
1259 1 : HcclResult HcclCommunicator::SetCommResource(u64 commBufferSize, void *commInPtr, void *commOutPtr, void *commExpPtr,
1260 : CommBase *comm, level1StreamInfo_t &streamInfo, Stream &stream)
1261 : {
1262 1 : return HCCL_SUCCESS;
1263 : }
1264 :
1265 1 : void HcclCommunicator::ReleaseCommContextbuffer()
1266 : {
1267 1 : }
1268 :
1269 1 : HcclResult HcclCommunicator::CreateDeviceCommContext(u64 size, DeviceMem &buffer) const
1270 : {
1271 1 : return HCCL_SUCCESS;
1272 : }
1273 :
1274 1 : void HcclCommunicator::Break()
1275 : {
1276 1 : return;
1277 : }
1278 :
1279 1 : HcclResult HcclCommunicator::GetAlltoAllStagedWorkSpaceMemSize(u64 *sendCounts, u64 *sdispls, HcclDataType sendType,
1280 : u64 *recvCounts, u64 *rdispls, HcclDataType recvType, u64 &memSize)
1281 : {
1282 1 : return HCCL_E_NOT_SUPPORT;
1283 : }
1284 :
1285 1 : HcclResult HcclCommunicator::GetAlltoAllStagedWorkSpaceMemSize(
1286 : std::vector<SendRecvInfo> &allMeshAggregationSendRecvInfo, u64 &memSize)
1287 : {
1288 1 : return HCCL_E_NOT_SUPPORT;
1289 : }
1290 :
1291 1 : HcclResult HcclCommunicator::GetAllReduceScratchSize(
1292 : const u64 count, const HcclDataType dataType, u64 &scratchSize) const
1293 : {
1294 1 : return HCCL_E_NOT_SUPPORT;
1295 : }
1296 :
1297 1 : HcclResult HcclCommunicator::SetWorldGroupInfo(
1298 : std::unordered_map<std::string, std::map<u32, HcclIpAddress>> phyIdNicInfoMap,
1299 : vector<RankInfo> worldRankInfoList, vector<u32> &nicRanksPort, vector<u32> &vnicRanksPort)
1300 : {
1301 1 : return HCCL_SUCCESS;
1302 : }
1303 :
1304 1 : HcclResult HcclCommunicator::GetTopoDesc(HcclTopoDescs *topoDescs, uint32_t topoSize)
1305 : {
1306 1 : return HCCL_SUCCESS;
1307 : }
1308 :
1309 1 : HcclResult HcclCommunicator::SetAivModeConfig(const bool aivMode)
1310 : {
1311 1 : return HCCL_SUCCESS;
1312 : }
1313 :
1314 1 : HcclResult HcclCommunicator::SetOnlyAivModeConfig(const bool isOnlyAiv)
1315 : {
1316 : (void)isOnlyAiv;
1317 1 : return HCCL_SUCCESS;
1318 : }
1319 :
1320 1 : HcclResult HcclCommunicator::SetAicpuUnfoldConfig(const bool aicpuUnfold)
1321 : {
1322 1 : return HCCL_SUCCESS;
1323 : }
1324 :
1325 0 : HcclResult HcclCommunicator::SetExecTimeOutConfig(const s32 execTimeOut)
1326 : {
1327 0 : return HCCL_SUCCESS;
1328 : }
1329 :
1330 0 : HcclResult HcclCommunicator::SetAlgoConfig(const std::map<HcclCMDType, std::vector<HcclAlgoType>>& algoMap)
1331 : {
1332 0 : return HCCL_SUCCESS;
1333 : }
1334 :
1335 0 : bool HcclCommunicator::GetAivModeConfig()
1336 : {
1337 0 : return false;
1338 : }
1339 :
1340 0 : bool HcclCommunicator::GetConfigIsOnlyAivMode()
1341 : {
1342 0 : return false;
1343 : }
1344 :
1345 0 : bool HcclCommunicator::GetAicpuUnfoldConfig()
1346 : {
1347 0 : return false;
1348 : }
1349 :
1350 0 : void HcclCommunicator::SetQpQosAttr(u32 trafficClass, u32 serviceLevel)
1351 : {
1352 0 : transportManager_->SetQpQosAttr(trafficClass, serviceLevel);
1353 0 : indptOpTransportManager_->SetQpQosAttr(trafficClass, serviceLevel);
1354 0 : }
1355 :
1356 1 : HcclResult HcclCommunicator::CheckExitWaitResumeState(bool &isChangedLink)
1357 : {
1358 1 : return HCCL_SUCCESS;
1359 : }
1360 :
1361 1 : HcclResult HcclCommunicator::SetMemoryRange(void *baseVirPtr, size_t size, size_t alignment, uint64_t flags)
1362 : {
1363 1 : return HCCL_SUCCESS;
1364 : }
1365 :
1366 1 : HcclResult HcclCommunicator::UnsetMemoryRange(void *baseVirPtr)
1367 : {
1368 1 : return HCCL_SUCCESS;
1369 : }
1370 :
1371 1 : HcclResult HcclCommunicator::ActivateCommMemory(void *virPtr, size_t size, size_t offset, void *handle, uint64_t flags)
1372 : {
1373 1 : return HCCL_SUCCESS;
1374 : }
1375 :
1376 1 : HcclResult HcclCommunicator::DeactivateCommMemory(void *virPtr)
1377 : {
1378 1 : return HCCL_SUCCESS;
1379 : }
1380 :
1381 1 : HcclResult HcclCommunicator::SetSingleLinkInfo(std::unordered_map<u32, bool> &switchRanks, u32 remoteRankId,
1382 : ChangeLinkInfo &changeLinkInfo)
1383 : {
1384 1 : return HCCL_SUCCESS;
1385 : }
1386 :
1387 0 : HcclResult HcclCommunicator::SetAttachedStream(u32 graphId, const std::vector<rtStream_t> &streams)
1388 : {
1389 0 : return HCCL_SUCCESS;
1390 : }
1391 :
1392 0 : u8 HcclCommunicator::GetOrderLaunchMode (bool isCapture)
1393 : {
1394 0 : return 0;
1395 : }
1396 :
1397 1 : HcclResult HcclCommunicator::SetRemoteRankLinkInfo(std::unordered_map<u32, bool> &switchRanks,
1398 : ChangeLinkInfo &changeLinkInfo)
1399 : {
1400 1 : return HCCL_SUCCESS;
1401 : }
1402 :
1403 1 : HcclResult HcclCommunicator::ActiveStoppedLink(std::map<u32, bool> &remoteRankPortMap,
1404 : OpCommTransport &opTransportResponse, bool isBackup)
1405 : {
1406 1 : return HCCL_SUCCESS;
1407 : }
1408 :
1409 1 : HcclResult HcclCommunicator::PrepareLinkForSwitchNic(std::unordered_map<u32, bool> &switchRanks,
1410 : ChangeLinkInfo &changeLinkInfo)
1411 : {
1412 1 : return HCCL_SUCCESS;
1413 : }
1414 :
1415 1 : HcclResult HcclCommunicator::ParseSwitchRanks(uint32_t nRanks, uint32_t *ranks, bool *useBackup,
1416 : std::unordered_map<u32, bool> &switchRanks)
1417 : {
1418 1 : return HCCL_SUCCESS;
1419 : }
1420 :
1421 1 : HcclResult HcclCommunicator::SwitchNic(uint32_t nRanks, uint32_t *ranks, bool *useBackup,
1422 : std::shared_ptr<HDCommunicate> &controlH2D, std::shared_ptr<HDCommunicate> &statusD2H)
1423 : {
1424 1 : HcclResult ret = HCCL_SUCCESS;
1425 1 : return ret;
1426 : }
1427 :
1428 1 : HcclResult HcclCommunicator::GetSwitchRanks(u32 *distSwitchRankList, bool *distSwitchUseBackup, u32 &distSwitchRankNum,
1429 : u8 *distRemoteRankNicStatus, u32 &distNicStatusNum, bool &needCheckDefaultNic, bool &needCheckBackupNic)
1430 : {
1431 1 : return HCCL_SUCCESS;
1432 : }
1433 :
1434 1 : HcclResult HcclCommunicator::LoadCustomFile(const char *binPath, aclrtBinaryLoadOptionType optionType, uint32_t cpuKernelMode,
1435 : aclrtBinHandle& binHandle)
1436 : {
1437 1 : return HCCL_SUCCESS;
1438 : }
1439 :
1440 1 : void HcclCommunicator::UnloadBinary(aclrtBinHandle &binHandle)
1441 : {
1442 1 : return;
1443 : }
1444 :
1445 0 : HcclResult HcclCommunicator::GetCacheMap(std::unique_ptr<CollAlgOperator>& algOperator , OpParam& opParam,
1446 : AlgType& algType, bool selectAivAlg, std::string& newTag)
1447 : {
1448 0 : return HCCL_SUCCESS;
1449 : }
1450 :
1451 1 : HcclResult HcclCommunicator::ExecOpCache(HcclCMDType opType, OpParam &opParam, HcclCacheInfo& cacheInfo)
1452 : {
1453 1 : return HCCL_SUCCESS;
1454 : }
1455 :
1456 0 : HcclResult HcclCommunicator::GetLocalCCLBuf(void **addr, uint64_t *size)
1457 : {
1458 0 : return HCCL_SUCCESS;
1459 : }
1460 :
1461 0 : HcclResult HcclCommunicator::GetRemoteCCLBuf(uint32_t remoteRank, void **addr, uint64_t *size)
1462 : {
1463 0 : return HCCL_SUCCESS;
1464 : }
1465 0 : HcclResult HcclCommunicator::GetKFCWorkSpace(void **addr, uint64_t *size)
1466 : {
1467 0 : return HCCL_SUCCESS;
1468 : }
1469 0 : HcclResult IndOpTransportAlloc(const std::string &tag, OpCommTransport &opCommTransport,
1470 : TransportIOMem& transMem, bool isAicpuModeEn)
1471 : {
1472 0 : return HCCL_SUCCESS;
1473 : }
1474 0 : HcclTopoAttr HcclCommunicator::GetTopoAttr()
1475 : {
1476 0 : return {};
1477 : }
1478 0 : aclrtBinHandle HcclCommunicator::GetBinHandle()
1479 : {
1480 0 : return nullptr;
1481 : }
1482 0 : HcclResult HcclCommunicator::GetHDCommunicate(HDCommunicateParams &kfcControlTransferH2DParams,
1483 : HDCommunicateParams &kfcStatusTransferD2HParams)
1484 : {
1485 0 : return HCCL_SUCCESS;
1486 : }
1487 0 : HcclResult HcclCommunicator::SetGetAicpuCommState(std::function<bool()> getAicpuCommState)
1488 : {
1489 0 : return HCCL_SUCCESS;
1490 : }
1491 :
1492 0 : HcclResult HcclCommunicator::CommGetNetLayers(uint32_t **netLayers, uint32_t *netLayerNum)
1493 : {
1494 0 : return HCCL_SUCCESS;
1495 : }
1496 :
1497 0 : HcclResult HcclCommunicator::CommGetInstSizeByNetLayer(uint32_t netLayer, uint32_t *rankNum)
1498 : {
1499 0 : return HCCL_SUCCESS;
1500 : }
1501 0 : HcclResult HcclCommunicator::CommGetInstTopoTypeByNetLayer(uint32_t netLayer, u32 *topoType)
1502 : {
1503 0 : return HCCL_SUCCESS;
1504 : }
1505 :
1506 0 : HcclResult HcclCommunicator::GetNetLayers(uint32_t **netLayers, uint32_t *netLayerNum)
1507 : {
1508 0 : return HCCL_SUCCESS;
1509 : }
1510 :
1511 0 : HcclResult HcclCommunicator::GetInstSizeByNetLayer(uint32_t netLayer, uint32_t *rankNum)
1512 : {
1513 0 : return HCCL_SUCCESS;
1514 : }
1515 :
1516 0 : HcclResult HcclCommunicator::GetInstTopoTypeByNetLayer(uint32_t netLayer, CommTopo *topoType)
1517 : {
1518 0 : return HCCL_SUCCESS;
1519 : }
1520 :
1521 0 : HcclResult HcclCommunicator::GetInstRanksByNetLayer(uint32_t netLayer, uint32_t **rankList, uint32_t *rankNum)
1522 : {
1523 0 : return HCCL_SUCCESS;
1524 : }
1525 :
1526 0 : HcclResult HcclCommunicator::GetInstSizeListByNetLayer(uint32_t netLayer, uint32_t **instSizeList, uint32_t *listSize)
1527 : {
1528 0 : return HCCL_SUCCESS;
1529 : }
1530 :
1531 0 : HcclResult HcclCommunicator::GetRankGraph(GraphType type, void **graph, uint32_t *len)
1532 : {
1533 0 : return HCCL_SUCCESS;
1534 : }
1535 :
1536 0 : HcclResult HcclCommunicator::GetLinks(uint32_t netLayer, uint32_t srcRank, uint32_t dstRank,
1537 : CommLink **linkList, uint32_t *listSize)
1538 : {
1539 0 : return HCCL_SUCCESS;
1540 : }
1541 :
1542 0 : HcclResult HcclCommunicator::GetTopoInstsByLayer(uint32_t netLayer, uint32_t **topoInsts, uint32_t *topoInstNum)
1543 : {
1544 0 : return HCCL_SUCCESS;
1545 : }
1546 0 : HcclResult HcclCommunicator::GetTopoType(uint32_t netLayer, uint32_t topoInstId, CommTopo *topoType)
1547 : {
1548 0 : return HCCL_SUCCESS;
1549 : }
1550 0 : HcclResult HcclCommunicator::GetRanksByTopoInst(uint32_t netLayer, uint32_t topoInstId, uint32_t **ranks, uint32_t *rankNum)
1551 : {
1552 0 : return HCCL_SUCCESS;
1553 : }
1554 0 : HcclResult HcclCommunicator::GetEndpointNum(uint32_t netLayer, uint32_t topoInstId, uint32_t *num)
1555 : {
1556 0 : return HCCL_SUCCESS;
1557 : }
1558 0 : HcclResult HcclCommunicator::GetEndpointDesc(uint32_t netLayer, uint32_t topoInstId, uint32_t *descNum, EndpointDesc *endpointDesc)
1559 : {
1560 0 : return HCCL_SUCCESS;
1561 : }
1562 :
1563 0 : HcclResult HcclCommunicator::GetHeterogMode(HcclHeterogMode *mode)
1564 : {
1565 0 : return HCCL_SUCCESS;
1566 : }
1567 :
1568 0 : HcclResult HcclCommunicator::SnapshotCheckPreProcess()
1569 : {
1570 0 : return HCCL_SUCCESS;
1571 : }
1572 :
1573 0 : HcclResult HcclCommunicator::SnapshotCheckPostProcess()
1574 : {
1575 0 : return HCCL_SUCCESS;
1576 : }
1577 :
1578 0 : void HcclCommunicator::SetReleaseChannel(std::function<HcclResult()> releaseChannel)
1579 : {
1580 0 : return;
1581 : }
1582 :
1583 0 : CCLBufferManager& HcclCommunicator::GetCCLbufferManager()
1584 : {
1585 0 : return cclBufferManager_;
1586 : }
1587 :
1588 0 : void HcclCommunicator::SetHcclQos(u32 hcclQos)
1589 : {
1590 0 : HCCL_INFO("[HcclCommunicator][device][SetHcclQos] hcclQos[%u]", hcclQos);
1591 0 : hcclQos_ = hcclQos;
1592 0 : }
1593 :
1594 0 : u32 HcclCommunicator::GetHcclQos()
1595 : {
1596 0 : HCCL_INFO("[HcclCommunicator][device][GetHcclQos] hcclQos[%u]", hcclQos_);
1597 0 : return hcclQos_;
1598 : }
1599 :
1600 0 : HcclResult HcclCommunicator::InitSymmetricMemory()
1601 : {
1602 0 : return HCCL_SUCCESS;
1603 : }
1604 :
1605 0 : HcclResult HcclCommunicator::RegisterWindow(void* ptr, size_t size, HcclCommSymWindow *winHandle)
1606 : {
1607 0 : return HCCL_SUCCESS;
1608 : }
1609 :
1610 0 : HcclResult HcclCommunicator::DeregisterWindow(HcclCommSymWindow winHandle)
1611 : {
1612 0 : return HCCL_SUCCESS;
1613 : }
1614 :
1615 0 : HcclResult HcclCommunicator::GetCommSymWin(void* ptr, size_t size, HcclCommSymWindow *winHandle, size_t *offset)
1616 : {
1617 0 : return HCCL_SUCCESS;
1618 : }
1619 :
1620 0 : bool HcclCommunicator::EnableAicpuUnfold(bool isCapture)
1621 : {
1622 : (void)isCapture;
1623 0 : return false;
1624 : }
1625 :
1626 0 : HcclResult ReAllocScratchMemForAlltoall(HcclCMDType opType, const OpParam &opParam,
1627 : AlgResourceRequest &resRequest, AlgResourceResponse &algResResponse)
1628 : {
1629 0 : return HCCL_SUCCESS;
1630 : }
1631 :
1632 0 : HcclResult HcclCommunicator::HandleExistAlgResource(const std::string& newTag, const std::string& algName,
1633 : HcclCMDType opType, const OpParam& opParam, std::unique_ptr<CollAlgOperator>& algOperator,
1634 : bool selectAivAlg, bool aicpuUnfoldModeFor910B, bool needRecreateAlltoallComm)
1635 : {
1636 0 : return HCCL_SUCCESS;
1637 : }
1638 :
1639 0 : HcclResult HcclCommunicator::InitMyRankConnectMode(HcclCommParams ¶ms, const RankTable_t &rankTable)
1640 : {
1641 0 : return HCCL_SUCCESS;
1642 : }
1643 0 : uint32_t HcclCommunicator::GetConnectMode()
1644 : {
1645 0 : return HCCL_SUCCESS;
1646 : }
1647 : }
|