Merge remote-tracking branch 'nccl/v2.19' into develop
Этот коммит содержится в:
+30
-12
@@ -9,10 +9,11 @@
|
||||
#ifndef NCCL_PROXY_H_
|
||||
#define NCCL_PROXY_H_
|
||||
|
||||
#include "devcomm.h"
|
||||
#include "device.h"
|
||||
#include "info.h"
|
||||
#include "socket.h"
|
||||
#include "ipcsocket.h"
|
||||
#include "nccl_net.h"
|
||||
#include <pthread.h>
|
||||
#include "shm.h"
|
||||
#include "p2p.h"
|
||||
@@ -71,6 +72,8 @@ struct ncclProxySubArgs {
|
||||
uint64_t end;
|
||||
void* requests[NCCL_STEPS];
|
||||
void* profilingEvents[NCCL_STEPS];
|
||||
void* recvRequestsCache[NCCL_STEPS];
|
||||
int recvRequestsSubCount;
|
||||
|
||||
#if defined(ENABLE_NPKIT) && defined(ENABLE_NPKIT_EVENT_NET_SEND_ENTRY) && defined(ENABLE_NPKIT_EVENT_NET_SEND_EXIT)
|
||||
int npKitSizesFifo[NCCL_STEPS];
|
||||
@@ -158,7 +161,7 @@ struct ncclProxyProgressState {
|
||||
char opsPoolShmSuffix[6];
|
||||
|
||||
pthread_t thread;
|
||||
bool stop;
|
||||
volatile int stop;
|
||||
struct ncclProxyPeer** localPeers;
|
||||
struct ncclSharedNetComms* netComms[NCCL_MAX_NETDEVS];
|
||||
struct ncclProxyArgs* active;
|
||||
@@ -169,11 +172,12 @@ struct ncclProxyProgressState {
|
||||
|
||||
// Expected proxy response fifo
|
||||
struct ncclExpectedProxyResponse {
|
||||
void* opId;
|
||||
int respSize;
|
||||
bool done;
|
||||
void* respBuff;
|
||||
struct ncclExpectedProxyResponse* next;
|
||||
void* opId;
|
||||
int respSize;
|
||||
bool done;
|
||||
void* respBuff;
|
||||
ncclResult_t res;
|
||||
struct ncclExpectedProxyResponse* next;
|
||||
};
|
||||
|
||||
struct ncclProxyAsyncOp {
|
||||
@@ -193,7 +197,16 @@ struct ncclProxyLocalPeer {
|
||||
int asyncOpCounter;
|
||||
};
|
||||
|
||||
// Common response header for all proxyOps
|
||||
// We pack this into a struct to reduce the number of blocking send and recv calls
|
||||
struct ncclProxyRpcResponseHeader {
|
||||
void* opId;
|
||||
ncclResult_t res;
|
||||
int respSize;
|
||||
};
|
||||
|
||||
struct ncclProxyState {
|
||||
int internalRefCount;
|
||||
int refCount;
|
||||
int tpRank;
|
||||
int tpnRanks;
|
||||
@@ -208,11 +221,13 @@ struct ncclProxyState {
|
||||
ncclNet_t* ncclNet;
|
||||
ncclCollNet_t* ncclCollNet;
|
||||
volatile uint32_t* abortFlag;
|
||||
volatile uint32_t* abortFlagRefCount;
|
||||
// Service thread
|
||||
pthread_t thread;
|
||||
struct ncclSocket* listenSock;
|
||||
int stop;
|
||||
volatile int stop;
|
||||
CUcontext cudaCtx;
|
||||
ncclResult_t asyncResult;
|
||||
|
||||
// Used by main thread
|
||||
union ncclSocketAddress* peerAddresses;
|
||||
@@ -245,8 +260,11 @@ struct ncclProxyConnection {
|
||||
struct ncclProxyArgs *proxyAppend;
|
||||
struct ncclProxyArgs **proxyAppendPtr;
|
||||
void* transportResources;
|
||||
ncclNetDeviceHandle_t* netDeviceHandle;
|
||||
void* mhandles[NCCL_NUM_PROTOCOLS];
|
||||
proxyConnectState state;
|
||||
struct ncclCollNetSharedRes* collNet;
|
||||
int needsProxyProgress;
|
||||
};
|
||||
|
||||
typedef ncclResult_t (*threadFunc_t)(struct ncclProxyArgs*);
|
||||
@@ -272,7 +290,7 @@ enum ncclProxyMsgType {
|
||||
ncclProxyMsgClose = 6,
|
||||
ncclProxyMsgAbort = 7,
|
||||
ncclProxyMsgStop = 8,
|
||||
ncclProxyMsgConvertFd = 9, // cuMem API support (UDS)
|
||||
ncclProxyMsgGetFd = 9, // cuMem API support (UDS)
|
||||
};
|
||||
|
||||
// This function is called by a client of the proxy that needs to invoke any of the non-progress proxyOp types
|
||||
@@ -284,12 +302,12 @@ ncclResult_t ncclProxyCallAsync(struct ncclComm* comm, struct ncclProxyConnector
|
||||
ncclResult_t ncclProxyCallBlocking(struct ncclComm* comm, struct ncclProxyConnector* proxyConn, int type, void* reqBuff, int reqSize, void* respBuff, int respSize);
|
||||
ncclResult_t ncclPollProxyResponse(struct ncclComm* comm, struct ncclProxyConnector* proxyConn, void* respBuff, void* opId);
|
||||
|
||||
ncclResult_t ncclProxyClientConvertFdBlocking(struct ncclComm* comm, struct ncclProxyConnector* proxyConn, int fd, int* convertedFd);
|
||||
ncclResult_t ncclProxyClientGetFdBlocking(struct ncclComm* comm, struct ncclProxyConnector* proxyConn, void *handle, int* convertedFd);
|
||||
|
||||
ncclResult_t ncclProxyStop(struct ncclComm* comm);
|
||||
ncclResult_t ncclProxyShmUnlink(struct ncclComm* comm);
|
||||
ncclResult_t ncclProxyDestroy(struct ncclComm* comm);
|
||||
ncclResult_t ncclProxyDestroy(struct ncclProxyState *proxyState);
|
||||
ncclResult_t ncclProxyTryDetach(struct ncclProxyState *proxyState);
|
||||
|
||||
ncclResult_t mscclSaveProxy(struct ncclComm* comm, struct ncclChannel* channel, int type, int peer, struct ncclProxyOp* op, int connIndex);
|
||||
|
||||
#endif
|
||||
|
||||
Ссылка в новой задаче
Block a user