Files
rocm-systems/src/include/transport.h
T

64 lines
2.1 KiB
C
Raw Normal View History

2018-09-24 16:06:59 -07:00
/*************************************************************************
2021-04-12 16:00:11 -07:00
* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved.
2018-09-24 16:06:59 -07:00
*
* See LICENSE.txt for license information
************************************************************************/
#ifndef NCCL_TRANSPORT_H_
#define NCCL_TRANSPORT_H_
2019-03-14 19:39:20 -07:00
#include "devcomm.h"
2019-11-19 14:57:39 -08:00
#include "graph.h"
2018-12-13 15:56:12 -08:00
#include "nvmlwrap.h"
2019-11-19 14:57:39 -08:00
#include "core.h"
2020-05-12 14:40:18 -07:00
#include "proxy.h"
2018-09-24 16:06:59 -07:00
#define NTRANSPORTS 3
2019-11-19 14:57:39 -08:00
#define TRANSPORT_P2P 0
#define TRANSPORT_SHM 1
#define TRANSPORT_NET 2
2018-09-24 16:06:59 -07:00
extern struct ncclTransport ncclTransports[];
// Forward declarations
struct ncclRing;
struct ncclConnector;
struct ncclComm;
2018-12-13 15:56:12 -08:00
struct ncclPeerInfo {
int rank;
int cudaDev;
2019-11-19 14:57:39 -08:00
int gdrSupport;
2018-12-13 15:56:12 -08:00
uint64_t hostHash;
uint64_t pidHash;
2019-11-19 14:57:39 -08:00
dev_t shmDev;
int64_t busId;
2018-09-24 16:06:59 -07:00
};
#define CONNECT_SIZE 128
struct ncclConnect {
char data[CONNECT_SIZE];
};
struct ncclTransportComm {
2021-04-12 16:00:11 -07:00
ncclResult_t (*setup)(struct ncclComm* comm, struct ncclTopoGraph* graph, struct ncclPeerInfo*, struct ncclPeerInfo*, struct ncclConnect*, struct ncclConnector*, int channelId, int connIndex);
2020-09-04 14:35:05 -07:00
ncclResult_t (*connect)(struct ncclComm* comm, struct ncclConnect*, int nranks, int rank, struct ncclConnector*);
2018-09-24 16:06:59 -07:00
ncclResult_t (*free)(void*);
ncclResult_t (*proxy)(struct ncclProxyArgs*);
};
struct ncclTransport {
const char name[4];
2019-11-19 14:57:39 -08:00
ncclResult_t (*canConnect)(int*, struct ncclTopoSystem* topo, struct ncclTopoGraph* graph, struct ncclPeerInfo*, struct ncclPeerInfo*);
2018-09-24 16:06:59 -07:00
struct ncclTransportComm send;
struct ncclTransportComm recv;
};
2021-04-12 16:00:11 -07:00
ncclResult_t ncclTransportP2pConnect(struct ncclComm* comm, struct ncclChannel* channel, int nrecv, int* peerRecv, int nsend, int* peerSend, int connIndex);
ncclResult_t ncclTransportP2pSetup(struct ncclComm* comm, struct ncclTopoGraph* graph, int connIndex);
2018-09-24 16:06:59 -07:00
2021-04-12 16:00:11 -07:00
enum { collNetRecv=0, collNetSend=1 };
int ncclTransportCollNetSetup(struct ncclComm* comm, struct ncclTopoGraph* collNetGraph, struct ncclChannel* channel, int masterRank, int masterPeer, int collNetGraphChannelId, int type);
ncclResult_t ncclTransportCollNetCheck(struct ncclComm* comm, int collNetSetupFail);
2018-09-24 16:06:59 -07:00
#endif