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