2020-02-03 22:06:44 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
|
|
|
|
|
* Modifications Copyright (c) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* See LICENSE.txt for license information
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef UTILS_H_
|
|
|
|
|
#define UTILS_H_
|
|
|
|
|
|
|
|
|
|
struct allGather1Data_t {
|
|
|
|
|
struct ncclPeerInfo peerInfo;
|
|
|
|
|
struct ncclComm* comm;
|
2020-12-01 11:33:47 -05:00
|
|
|
int cudaCompCap;
|
2020-02-03 22:06:44 +00:00
|
|
|
};
|
|
|
|
|
|
2020-03-03 11:42:40 -08:00
|
|
|
// AllGather3 - begin
|
|
|
|
|
struct ncclGraphInfo {
|
2020-12-01 11:33:47 -05:00
|
|
|
int pattern;
|
2021-04-30 16:57:36 -07:00
|
|
|
int nChannels;
|
2020-03-03 11:42:40 -08:00
|
|
|
int sameChannels;
|
|
|
|
|
float speedIntra;
|
|
|
|
|
float speedInter;
|
|
|
|
|
int typeIntra;
|
2020-12-01 11:33:47 -05:00
|
|
|
int typeInter;
|
2020-03-03 11:42:40 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct allGather3Data_t{
|
2021-04-30 16:57:36 -07:00
|
|
|
int collNetSupport;
|
2021-04-05 17:51:56 -07:00
|
|
|
int nc;
|
2020-03-03 11:42:40 -08:00
|
|
|
struct ncclGraphInfo tree;
|
|
|
|
|
struct ncclGraphInfo ring;
|
|
|
|
|
struct ncclGraphInfo collNet;
|
2020-02-03 22:06:44 +00:00
|
|
|
struct ncclTopoRanks topoRanks;
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-25 20:59:32 -07:00
|
|
|
void initCollNet();
|
|
|
|
|
|
2020-03-03 11:42:40 -08:00
|
|
|
ncclResult_t ncclTopoGetSystem(const char* xmlTopoFile, struct ncclTopoSystem** system);
|
|
|
|
|
|
|
|
|
|
ncclResult_t ncclTopoGetSystemFromXml(struct ncclXml* xml, struct ncclTopoSystem** topoSystem);
|
|
|
|
|
|
2020-02-03 22:06:44 +00:00
|
|
|
ncclResult_t bootstrapAllGather(struct ncclComm* comm, struct allGather1Data_t * allGather1Data);
|
|
|
|
|
|
2020-03-03 11:42:40 -08:00
|
|
|
ncclResult_t initTransportsRank_1(struct ncclComm* comm, struct allGather1Data_t *allGather1Data, struct allGather3Data_t *allGather3Data,
|
|
|
|
|
struct ncclTopoGraph& treeGraph, struct ncclTopoGraph& ringGraph, struct ncclTopoGraph& collNetGraph);
|
2020-02-03 22:06:44 +00:00
|
|
|
|
|
|
|
|
ncclResult_t initTransportsRank_3(struct ncclComm* comm, struct allGather3Data_t *allGather3Data,
|
2020-03-03 11:42:40 -08:00
|
|
|
struct ncclTopoGraph& treeGraph, struct ncclTopoGraph& ringGraph, struct ncclTopoGraph& collNetGraph);
|
2020-02-03 22:06:44 +00:00
|
|
|
|
|
|
|
|
#endif
|