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 "hccl_communicator_attrs.h"
12 :
13 : using namespace std;
14 :
15 : namespace hccl {
16 1 : HcclResult HcclCommunicatorAttrs::Init(HcclCommParams& params, const RankTable_t& rankTable) { return HCCL_SUCCESS; }
17 :
18 0 : HcclResult HcclCommunicatorAttrs::Init(
19 : HcclCommParams& params, const RankTable_t& rankTable,
20 : const std::map<HcclCMDType, std::vector<HcclAlgoType>>& algoConfigMap)
21 : {
22 0 : return HCCL_SUCCESS;
23 : }
24 :
25 1 : HcclResult HcclCommunicatorAttrs::Init(
26 : HcclCommParams& params, const std::vector<RankInfo>& rankList, WorldGroupInfo& groupCommonData)
27 : {
28 1 : return HCCL_SUCCESS;
29 : }
30 :
31 0 : HcclResult HcclCommunicatorAttrs::Init(
32 : HcclCommParams& params, const std::vector<RankInfo>& rankList, WorldGroupInfo& groupCommonData,
33 : const std::map<HcclCMDType, std::vector<HcclAlgoType>>& algoConfigMap)
34 : {
35 0 : return HCCL_SUCCESS;
36 : }
37 :
38 1 : bool HcclCommunicatorAttrs::IsStandardCard() { return false; }
39 :
40 1 : bool HcclCommunicatorAttrs::Is310PDuoCard() { return false; }
41 :
42 1 : bool HcclCommunicatorAttrs::IsCommon310P3DUO(const std::vector<RankInfo_t>& rankList) { return false; }
43 :
44 1 : bool HcclCommunicatorAttrs::CompareWithUserRank(const RankInfo& left, const RankInfo& right) { return false; }
45 :
46 1 : HcclResult HcclCommunicatorAttrs::CheckDeviceType(const DevType deviceType) const { return HCCL_SUCCESS; }
47 :
48 1 : HcclResult HcclCommunicatorAttrs::GetNicInfo(
49 : const NICDeployment& nicDeploy, const u32 curRankIndex, const std::vector<RankInfo_t>& servRankList,
50 : RankInfo& rankInfo) const
51 : {
52 1 : return HCCL_SUCCESS;
53 : }
54 :
55 : // private
56 1 : HcclResult HcclCommunicatorAttrs::InitCommParams(HcclCommParams& params) { return HCCL_SUCCESS; }
57 :
58 1 : HcclResult HcclCommunicatorAttrs::SetServerId(const RankTable_t& rankTable) { return HCCL_SUCCESS; }
59 :
60 1 : HcclResult HcclCommunicatorAttrs::SetServerNum(const std::vector<RankInfo_t>& ranks) { return HCCL_SUCCESS; }
61 :
62 1 : HcclResult HcclCommunicatorAttrs::SetInnerServerAverageDevice(const RankTable_t& rankTable) { return HCCL_SUCCESS; }
63 :
64 : // sub group适配获取server内设配数
65 1 : HcclResult HcclCommunicatorAttrs::SetInnerServerAverageDevice(const std::vector<RankInfo>& rankList)
66 : {
67 1 : return HCCL_SUCCESS;
68 : }
69 :
70 1 : HcclResult HcclCommunicatorAttrs::TransformRankInfoByServerId(
71 : const std::vector<RankInfo_t>& rankList, ServRankInfo& servRankInfo) const
72 : {
73 1 : return HCCL_SUCCESS;
74 : }
75 :
76 1 : bool HcclCommunicatorAttrs::CompareWithDevicePhyId(const RankInfo_t& left, const RankInfo_t& right) { return false; }
77 :
78 1 : HcclResult HcclCommunicatorAttrs::SetModuleInfo(const std::vector<RankInfo_t>& rankList) { return HCCL_SUCCESS; }
79 :
80 1 : HcclResult HcclCommunicatorAttrs::SetSuperPodInfo(const std::vector<RankInfo_t>& rankList) { return HCCL_SUCCESS; }
81 :
82 : // 集群中存在910B A+X时,0-7卡: moduleIdx = 2 * serverIdx; 8-15卡: moduleIdx = 2 * serverIdx + 1
83 : // 集群中不存在910B A+X时,moduleIdx = serverIdx
84 1 : HcclResult HcclCommunicatorAttrs::GetModuleIdx(const RankInfo_t& rankInfo, u32& moduleIdx) { return HCCL_SUCCESS; }
85 :
86 : // 用于标识集群中是否存在 910B A+X形态
87 1 : bool HcclCommunicatorAttrs::IsDiffDeviceModule(const std::vector<RankInfo_t>& rankList) const { return false; }
88 :
89 1 : HcclResult HcclCommunicatorAttrs::InitHccsPortNum() { return HCCL_SUCCESS; }
90 :
91 1 : HcclResult HcclCommunicatorAttrs::SetRankInfoList(const RankTable_t& rankTable) { return HCCL_SUCCESS; }
92 :
93 1 : HcclResult HcclCommunicatorAttrs::CheckRankTable(const RankTable_t& rankTable, const ServRankInfo& servRankInfo)
94 : {
95 1 : return HCCL_SUCCESS;
96 : }
97 :
98 1 : HcclResult HcclCommunicatorAttrs::CheckDevPhyId(const s32& devicePhyId) const { return HCCL_SUCCESS; }
99 :
100 1 : HcclResult HcclCommunicatorAttrs::SortRankInfoList() { return HCCL_SUCCESS; }
101 :
102 1 : HcclResult HcclCommunicatorAttrs::CheckNicDeploy(NICDeployment nicDeploy, DevType deviceType) const
103 : {
104 1 : return HCCL_SUCCESS;
105 : }
106 :
107 1 : HcclResult HcclCommunicatorAttrs::CheckDevCount(const u32 devNum) { return HCCL_SUCCESS; }
108 :
109 1 : bool HcclCommunicatorAttrs::Check2N(u32 num) const { return false; }
110 :
111 1 : HcclResult HcclCommunicatorAttrs::SetLocalRankInfo() { return HCCL_SUCCESS; }
112 :
113 1 : HcclResult HcclCommunicatorAttrs::SetLocalRankInfoSubGroup(const std::vector<RankInfo>& rankList)
114 : {
115 1 : return HCCL_SUCCESS;
116 : }
117 :
118 1 : HcclResult HcclCommunicatorAttrs::CheckLocalRankInfo() { return HCCL_SUCCESS; }
119 :
120 1 : u32 HcclCommunicatorAttrs::CalMeshAggRankSize(int halfDevNum) const { return 0; }
121 :
122 1 : HcclResult HcclCommunicatorAttrs::SetMeshAggregationRankSize(u32 size) { return HCCL_SUCCESS; }
123 :
124 1 : HcclResult HcclCommunicatorAttrs::CalAndSetMeshAggRankSize() { return HCCL_SUCCESS; }
125 :
126 1 : HcclResult HcclCommunicatorAttrs::SetWorldGroupInfo(
127 : std::unordered_map<std::string, std::map<u32, HcclIpAddress>>& phyIdNicInfoMap,
128 : std::vector<RankInfo>& worldRankInfoList, std::vector<u32>& nicRanksPort, std::vector<u32>& vnicRanksPort)
129 : {
130 1 : return HCCL_SUCCESS;
131 : }
132 :
133 : HcclResult
134 1 : HcclCommunicatorAttrs::TransformRankList(const std::vector<RankInfo>& rankListIn, std::vector<RankInfo_t>& rankListOut)
135 : {
136 1 : return HCCL_SUCCESS;
137 : }
138 :
139 1 : bool HcclCommunicatorAttrs::IsEnableRoce() { return false; }
140 :
141 : // a+x mesh间需要同时保证ip有效和roce开关打开才能走rdma
142 1 : bool HcclCommunicatorAttrs::IsUsedRdmaLevel0AndIpInvalid() { return false; }
143 :
144 1 : bool HcclCommunicatorAttrs::IsSupportEnableRoce() { return false; }
145 :
146 1 : void HcclCommunicatorAttrs::GetTopoAttr(HcclTopoAttr& topoAttr) {}
147 :
148 1 : void HcclCommunicatorAttrs::GetAlgoAttr(HcclAlgoAttr& algoAttr) {}
149 :
150 1 : u32 HcclCommunicatorAttrs::GetLocalNicPort(NicType nicType) { return 0; }
151 : } // namespace hccl
|