已合并
MC2支持单卡多进程 #1880
jl1431创建于 4月23日
MC2支持单卡多进程 #1880
已合并
共 11 个文件变更+185-41
| @@ -1057,7 +1057,13 @@ HcclResult CommBase::GetIntraRankIPInfo(std::map<u32, HcclSocketRole> &rankRole, | |||
| 1057 | HcclRankLinkInfo linkInfo {}; | 1057 | HcclRankLinkInfo linkInfo {}; |
| 1058 | linkInfo.userRank = paraVector_[dstRank].userRank; | 1058 | linkInfo.userRank = paraVector_[dstRank].userRank; |
| 1059 | linkInfo.devicePhyId = dstDeviceId; | 1059 | linkInfo.devicePhyId = dstDeviceId; |
| 1060 | - linkInfo.port = GetNicPort(paraVector_[dstRank].devicePhyId, ranksPort_, linkInfo.userRank, isUseRankPort_); | 1060 | + if (vnicRanksPort_.empty() || (userRankSize > 1 && IsSupportMC2(tag_) >= MC2_PLANE_MODE_COMBINE)) { |
| 1061 | + linkInfo.port = GetNicPort(paraVector_[dstRank].devicePhyId, ranksPort_, | ||
| 1062 | + linkInfo.userRank, isUseRankPort_); | ||
| 1063 | + } else { | ||
| 1064 | + linkInfo.port = GetNicPort(paraVector_[dstRank].devicePhyId, vnicRanksPort_, | ||
| 1065 | + linkInfo.userRank, isUseRankPort_); | ||
| 1066 | + } | ||
| 1061 | HcclIpAddress ipAddress(linkInfo.devicePhyId); | 1067 | HcclIpAddress ipAddress(linkInfo.devicePhyId); |
| 1062 | DeviceIdType deviceidType = | 1068 | DeviceIdType deviceidType = |
| 1063 | useSuperPodMode_ ? (DeviceIdType::DEVICE_ID_TYPE_SDID) : (DeviceIdType::DEVICE_ID_TYPE_PHY_ID); | 1069 | useSuperPodMode_ ? (DeviceIdType::DEVICE_ID_TYPE_SDID) : (DeviceIdType::DEVICE_ID_TYPE_PHY_ID); |
| @@ -1111,7 +1117,11 @@ HcclResult CommBase::GetIntraRankIPInfo(std::vector<u32> &dstIntraVec, | |||
| 1111 | linkInfo.userRank = rankInfo.userRank; | 1117 | linkInfo.userRank = rankInfo.userRank; |
| 1112 | linkInfo.devicePhyId = rankInfo.devicePhyId; | 1118 | linkInfo.devicePhyId = rankInfo.devicePhyId; |
| 1113 | linkInfo.ip = isHaveCpuRank_ ? rankInfo.hostIp : rankInfo.nicIp[0]; | 1119 | linkInfo.ip = isHaveCpuRank_ ? rankInfo.hostIp : rankInfo.nicIp[0]; |
| 1114 | - linkInfo.port = GetNicPort(linkInfo.devicePhyId, ranksPort_, linkInfo.userRank, isUseRankPort_); | 1120 | + if (!vnicRanksPort_.empty()) { |
| 1121 | + linkInfo.port = GetNicPort(linkInfo.devicePhyId, vnicRanksPort_, linkInfo.userRank, isUseRankPort_); | ||
| 1122 | + } else { | ||
| 1123 | + linkInfo.port = GetNicPort(linkInfo.devicePhyId, ranksPort_, linkInfo.userRank, isUseRankPort_); | ||
| 1124 | + } | ||
| 1115 | linkInfo.socketsPerLink = 1; | 1125 | linkInfo.socketsPerLink = 1; |
| 1116 | 1126 | ||
| 1117 | HcclSocketRole localRole; | 1127 | HcclSocketRole localRole; |
| @@ -1151,7 +1161,13 @@ HcclResult CommBase::GetSuperNodeIntraRankIPInfo(std::map<u32, HcclSocketRole> & | |||
| 1151 | linkInfo.devicePhyId = -1; | 1161 | linkInfo.devicePhyId = -1; |
| 1152 | linkInfo.ip = ipAddr; | 1162 | linkInfo.ip = ipAddr; |
| 1153 | CHK_RET(GetRankByUserRank(linkInfo.userRank, dstRank)); | 1163 | CHK_RET(GetRankByUserRank(linkInfo.userRank, dstRank)); |
| 1154 | - linkInfo.port = GetNicPort(paraVector_[dstRank].devicePhyId, ranksPort_, linkInfo.userRank, isUseRankPort_); | 1164 | + if (!vnicRanksPort_.empty()) { |
| 1165 | + linkInfo.port = GetNicPort(paraVector_[dstRank].devicePhyId, vnicRanksPort_, | ||
| 1166 | + linkInfo.userRank, isUseRankPort_); | ||
| 1167 | + } else { | ||
| 1168 | + linkInfo.port = GetNicPort(paraVector_[dstRank].devicePhyId, ranksPort_, | ||
| 1169 | + linkInfo.userRank, isUseRankPort_); | ||
| 1170 | + } | ||
| 1155 | linkInfo.socketsPerLink = 1; | 1171 | linkInfo.socketsPerLink = 1; |
| 1156 | 1172 | ||
| 1157 | HCCL_DEBUG("[Get][SuperNodeIntraRankIPInfo] userRank[%u], destRank[%u], localRole[%d], port[%u], ip[%s]", | 1173 | HCCL_DEBUG("[Get][SuperNodeIntraRankIPInfo] userRank[%u], destRank[%u], localRole[%d], port[%u], ip[%s]", |
| @@ -1189,10 +1205,11 @@ void CommBase::SetMachineLinkMode(MachinePara &machinePara) | |||
| 1189 | 1205 | ||
| 1190 | HcclResult CommBase::SetHDCModeInfo( | 1206 | HcclResult CommBase::SetHDCModeInfo( |
| 1191 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 1207 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 1192 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort) | 1208 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort) |
| 1193 | { | 1209 | { |
| 1194 | rankDevicePhyIdNicInfoMap_ = rankDevicePhyIdNicInfoMap; | 1210 | rankDevicePhyIdNicInfoMap_ = rankDevicePhyIdNicInfoMap; |
| 1195 | ranksPort_ = ranksPort; | 1211 | ranksPort_ = ranksPort; |
| 1212 | + vnicRanksPort_ = vnicRanksPort; | ||
| 1196 | isSetHDCModeInfo_ = isSetHDCModeInfo; | 1213 | isSetHDCModeInfo_ = isSetHDCModeInfo; |
| 1197 | isUseRankPort_ = isUseRankPort; | 1214 | isUseRankPort_ = isUseRankPort; |
| 1198 | return HCCL_SUCCESS; | 1215 | return HCCL_SUCCESS; |
| @@ -307,7 +307,8 @@ HcclResult CommFactory::CreateCommRing(const std::string &tag, const DeviceMem & | |||
| 307 | if (JudgmentSetHeterogP2p(rank)) { | 307 | if (JudgmentSetHeterogP2p(rank)) { |
| 308 | commVec[ringIndex]->SetHeterogP2PType(); | 308 | commVec[ringIndex]->SetHeterogP2PType(); |
| 309 | } | 309 | } |
| 310 | - commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, isSetHDCModeInfo_, isUseRankPort_); | 310 | + commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, |
| 311 | + vnicRanksPort_, isSetHDCModeInfo_, isUseRankPort_); | ||
| 311 | if (commVec[ringIndex]->Init() != HCCL_SUCCESS) { | 312 | if (commVec[ringIndex]->Init() != HCCL_SUCCESS) { |
| 312 | HCCL_ERROR("[Create][CommRing]comm array[%u] init failed", ringIndex); | 313 | HCCL_ERROR("[Create][CommRing]comm array[%u] init failed", ringIndex); |
| 313 | commVec[ringIndex].reset(nullptr); | 314 | commVec[ringIndex].reset(nullptr); |
| @@ -363,7 +364,8 @@ HcclResult CommFactory::CreateCommHD(const std::string &tag, const DeviceMem &in | |||
| 363 | if (JudgmentSetHeterogP2p(rank)) { | 364 | if (JudgmentSetHeterogP2p(rank)) { |
| 364 | commVec[ringIndex]->SetHeterogP2PType(); | 365 | commVec[ringIndex]->SetHeterogP2PType(); |
| 365 | } | 366 | } |
| 366 | - commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, isSetHDCModeInfo_, isUseRankPort_); | 367 | + commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, |
| 368 | + vnicRanksPort_, isSetHDCModeInfo_, isUseRankPort_); | ||
| 367 | if (commVec[ringIndex]->Init() != HCCL_SUCCESS) { | 369 | if (commVec[ringIndex]->Init() != HCCL_SUCCESS) { |
| 368 | HCCL_ERROR("[create][CommHD]comm array[%u] init failed", ringIndex); | 370 | HCCL_ERROR("[create][CommHD]comm array[%u] init failed", ringIndex); |
| 369 | commVec[ringIndex].reset(nullptr); | 371 | commVec[ringIndex].reset(nullptr); |
| @@ -397,7 +399,8 @@ HcclResult CommFactory::CreateCommStar(const std::string &tag, const DeviceMem & | |||
| 397 | 399 | ||
| 398 | CHK_PRT_RET(!commVec[ringIndex], HCCL_ERROR("[create][CommStar]comm array[%u] reset failed", | 400 | CHK_PRT_RET(!commVec[ringIndex], HCCL_ERROR("[create][CommStar]comm array[%u] reset failed", |
| 399 | ringIndex), HCCL_E_PARA); | 401 | ringIndex), HCCL_E_PARA); |
| 400 | - commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, isSetHDCModeInfo_, isUseRankPort_); | 402 | + commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, |
| 403 | + vnicRanksPort_, isSetHDCModeInfo_, isUseRankPort_); | ||
| 401 | 404 | ||
| 402 | if (JudgmentSetHeterogP2p(userRank_)) { | 405 | if (JudgmentSetHeterogP2p(userRank_)) { |
| 403 | commVec[ringIndex]->SetHeterogP2PType(); | 406 | commVec[ringIndex]->SetHeterogP2PType(); |
| @@ -451,7 +454,8 @@ HcclResult CommFactory::CreateCommMesh(const std::string &tag, const DeviceMem & | |||
| 451 | if (JudgmentSetHeterogP2p(rank)) { | 454 | if (JudgmentSetHeterogP2p(rank)) { |
| 452 | commVec[ringIndex]->SetHeterogP2PType(); | 455 | commVec[ringIndex]->SetHeterogP2PType(); |
| 453 | } | 456 | } |
| 454 | - commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, isSetHDCModeInfo_, isUseRankPort_); | 457 | + commVec[ringIndex]->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, |
| 458 | + vnicRanksPort_, isSetHDCModeInfo_, isUseRankPort_); | ||
| 455 | if (commVec[ringIndex]->Init() != HCCL_SUCCESS) { | 459 | if (commVec[ringIndex]->Init() != HCCL_SUCCESS) { |
| 456 | HCCL_ERROR("[Create][CommMesh]comm array[%u] init failed", ringIndex); | 460 | HCCL_ERROR("[Create][CommMesh]comm array[%u] init failed", ringIndex); |
| 457 | commVec[ringIndex].reset(nullptr); | 461 | commVec[ringIndex].reset(nullptr); |
| @@ -718,10 +722,11 @@ bool CommFactory::JudgmentSetHeterogP2p(u32 rank) const | |||
| 718 | 722 | ||
| 719 | HcclResult CommFactory::SetHDCModeInfo( | 723 | HcclResult CommFactory::SetHDCModeInfo( |
| 720 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 724 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 721 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort) | 725 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort) |
| 722 | { | 726 | { |
| 723 | rankDevicePhyIdNicInfoMap_ = rankDevicePhyIdNicInfoMap; | 727 | rankDevicePhyIdNicInfoMap_ = rankDevicePhyIdNicInfoMap; |
| 724 | ranksPort_ = ranksPort; | 728 | ranksPort_ = ranksPort; |
| 729 | + vnicRanksPort_ = vnicRanksPort; | ||
| 725 | isSetHDCModeInfo_ = isSetHDCModeInfo; | 730 | isSetHDCModeInfo_ = isSetHDCModeInfo; |
| 726 | isUseRankPort_ = isUseRankPort; | 731 | isUseRankPort_ = isUseRankPort; |
| 727 | return HCCL_SUCCESS; | 732 | return HCCL_SUCCESS; |
| @@ -70,7 +70,7 @@ public: | |||
| 70 | u32 GetLevel1CommRank(const u32 ringIdx); | 70 | u32 GetLevel1CommRank(const u32 ringIdx); |
| 71 | HcclResult SetHDCModeInfo( | 71 | HcclResult SetHDCModeInfo( |
| 72 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 72 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 73 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort); | 73 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort); |
| 74 | 74 | ||
| 75 | protected: | 75 | protected: |
| 76 | /* 禁止用户对工厂类的实体做拷贝构造或拷贝赋值的操作,内部有指针成员变量 */ | 76 | /* 禁止用户对工厂类的实体做拷贝构造或拷贝赋值的操作,内部有指针成员变量 */ |
| @@ -160,6 +160,7 @@ private: | |||
| 160 | std::vector<u32> ranksPort_; | 160 | std::vector<u32> ranksPort_; |
| 161 | bool isSetHDCModeInfo_ { false }; | 161 | bool isSetHDCModeInfo_ { false }; |
| 162 | bool isUseRankPort_{ false }; | 162 | bool isUseRankPort_{ false }; |
| 163 | + std::vector<u32> vnicRanksPort_; | ||
| 163 | }; | 164 | }; |
| 164 | } // namespace hccl | 165 | } // namespace hccl |
| 165 | 166 | ||
| @@ -120,7 +120,7 @@ public: | |||
| 120 | HcclResult BuildQuerry(u32& status); | 120 | HcclResult BuildQuerry(u32& status); |
| 121 | HcclResult SetHDCModeInfo( | 121 | HcclResult SetHDCModeInfo( |
| 122 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 122 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 123 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort); | 123 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort); |
| 124 | u32 IsSupportMC2(const std::string &tag); | 124 | u32 IsSupportMC2(const std::string &tag); |
| 125 | void Break() | 125 | void Break() |
| 126 | { | 126 | { |
| @@ -177,6 +177,7 @@ protected: | |||
| 177 | std::vector<TransportType> transportType_; | 177 | std::vector<TransportType> transportType_; |
| 178 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> rankDevicePhyIdNicInfoMap_; | 178 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> rankDevicePhyIdNicInfoMap_; |
| 179 | std::vector<u32> ranksPort_; | 179 | std::vector<u32> ranksPort_; |
| 180 | + std::vector<u32> vnicRanksPort_; | ||
| 180 | 181 | ||
| 181 | s32 deviceLogicId_; | 182 | s32 deviceLogicId_; |
| 182 | u32 devicePhyId_; | 183 | u32 devicePhyId_; |
| @@ -347,9 +347,9 @@ void HcclAlg::Break() | |||
| 347 | 347 | ||
| 348 | HcclResult HcclAlg::SetHDCModeInfo( | 348 | HcclResult HcclAlg::SetHDCModeInfo( |
| 349 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 349 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 350 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort) | 350 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort) |
| 351 | { | 351 | { |
| 352 | - pimpl_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap, ranksPort, isSetHDCModeInfo, isUseRankPort); | 352 | + pimpl_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap, ranksPort, vnicRanksPort, isSetHDCModeInfo, isUseRankPort); |
| 353 | return HCCL_SUCCESS; | 353 | return HCCL_SUCCESS; |
| 354 | } | 354 | } |
| 355 | 355 | ||
| @@ -269,10 +269,11 @@ namespace hccl | |||
| 269 | 269 | ||
| 270 | HcclResult HcclAlg::SetHDCModeInfo( | 270 | HcclResult HcclAlg::SetHDCModeInfo( |
| 271 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 271 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 272 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort) | 272 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort) |
| 273 | { | 273 | { |
| 274 | (void) rankDevicePhyIdNicInfoMap; | 274 | (void) rankDevicePhyIdNicInfoMap; |
| 275 | (void) ranksPort; | 275 | (void) ranksPort; |
| 276 | + (void) vnicRanksPort; | ||
| 276 | (void) isSetHDCModeInfo; | 277 | (void) isSetHDCModeInfo; |
| 277 | (void) isUseRankPort; | 278 | (void) isUseRankPort; |
| 278 | return HCCL_SUCCESS; | 279 | return HCCL_SUCCESS; |
| @@ -505,7 +505,8 @@ HcclResult hcclImpl::CreateCommByAlg(const std::string &tag, const AlgType algTy | |||
| 505 | DeviceMem &inputMem, DeviceMem &outputMem, DeviceMem &expMem, u32 root, bool isAicpuModeEn, bool meshSinglePlane, bool isA2MC2MultiServer) | 505 | DeviceMem &inputMem, DeviceMem &outputMem, DeviceMem &expMem, u32 root, bool isAicpuModeEn, bool meshSinglePlane, bool isA2MC2MultiServer) |
| 506 | { | 506 | { |
| 507 | CHK_RET(algConfigurator_->CheckAlgType(algType)); | 507 | CHK_RET(algConfigurator_->CheckAlgType(algType)); |
| 508 | - CHK_RET(commFactory_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, isSetHDCModeInfo_, isUseRankPort_)); | 508 | + CHK_RET(commFactory_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPort_, |
| 509 | + vnicRanksPort_, isSetHDCModeInfo_, isUseRankPort_)); | ||
| 509 | 510 | ||
| 510 | HcclResult commThreadWaitResultLevel0 = HCCL_SUCCESS; | 511 | HcclResult commThreadWaitResultLevel0 = HCCL_SUCCESS; |
| 511 | HcclResult commThreadWaitResultLevel0Rdma = HCCL_SUCCESS; | 512 | HcclResult commThreadWaitResultLevel0Rdma = HCCL_SUCCESS; |
| @@ -801,10 +802,11 @@ HcclResult hcclImpl::SetRankPortInfo(s32 deviceLogicID, bool isUseRankPort, std: | |||
| 801 | 802 | ||
| 802 | void hcclImpl::SetHDCModeInfo( | 803 | void hcclImpl::SetHDCModeInfo( |
| 803 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 804 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 804 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort) | 805 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort) |
| 805 | { | 806 | { |
| 806 | rankDevicePhyIdNicInfoMap_ = rankDevicePhyIdNicInfoMap; | 807 | rankDevicePhyIdNicInfoMap_ = rankDevicePhyIdNicInfoMap; |
| 807 | ranksPort_ = ranksPort; | 808 | ranksPort_ = ranksPort; |
| 809 | + vnicRanksPort_ = vnicRanksPort; | ||
| 808 | isSetHDCModeInfo_ = isSetHDCModeInfo; | 810 | isSetHDCModeInfo_ = isSetHDCModeInfo; |
| 809 | isUseRankPort_ = isUseRankPort; | 811 | isUseRankPort_ = isUseRankPort; |
| 810 | } | 812 | } |
| @@ -152,7 +152,7 @@ namespace hccl | |||
| 152 | 152 | ||
| 153 | void SetHDCModeInfo( | 153 | void SetHDCModeInfo( |
| 154 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 154 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 155 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort); | 155 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort); |
| 156 | 156 | ||
| 157 | private: | 157 | private: |
| 158 | void SetAlgoAttr(HcclAlgoAttr &algoAttr); | 158 | void SetAlgoAttr(HcclAlgoAttr &algoAttr); |
| @@ -265,6 +265,7 @@ namespace hccl | |||
| 265 | std::vector<u32> ranksPort_; | 265 | std::vector<u32> ranksPort_; |
| 266 | bool isSetHDCModeInfo_{false}; | 266 | bool isSetHDCModeInfo_{false}; |
| 267 | bool isUseRankPort_{false}; | 267 | bool isUseRankPort_{false}; |
| 268 | + std::vector<u32> vnicRanksPort_; | ||
| 268 | bool isSupportRdmaLite_{false}; // 是否支持rdma lite | 269 | bool isSupportRdmaLite_{false}; // 是否支持rdma lite |
| 269 | bool isSupportHccsAndSio_{false}; // 是否支持hccs sio并发 | 270 | bool isSupportHccsAndSio_{false}; // 是否支持hccs sio并发 |
| 270 | 271 | ||
| @@ -63,7 +63,7 @@ public: | |||
| 63 | HcclResult SupportDeterministicOptim(bool &isDeterministicOptim); | 63 | HcclResult SupportDeterministicOptim(bool &isDeterministicOptim); |
| 64 | HcclResult SetHDCModeInfo( | 64 | HcclResult SetHDCModeInfo( |
| 65 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, | 65 | std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &rankDevicePhyIdNicInfoMap, |
| 66 | - std::vector<u32> &ranksPort, bool isSetHDCModeInfo, bool isUseRankPort); | 66 | + std::vector<u32> &ranksPort, std::vector<u32> &vnicRanksPort, bool isSetHDCModeInfo, bool isUseRankPort); |
| 67 | 67 | ||
| 68 | u8 GetDeterministicConfig() const; // 获取确定性计算配置 | 68 | u8 GetDeterministicConfig() const; // 获取确定性计算配置 |
| 69 | HcclResult SetDeterministicConfig(const u8 deterministic); // 设置确定性计算配置 | 69 | HcclResult SetDeterministicConfig(const u8 deterministic); // 设置确定性计算配置 |
| @@ -2534,7 +2534,9 @@ namespace hccl | |||
| 2534 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 2534 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 2535 | 2535 | ||
| 2536 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 2536 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 2537 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 2537 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 2538 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 2539 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 2538 | 2540 | ||
| 2539 | u32 perDataSize = SIZE_TABLE[dataType]; | 2541 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 2540 | u64 totalSize = inputCount * perDataSize; | 2542 | u64 totalSize = inputCount * perDataSize; |
| @@ -2579,7 +2581,9 @@ namespace hccl | |||
| 2579 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 2581 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 2580 | 2582 | ||
| 2581 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 2583 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 2582 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 2584 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 2585 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 2586 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 2583 | 2587 | ||
| 2584 | u32 perDataSize = SIZE_TABLE[dataType]; | 2588 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 2585 | u64 totalSize = sendCount * perDataSize; | 2589 | u64 totalSize = sendCount * perDataSize; |
| @@ -2703,7 +2707,9 @@ namespace hccl | |||
| 2703 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 2707 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 2704 | 2708 | ||
| 2705 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 2709 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 2706 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 2710 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 2711 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 2712 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 2707 | 2713 | ||
| 2708 | u32 perDataSize = SIZE_TABLE[dataType]; | 2714 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 2709 | u64 totalSize = inputCount * perDataSize * userRankSize_; | 2715 | u64 totalSize = inputCount * perDataSize * userRankSize_; |
| @@ -2757,7 +2763,9 @@ namespace hccl | |||
| 2757 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 2763 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 2758 | 2764 | ||
| 2759 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 2765 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 2760 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 2766 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 2767 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 2768 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 2761 | 2769 | ||
| 2762 | u32 perDataSize = SIZE_TABLE[dataType]; | 2770 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 2763 | u64 outputSize = 0; | 2771 | u64 outputSize = 0; |
| @@ -2844,7 +2852,9 @@ namespace hccl | |||
| 2844 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 2852 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 2845 | 2853 | ||
| 2846 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 2854 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 2847 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 2855 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 2856 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 2857 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 2848 | 2858 | ||
| 2849 | u32 perDataSize = SIZE_TABLE[dataType]; | 2859 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 2850 | u64 totalSize = count * perDataSize; | 2860 | u64 totalSize = count * perDataSize; |
| @@ -2975,7 +2985,9 @@ namespace hccl | |||
| 2975 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 2985 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 2976 | 2986 | ||
| 2977 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 2987 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 2978 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 2988 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 2989 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 2990 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 2979 | 2991 | ||
| 2980 | u32 perDataSize = SIZE_TABLE[dataType]; | 2992 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 2981 | u64 totalSize = count * perDataSize; | 2993 | u64 totalSize = count * perDataSize; |
| @@ -3026,7 +3038,9 @@ namespace hccl | |||
| 3026 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3038 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3027 | 3039 | ||
| 3028 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3040 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3029 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3041 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3042 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3043 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3030 | 3044 | ||
| 3031 | OpParam opParam; | 3045 | OpParam opParam; |
| 3032 | opParam.tag = tag; | 3046 | opParam.tag = tag; |
| @@ -3085,7 +3099,9 @@ namespace hccl | |||
| 3085 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3099 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3086 | 3100 | ||
| 3087 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3101 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3088 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3102 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3103 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3104 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3089 | 3105 | ||
| 3090 | OpParam opParam; | 3106 | OpParam opParam; |
| 3091 | opParam.tag = tag; | 3107 | opParam.tag = tag; |
| @@ -3145,7 +3161,9 @@ namespace hccl | |||
| 3145 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3161 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3146 | 3162 | ||
| 3147 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3163 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3148 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3164 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3165 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3166 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3149 | 3167 | ||
| 3150 | OpParam opParam; | 3168 | OpParam opParam; |
| 3151 | opParam.tag = tag; | 3169 | opParam.tag = tag; |
| @@ -3200,7 +3218,9 @@ namespace hccl | |||
| 3200 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3218 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3201 | 3219 | ||
| 3202 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3220 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3203 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3221 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3222 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3223 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3204 | 3224 | ||
| 3205 | OpParam opParam; | 3225 | OpParam opParam; |
| 3206 | opParam.tag = tag; | 3226 | opParam.tag = tag; |
| @@ -3272,7 +3292,9 @@ namespace hccl | |||
| 3272 | } | 3292 | } |
| 3273 | 3293 | ||
| 3274 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3294 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3275 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3295 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3296 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3297 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3276 | CHK_RET(ExecOpAlltoAll(HcclCMDType::HCCL_CMD_ALLTOALL, opParam)); | 3298 | CHK_RET(ExecOpAlltoAll(HcclCMDType::HCCL_CMD_ALLTOALL, opParam)); |
| 3277 | return HCCL_SUCCESS; | 3299 | return HCCL_SUCCESS; |
| 3278 | } | 3300 | } |
| @@ -3296,7 +3318,9 @@ namespace hccl | |||
| 3296 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3318 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3297 | 3319 | ||
| 3298 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3320 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3299 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3321 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3322 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3323 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3300 | u32 perDataSize = SIZE_TABLE[dataType]; | 3324 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3301 | u64 totalSize = count * perDataSize; | 3325 | u64 totalSize = count * perDataSize; |
| 3302 | 3326 | ||
| @@ -3345,7 +3369,9 @@ namespace hccl | |||
| 3345 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3369 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3346 | 3370 | ||
| 3347 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3371 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3348 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3372 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3373 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3374 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3349 | 3375 | ||
| 3350 | u32 perDataSize = SIZE_TABLE[dataType]; | 3376 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3351 | u64 totalSize = count * perDataSize; | 3377 | u64 totalSize = count * perDataSize; |
| @@ -3394,7 +3420,9 @@ namespace hccl | |||
| 3394 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3420 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3395 | 3421 | ||
| 3396 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3422 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3397 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3423 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3424 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3425 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3398 | 3426 | ||
| 3399 | u32 perDataSize = SIZE_TABLE[dataType]; | 3427 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3400 | u64 outputSize = recvCount * perDataSize; | 3428 | u64 outputSize = recvCount * perDataSize; |
| @@ -3445,7 +3473,9 @@ namespace hccl | |||
| 3445 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3473 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3446 | 3474 | ||
| 3447 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3475 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3448 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3476 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3477 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3478 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3449 | 3479 | ||
| 3450 | u32 perDataSize = SIZE_TABLE[dataType]; | 3480 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3451 | u64 outputSize = recvCount * perDataSize; | 3481 | u64 outputSize = recvCount * perDataSize; |
| @@ -3544,7 +3574,9 @@ namespace hccl | |||
| 3544 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3574 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3545 | 3575 | ||
| 3546 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3576 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3547 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3577 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3578 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3579 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3548 | 3580 | ||
| 3549 | u32 perDataSize = SIZE_TABLE[dataType]; | 3581 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3550 | u64 totalSize = count * perDataSize; | 3582 | u64 totalSize = count * perDataSize; |
| @@ -3591,7 +3623,9 @@ namespace hccl | |||
| 3591 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3623 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3592 | 3624 | ||
| 3593 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3625 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3594 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3626 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3627 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3628 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3595 | 3629 | ||
| 3596 | u32 perDataSize = SIZE_TABLE[dataType]; | 3630 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3597 | 3631 | ||
| @@ -3655,7 +3689,9 @@ namespace hccl | |||
| 3655 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3689 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3656 | 3690 | ||
| 3657 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3691 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3658 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3692 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3693 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3694 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3659 | 3695 | ||
| 3660 | u32 perDataSize = SIZE_TABLE[dataType]; | 3696 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3661 | 3697 | ||
| @@ -3701,7 +3737,9 @@ namespace hccl | |||
| 3701 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3737 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3702 | 3738 | ||
| 3703 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3739 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3704 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3740 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3741 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3742 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3705 | 3743 | ||
| 3706 | const bool aicpuUnfoldMode = GetAicpuUnfoldConfig() && | 3744 | const bool aicpuUnfoldMode = GetAicpuUnfoldConfig() && |
| 3707 | IsSupportSDMAReduce(inputPtr, outputPtr, dataType, op) && (deviceType_ == DevType::DEV_TYPE_910_93); | 3745 | IsSupportSDMAReduce(inputPtr, outputPtr, dataType, op) && (deviceType_ == DevType::DEV_TYPE_910_93); |
| @@ -3767,7 +3805,9 @@ namespace hccl | |||
| 3767 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3805 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3768 | 3806 | ||
| 3769 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3807 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3770 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3808 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3809 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3810 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3771 | 3811 | ||
| 3772 | const bool aicpuUnfoldMode = GetAicpuUnfoldConfig() && | 3812 | const bool aicpuUnfoldMode = GetAicpuUnfoldConfig() && |
| 3773 | IsSupportSDMAReduce(inputPtr, outputPtr, dataType, op) && (deviceType_ == DevType::DEV_TYPE_910_93); | 3813 | IsSupportSDMAReduce(inputPtr, outputPtr, dataType, op) && (deviceType_ == DevType::DEV_TYPE_910_93); |
| @@ -3839,7 +3879,9 @@ namespace hccl | |||
| 3839 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3879 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3840 | 3880 | ||
| 3841 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3881 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3842 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3882 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3883 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3884 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3843 | OpParam opParam; | 3885 | OpParam opParam; |
| 3844 | opParam.tag = tag; | 3886 | opParam.tag = tag; |
| 3845 | opParam.stream = streamObj; | 3887 | opParam.stream = streamObj; |
| @@ -3928,7 +3970,9 @@ namespace hccl | |||
| 3928 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 3970 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 3929 | 3971 | ||
| 3930 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 3972 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 3931 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 3973 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 3974 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 3975 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 3932 | 3976 | ||
| 3933 | u32 perDataSize = SIZE_TABLE[dataType]; | 3977 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 3934 | u64 totalSize = count * perDataSize; | 3978 | u64 totalSize = count * perDataSize; |
| @@ -4023,7 +4067,9 @@ namespace hccl | |||
| 4023 | CHK_RET(callbackTask_->CallbackRegStream(stream)); | 4067 | CHK_RET(callbackTask_->CallbackRegStream(stream)); |
| 4024 | 4068 | ||
| 4025 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | 4069 | std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; |
| 4026 | - implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, isSetHDCModeInfo_, isUseRankPort_); | 4070 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; |
| 4071 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, | ||
| 4072 | + vnicRanksPorts, isSetHDCModeInfo_, isUseRankPort_); | ||
| 4027 | 4073 | ||
| 4028 | u32 perDataSize = SIZE_TABLE[dataType]; | 4074 | u32 perDataSize = SIZE_TABLE[dataType]; |
| 4029 | u64 totalSize = count * perDataSize; | 4075 | u64 totalSize = count * perDataSize; |
| @@ -7772,6 +7818,10 @@ namespace hccl | |||
| 7772 | // 根据tag创建comm和流资源 | 7818 | // 根据tag创建comm和流资源 |
| 7773 | if (!(IsExistCommRes(tag))) { | 7819 | if (!(IsExistCommRes(tag))) { |
| 7774 | std::unique_ptr<CommInfo> commInfo = nullptr; | 7820 | std::unique_ptr<CommInfo> commInfo = nullptr; |
| 7821 | + std::vector<u32> &ranksPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | ||
| 7822 | + std::vector<u32> &vnicRanksPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; | ||
| 7823 | + implAlg_->SetHDCModeInfo(rankDevicePhyIdNicInfoMap_, ranksPorts, vnicRanksPorts, isSetHDCModeInfo_, | ||
| 7824 | + isUseRankPort_); | ||
| 7775 | HcclResult ret = implAlg_->CreateComm(tag, inputMem, outputMem, algType, commInfo, | 7825 | HcclResult ret = implAlg_->CreateComm(tag, inputMem, outputMem, algType, commInfo, |
| 7776 | INVALID_VALUE_RANKID, false, true); | 7826 | INVALID_VALUE_RANKID, false, true); |
| 7777 | 7827 | ||
| @@ -7820,6 +7870,12 @@ namespace hccl | |||
| 7820 | 7870 | ||
| 7821 | HCCL_INFO("resource creation (AllReduce) success, tag[%s]", tag.c_str()); | 7871 | HCCL_INFO("resource creation (AllReduce) success, tag[%s]", tag.c_str()); |
| 7822 | CHK_RET(notifyPool_->UnregisterOp(tag)); | 7872 | CHK_RET(notifyPool_->UnregisterOp(tag)); |
| 7873 | + if (commPortConfig_.devPortSwitchOn) { | ||
| 7874 | + std::vector<u32> &nicPorts = groupNicRanksPort_.empty() ? nicRanksPort_ : groupNicRanksPort_; | ||
| 7875 | + std::vector<u32> &vnicPorts = groupVnicRanksPort_.empty() ? vnicRanksPort_ : groupVnicRanksPort_; | ||
| 7876 | + Heartbeat::GetInstance(deviceLogicId_).SetRankPortInfo(isUseRankPort_, nicPorts, vnicPorts, | ||
| 7877 | + commPortConfig_.devPortSwitchOn); | ||
| 7878 | + } | ||
| 7823 | CHK_RET(RegisterToHeartBeat()); | 7879 | CHK_RET(RegisterToHeartBeat()); |
| 7824 | 7880 | ||
| 7825 | CommBase *comm = nullptr; | 7881 | CommBase *comm = nullptr; |
| @@ -5393,5 +5393,65 @@ TEST_F(HcclCommTest, hcclComm_SetWorldGroupInfo) | |||
| 5393 | HcclResult ret; | 5393 | HcclResult ret; |
| 5394 | ret = hcclComm.SetWorldGroupInfo(phyIdNicInfoMap, worldRankInfoList, nicRanksPort, vnicRanksPort); | 5394 | ret = hcclComm.SetWorldGroupInfo(phyIdNicInfoMap, worldRankInfoList, nicRanksPort, vnicRanksPort); |
| 5395 | EXPECT_EQ(ret, HCCL_SUCCESS); | 5395 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 5396 | + GlobalMockObject::verify(); | ||
| 5397 | +} | ||
| 5398 | + | ||
| 5399 | +TEST_F(HcclCommTest, hcclComm_AllGatherV_call) | ||
| 5400 | +{ | ||
| 5401 | + MOCKER_CPP(&HcclCommunicator::IsAtomicInit).stubs().will(returnValue(true)); | ||
| 5402 | + MOCKER_CPP(&HcclCommunicator::ExecOp).stubs().with(any(), any()).will(returnValue(HCCL_SUCCESS)); | ||
| 5403 | + MOCKER_CPP(&HcclCallbackTask::CallbackRegStream).stubs().with(any()).will(returnValue(HCCL_SUCCESS)); | ||
| 5404 | + MOCKER_CPP(&HcclCommunicator::StreamIsCapture).stubs().with(any()).will(returnValue(false)); | ||
| 5405 | + MOCKER_CPP(&hcclImpl::SetHDCModeInfo).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 5406 | + | ||
| 5407 | + HcclCommunicator hcclCommunicator; | ||
| 5408 | + CCLBufferManager cclBufferManager; | ||
| 5409 | + HcclDispatcher dispatcher; | ||
| 5410 | + HcclDispatcher vDispatcher; | ||
| 5411 | + hcclCommunicator.implAlg_.reset(new (std::nothrow) HcclAlg(cclBufferManager, dispatcher, vDispatcher)); | ||
| 5412 | + hcclCommunicator.userRankSize_ = 2; | ||
| 5413 | + | ||
| 5414 | + string strTag = "allgatherv_tag_test"; | ||
| 5415 | + int sendBuff[4] = {0}; | ||
| 5416 | + u64 sendCount = 4; | ||
| 5417 | + int recvBuff[8]; | ||
| 5418 | + u64 recvCount[4] = {4,4}; | ||
| 5419 | + u64 rdispls[4] = {4,4}; | ||
| 5420 | + aclrtStream stream; | ||
| 5421 | + aclError ret = aclrtCreateStream(&stream); | ||
| 5422 | + EXPECT_EQ(ret, ACL_SUCCESS); | ||
| 5423 | + ret = hcclCommunicator.AllGatherV(strTag, sendBuff, sendCount, recvBuff, recvCount, rdispls, HcclDataType::HCCL_DATA_TYPE_INT32, stream); | ||
| 5424 | + EXPECT_EQ(ret, HCCL_SUCCESS); | ||
| 5425 | + | ||
| 5426 | + GlobalMockObject::verify(); | ||
| 5427 | +} | ||
| 5428 | + | ||
| 5429 | +TEST_F(HcclCommTest, hcclComm_AllGatherVOutPlace_call) | ||
| 5430 | +{ | ||
| 5431 | + MOCKER_CPP(&HcclCommunicator::IsAtomicInit).stubs().will(returnValue(true)); | ||
| 5432 | + MOCKER_CPP(&HcclCommunicator::ExecOp).stubs().with(any(), any()).will(returnValue(HCCL_SUCCESS)); | ||
| 5433 | + MOCKER_CPP(&HcclCallbackTask::CallbackRegStream).stubs().with(any()).will(returnValue(HCCL_SUCCESS)); | ||
| 5434 | + MOCKER_CPP(&HcclCommunicator::StreamIsCapture).stubs().with(any()).will(returnValue(false)); | ||
| 5435 | + MOCKER_CPP(&hcclImpl::SetHDCModeInfo).stubs().will(returnValue(HCCL_SUCCESS)); | ||
| 5436 | + | ||
| 5437 | + HcclCommunicator hcclCommunicator; | ||
| 5438 | + CCLBufferManager cclBufferManager; | ||
| 5439 | + HcclDispatcher dispatcher; | ||
| 5440 | + HcclDispatcher vDispatcher; | ||
| 5441 | + hcclCommunicator.implAlg_.reset(new (std::nothrow) HcclAlg(cclBufferManager, dispatcher, vDispatcher)); | ||
| 5442 | + hcclCommunicator.userRankSize_ = 2; | ||
| 5443 | + | ||
| 5444 | + string strTag = "allgathervoutplace_tag_test"; | ||
| 5445 | + int sendBuff[4] = {0}; | ||
| 5446 | + u64 sendCount = 4; | ||
| 5447 | + int recvBuff[8]; | ||
| 5448 | + u64 recvCount[4] = {4,4}; | ||
| 5449 | + u64 rdispls[4] = {4,4}; | ||
| 5450 | + aclrtStream stream; | ||
| 5451 | + aclError ret = aclrtCreateStream(&stream); | ||
| 5452 | + EXPECT_EQ(ret, ACL_SUCCESS); | ||
| 5453 | + ret = hcclCommunicator.AllGatherVOutPlace(strTag, sendBuff, recvBuff, sendCount, recvCount, rdispls, HcclDataType::HCCL_DATA_TYPE_INT32, stream); | ||
| 5454 | + EXPECT_EQ(ret, HCCL_SUCCESS); | ||
| 5455 | + | ||
| 5396 | GlobalMockObject::verify(); | 5456 | GlobalMockObject::verify(); |
| 5397 | } | 5457 | } |