2020-02-03 22:06:44 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
|
2023-02-04 01:43:38 +00:00
|
|
|
* Modifications Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
|
2020-02-03 22:06:44 +00:00
|
|
|
*
|
|
|
|
|
* See LICENSE.txt for license information
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef UTILS_H_
|
|
|
|
|
#define UTILS_H_
|
|
|
|
|
|
2023-06-21 20:54:24 -07:00
|
|
|
struct graphInfo {
|
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;
|
2022-10-20 15:40:03 +00:00
|
|
|
float bwIntra;
|
|
|
|
|
float bwInter;
|
2020-03-03 11:42:40 -08:00
|
|
|
int typeIntra;
|
2020-12-01 11:33:47 -05:00
|
|
|
int typeInter;
|
2020-03-03 11:42:40 -08:00
|
|
|
};
|
|
|
|
|
|
2023-06-21 20:54:24 -07:00
|
|
|
struct allGatherInfo {
|
|
|
|
|
struct graphInfo graphInfo[NCCL_NUM_ALGORITHMS];
|
2020-02-03 22:06:44 +00:00
|
|
|
struct ncclTopoRanks topoRanks;
|
2023-06-21 20:54:24 -07:00
|
|
|
int nc;
|
2022-09-09 01:20:52 +00:00
|
|
|
bool pivotA2AEnabled;
|
2022-10-20 15:40:03 +00:00
|
|
|
bool ll128Enabled;
|
2023-03-15 05:34:25 +08:00
|
|
|
bool mscclEnabled;
|
2020-02-03 22:06:44 +00:00
|
|
|
};
|
|
|
|
|
|
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);
|
|
|
|
|
|
2022-04-18 11:14:51 -07:00
|
|
|
ncclResult_t fillInfo(struct ncclComm* comm, struct ncclPeerInfo* info, uint64_t commHash);
|
2020-02-03 22:06:44 +00:00
|
|
|
|
2023-06-21 20:54:24 -07:00
|
|
|
ncclResult_t initTransportsRank_1(struct ncclComm* comm, struct allGatherInfo *allGather3Data,
|
|
|
|
|
struct ncclTopoGraph& treeGraph, struct ncclTopoGraph& ringGraph, struct ncclTopoGraph& collNetGraph, struct ncclTopoGraph& nvlsGraph, struct ncclComm* parent = NULL);
|
2020-02-03 22:06:44 +00:00
|
|
|
|
2023-06-21 20:54:24 -07:00
|
|
|
ncclResult_t initTransportsRank_3(struct ncclComm* comm, struct allGatherInfo *allGather3Data,
|
|
|
|
|
struct ncclTopoGraph& treeGraph, struct ncclTopoGraph& ringGraph, struct ncclTopoGraph& collNetGraph, struct ncclTopoGraph& nvlsGraph);
|
2020-02-03 22:06:44 +00:00
|
|
|
|
2023-02-04 01:43:38 +00:00
|
|
|
#define TIME_START(index)
|
|
|
|
|
|
|
|
|
|
#define TIME_STOP(index)
|
|
|
|
|
|
|
|
|
|
#define TIME_CANCEL(index)
|
|
|
|
|
|
|
|
|
|
#define TIME_PRINT(name)
|
|
|
|
|
|
2020-02-03 22:06:44 +00:00
|
|
|
#endif
|