Files
mscclpp/python/test/proxy_test.cu
Binyang2014 858e381829 Pytest (#162)
Port python tests to mscclpp.
Please run
`mpirun -tag-output -np 8 pytest ./python/test/test_mscclpp.py -x` to start pytest

---------

Co-authored-by: Saeed Maleki <saemal@microsoft.com>
Co-authored-by: Changho Hwang <changhohwang@microsoft.com>
Co-authored-by: Saeed Maleki <30272783+saeedmaleki@users.noreply.github.com>
2023-09-01 21:22:11 +08:00

23 lines
736 B
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include <mscclpp/fifo_device.hpp>
#include <mscclpp/semaphore_device.hpp>
extern "C" __global__ void __launch_bounds__(1024, 1) proxy(int my_rank, int nranks, mscclpp::FifoDeviceHandle fifo,
mscclpp::Host2DeviceSemaphoreDeviceHandle* semaphores) {
int tid = threadIdx.x;
if (tid == 0) {
mscclpp::ProxyTrigger trigger;
trigger.fst = 123;
trigger.snd = 0;
uint64_t currentFifoHead = fifo.push(trigger);
// wait for the work to be done in cpu side
fifo.sync(currentFifoHead);
}
__syncthreads();
if (tid < nranks && tid != my_rank) {
semaphores[tid].wait();
}
}