gfx11: don't use LL for sendrecv (#853)

* gfx11: don't use LL for sendrecv

* Use builtin instead of inline asm
This commit is contained in:
Wenkai Du
2023-08-17 08:50:51 -07:00
committed by GitHub
vanhempi 621ccd783b
commit f70e3e569b
3 muutettua tiedostoa jossa 10 lisäystä ja 7 poistoa
@@ -21,6 +21,7 @@
} else { \ } else { \
const int w = threadIdx.x/WARP_SIZE; \ const int w = threadIdx.x/WARP_SIZE; \
const int wid = threadIdx.x%WARP_SIZE; \ const int wid = threadIdx.x%WARP_SIZE; \
__threadfence(); \
if (wid == 0) { \ if (wid == 0) { \
barrier_next[w] += nthreads/WARP_SIZE; \ barrier_next[w] += nthreads/WARP_SIZE; \
atomicAdd((unsigned long long *)barriers, 1); \ atomicAdd((unsigned long long *)barriers, 1); \
+7 -6
Näytä tiedosto
@@ -159,17 +159,18 @@ private:
template<int Recv, int Send> template<int Recv, int Send>
inline __device__ void postPeer(bool dataStored) { inline __device__ void postPeer(bool dataStored) {
if (Send && (flags & RolePostSend) && dataStored)
#ifdef __GFX9__
__builtin_amdgcn_buffer_wbinvl1();
#else
__threadfence_system();
#endif
if ((flags & Send*RolePostSend) && next_hdp_reg) if ((flags & Send*RolePostSend) && next_hdp_reg)
STORE((unsigned int *)next_hdp_reg, 0x1); STORE((unsigned int *)next_hdp_reg, 0x1);
if (flags & (Recv*RolePostRecv | Send*RolePostSend)) { if (flags & (Recv*RolePostRecv | Send*RolePostSend)) {
step += StepPerSlice; step += StepPerSlice;
if (Send && (flags & RolePostSend) && dataStored)
#ifdef __GFX9__
__asm__ __volatile__("buffer_wbinvl1_vol");
#else
__threadfence_system();
#endif
STORE(connStepPtr, step); STORE(connStepPtr, step);
} }
} }
+2 -1
Näytä tiedosto
@@ -318,7 +318,8 @@ static ncclResult_t addP2pToPlan(
// 1 is connIndex // 1 is connIndex
struct ncclConnInfo* conn = isSendNotRecv ? struct ncclConnInfo* conn = isSendNotRecv ?
&comm->channels[channelId].peers[peer]->send[1].conn : &comm->channels[channelId].peers[peer]->recv[1].conn; &comm->channels[channelId].peers[peer]->send[1].conn : &comm->channels[channelId].peers[peer]->recv[1].conn;
info.protocol = ((conn->buffs[NCCL_PROTO_LL] != nullptr) && bytes <= ncclParamP2pLLThreshold()) ? NCCL_PROTO_LL : NCCL_PROTO_SIMPLE; // do not use LL on gfx11
info.protocol = ((conn->buffs[NCCL_PROTO_LL] != nullptr) && bytes <= ncclParamP2pLLThreshold() && comm->topo->nodes[GPU].nodes[0].gpu.gcn/100 != 11) ? NCCL_PROTO_LL : NCCL_PROTO_SIMPLE;
struct ncclProxyOp proxyOp = {}; struct ncclProxyOp proxyOp = {};
NCCLCHECK(ncclProxyComputeP2p(&info, &proxyOp)); NCCLCHECK(ncclProxyComputeP2p(&info, &proxyOp));