Merge remote-tracking branch 'nccl/master' into develop

Этот коммит содержится в:
Marzieh Berenjkoub
2026-01-20 13:01:49 -06:00
родитель 239d62f545 f1308997d0
Коммит 858b4e76eb
240 изменённых файлов: 16266 добавлений и 3578 удалений
+10 -10
Просмотреть файл
@@ -10,12 +10,12 @@
namespace RcclUnitTesting
{
TEST(AllToAll, OutOfPlace)
TEST(AlltoAll, OutOfPlace)
{
TestBed testBed;
// Configuration
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllToAll};
std::vector<ncclFunc_t> const funcTypes = {ncclCollAlltoAll};
std::vector<ncclDataType_t> const dataTypes = {ncclFloat16, ncclFloat32};
std::vector<ncclRedOp_t> const redOps = {ncclSum};
std::vector<int> const roots = {0};
@@ -29,12 +29,12 @@ namespace RcclUnitTesting
testBed.Finalize();
}
TEST(AllToAll, OutOfPlaceGraph)
TEST(AlltoAll, OutOfPlaceGraph)
{
TestBed testBed;
// Configuration
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllToAll};
std::vector<ncclFunc_t> const funcTypes = {ncclCollAlltoAll};
std::vector<ncclDataType_t> const dataTypes = {ncclFloat64, ncclBfloat16, ncclFloat8e4m3, ncclFloat8e5m2};
std::vector<ncclRedOp_t> const redOps = {ncclSum};
std::vector<int> const roots = {0};
@@ -48,12 +48,12 @@ namespace RcclUnitTesting
testBed.Finalize();
}
TEST(AllToAll, ManagedMem)
TEST(AlltoAll, ManagedMem)
{
TestBed testBed;
// Configuration
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllToAll};
std::vector<ncclFunc_t> const funcTypes = {ncclCollAlltoAll};
std::vector<ncclDataType_t> const dataTypes = {ncclUint8};
std::vector<ncclRedOp_t> const redOps = {ncclSum};
std::vector<int> const roots = {0};
@@ -67,12 +67,12 @@ namespace RcclUnitTesting
testBed.Finalize();
}
TEST(AllToAll, ManagedMemGraph)
TEST(AlltoAll, ManagedMemGraph)
{
TestBed testBed;
// Configuration
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllToAll};
std::vector<ncclFunc_t> const funcTypes = {ncclCollAlltoAll};
std::vector<ncclDataType_t> const dataTypes = {ncclUint32, ncclUint64};
std::vector<ncclRedOp_t> const redOps = {ncclSum};
std::vector<int> const roots = {0};
@@ -86,13 +86,13 @@ namespace RcclUnitTesting
testBed.Finalize();
}
TEST(AllToAll, Channels)
TEST(AlltoAll, Channels)
{
TestBed testBed;
if(testBed.ev.maxGpus >= 8) {
if(testBed.ev.isGfx94) {
// Configuration
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllToAll};
std::vector<ncclFunc_t> const funcTypes = {ncclCollAlltoAll};
std::vector<ncclDataType_t> const dataTypes = {ncclBfloat16};
std::vector<ncclRedOp_t> const redOps = {ncclSum};
std::vector<int> const roots = {0};
+8 -8
Просмотреть файл
@@ -74,7 +74,7 @@ namespace RcclUnitTesting
}
}
TEST(AllToAllv, OutOfPlace)
TEST(AlltoAllv, OutOfPlace)
{
TestBed testBed;
@@ -100,7 +100,7 @@ namespace RcclUnitTesting
const std::vector<int>& gpuPriorityOrder = testBed.ev.GetGpuPriorityOrder();
testBed.InitComms(TestBed::GetDeviceIdsList(numProcesses, totalRanks, gpuPriorityOrder));
// Prepare AllToAllV options
// Prepare AlltoAllV options
std::vector<size_t> numInputElements;
std::vector<size_t> numOutputElements;
PrepareCounts(totalRanks, 256, options, numInputElements, numOutputElements, 40);
@@ -110,14 +110,14 @@ namespace RcclUnitTesting
if (testBed.ev.showNames)
{
std::string name = testBed.GetTestCaseName(totalRanks, isMultiProcess,
ncclCollAllToAllv, dataTypes[dataIdx],
ncclCollAlltoAllv, dataTypes[dataIdx],
ncclSum, -1, inPlace, useManagedMem, useHipGraph);
INFO("%s\n", name.c_str());
}
for (int rank = 0; rank < totalRanks; ++rank)
{
testBed.SetCollectiveArgs(ncclCollAllToAllv,
testBed.SetCollectiveArgs(ncclCollAlltoAllv,
dataTypes[dataIdx],
numInputElements[rank],
numOutputElements[rank],
@@ -138,7 +138,7 @@ namespace RcclUnitTesting
}
TEST(AllToAllv, OutOfPlaceGraph)
TEST(AlltoAllv, OutOfPlaceGraph)
{
TestBed testBed;
@@ -164,7 +164,7 @@ namespace RcclUnitTesting
const std::vector<int>& gpuPriorityOrder = testBed.ev.GetGpuPriorityOrder();
testBed.InitComms(TestBed::GetDeviceIdsList(numProcesses, totalRanks, gpuPriorityOrder));
// Prepare AllToAllV options
// Prepare AlltoAllV options
std::vector<size_t> numInputElements;
std::vector<size_t> numOutputElements;
PrepareCounts(totalRanks, 256, options, numInputElements, numOutputElements, 60);
@@ -174,14 +174,14 @@ namespace RcclUnitTesting
if (testBed.ev.showNames)
{
std::string name = testBed.GetTestCaseName(totalRanks, isMultiProcess,
ncclCollAllToAllv, dataTypes[dataIdx],
ncclCollAlltoAllv, dataTypes[dataIdx],
ncclSum, -1, inPlace, useManagedMem, useHipGraph);
INFO("%s\n", name.c_str());
}
for (int rank = 0; rank < totalRanks; ++rank)
{
testBed.SetCollectiveArgs(ncclCollAllToAllv,
testBed.SetCollectiveArgs(ncclCollAlltoAllv,
dataTypes[dataIdx],
numInputElements[rank],
numOutputElements[rank],
+2 -2
Просмотреть файл
@@ -81,7 +81,7 @@ namespace RcclUnitTesting
ncclCollAllReduce,
ncclCollGather,
ncclCollScatter,
ncclCollAllToAll};
ncclCollAlltoAll};
int const numCollPerGroup = funcTypes.size();
int const numElements = 1048576;
bool const inPlace = false;
@@ -251,7 +251,7 @@ namespace RcclUnitTesting
// Configuration
std::vector<std::vector<ncclFunc_t>> const groupCalls = {{ncclCollAllReduce, ncclCollAllGather},
{ncclCollAllToAll, ncclCollGather},
{ncclCollAlltoAll, ncclCollGather},
{ncclCollBroadcast, ncclCollReduceScatter}};
std::vector<std::vector<int>> const numElements = {{1250, 1048576}, {384, 384 * 1024}, {1048576, 127}};
std::vector<ncclDataType_t> const testDataTypes = {ncclFloat16, ncclFloat32, ncclBfloat16};
+27 -17
Просмотреть файл
@@ -143,7 +143,12 @@ private:
protected:
void SetUp() override {
ncclResult_t result = ncclNetSocket.init(nullptr, nullptr);
void* ctx = nullptr;
uint64_t commId = 0;
ncclNetCommConfig_t config = {};
ncclDebugLogger_t logFunction = nullptr;
ncclProfilerCallback_t profFunction = nullptr;
ncclResult_t result = ncclNetSocket.init(&ctx, commId, &config, logFunction, profFunction);
ASSERT_EQ(result, ncclSuccess) << "Failed to initialize ncclNetSocket. "
<< "Error code: " << result
<< ". Ensure RCCL networking is properly configured.";
@@ -256,8 +261,9 @@ protected:
// Increased attempts and longer total timeout for reliability
for (int attempt = 0; attempt < 100 && !shouldStop.load(); attempt++) {
ncclResult_t connectResult = ncclNetSocket.connect(
0, &config, handle, &tempSendComm, &sendDevComm);
void* ctx = nullptr;
int dev = 0;
ncclResult_t connectResult = ncclNetSocket.connect(ctx, dev, handle, &tempSendComm, &sendDevComm);
if (connectResult == ncclSuccess && tempSendComm != nullptr) {
sendGuard.reset(tempSendComm);
connectCompleted = true;
@@ -702,7 +708,7 @@ protected:
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
ncclResult_t result = ncclNetSocket.listen(nullptr, 0, handle, &listenComm);
ASSERT_EQ(result, ncclSuccess) << "Failed to establish listening socket for test execution. "
<< "ncclNetSocket.listen() returned error code: " << result
<< ". Verify network device availability and port accessibility.";
@@ -791,7 +797,9 @@ TEST_F(NetSocketTests, TestConcurrentOperationsTaskCreationDefault) {
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
void* ctx = nullptr;
int dev = 0;
ncclResult_t result = ncclNetSocket.listen(ctx, dev, handle, &listenComm);
ASSERT_EQ(result, ncclSuccess) << "Failed to establish listening socket for test execution. "
<< "ncclNetSocket.listen() returned error code: " << result
<< ". Verify network device availability and port accessibility.";
@@ -895,7 +903,9 @@ TEST_F(NetSocketTests, TestInvalidDeviceIndexListen) {
void *listenComm = nullptr;
// Test with negative device index
ncclResult_t result = ncclNetSocket.listen(-1, handle, &listenComm);
void* ctx = nullptr;
int dev = -1;
ncclResult_t result = ncclNetSocket.listen(ctx, dev, handle, &listenComm);
INFO(NCCL_LOG_INFO, "Listen with dev=-1 returned: %d", result);
EXPECT_EQ(result, ncclInternalError)
<< "Listen should fail with negative device index. "
@@ -904,7 +914,7 @@ TEST_F(NetSocketTests, TestInvalidDeviceIndexListen) {
// Test with device index greater than available devices
int invalidDev = ndev + 10;
result = ncclNetSocket.listen(invalidDev, handle, &listenComm);
result = ncclNetSocket.listen(ctx, invalidDev, handle, &listenComm);
INFO(NCCL_LOG_INFO, "Listen with dev=%d (> ndev=%d) returned: %d", invalidDev,
ndev, result);
EXPECT_EQ(result, ncclInternalError)
@@ -926,8 +936,9 @@ TEST_F(NetSocketTests, TestInvalidDeviceIndexConnect) {
ncclNetDeviceHandle_t *sendDevComm = nullptr;
// Test with negative device index
ncclResult_t result =
ncclNetSocket.connect(-1, &config, handle, &sendComm, &sendDevComm);
void* ctx = nullptr;
int dev = -1;
ncclResult_t result = ncclNetSocket.connect(ctx, dev, handle, &sendComm, &sendDevComm);
INFO(NCCL_LOG_INFO, "Connect with dev=-1 returned: %d", result);
EXPECT_EQ(result, ncclInternalError)
<< "Connect should fail with negative device index. "
@@ -936,8 +947,7 @@ TEST_F(NetSocketTests, TestInvalidDeviceIndexConnect) {
// Test with device index greater than available devices
int invalidDev = ndev + 10;
result = ncclNetSocket.connect(invalidDev, &config, handle, &sendComm,
&sendDevComm);
result = ncclNetSocket.connect(ctx, invalidDev, handle, &sendComm, &sendDevComm);
INFO(NCCL_LOG_INFO, "Connect with dev=%d (> ndev=%d) returned: %d",
invalidDev, ndev, result);
EXPECT_EQ(result, ncclInternalError)
@@ -973,7 +983,7 @@ TEST_F(NetSocketTests, TestInvalidArraySizeIrecv) {
// Setup a dummy communicator first
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
ncclResult_t result = ncclNetSocket.listen(nullptr, 0, handle, &listenComm);
if (result == ncclSuccess && listenComm) {
void *sendComm = nullptr;
@@ -1039,7 +1049,7 @@ TEST_F(NetSocketTests, TestNonHostMemoryRegMr) {
// Setup a dummy communicator first
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
ncclResult_t result = ncclNetSocket.listen(nullptr, 0, handle, &listenComm);
if (result == ncclSuccess && listenComm) {
void *sendComm = nullptr;
@@ -1189,7 +1199,7 @@ TEST_F(NetSocketTests, TestExcessiveThreadConfig) {
// Initialize to trigger the warning logic
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
ncclResult_t result = ncclNetSocket.listen(nullptr, 0, handle, &listenComm);
if (result == ncclSuccess && listenComm) {
// The implementation should have limited the threads to
@@ -1308,7 +1318,7 @@ TEST_F(NetSocketTests, TestExcessiveSocketConfig) {
// Initialize to trigger the warning logic
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
ncclResult_t result = ncclNetSocket.listen(nullptr, 0, handle, &listenComm);
if (result == ncclSuccess && listenComm) {
// The implementation should have limited the sockets to
@@ -1337,7 +1347,7 @@ TEST_F(NetSocketTests, TestRequestAllocationFailure) {
// Setup communication
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
ncclResult_t result = ncclNetSocket.listen(nullptr, 0, handle, &listenComm);
if (result == ncclSuccess && listenComm) {
void *sendComm = nullptr;
@@ -1441,7 +1451,7 @@ TEST_F(NetSocketTests, TestMessageSizeMismatch) {
char handle[NCCL_NET_HANDLE_MAXSIZE];
void *listenComm = nullptr;
ncclResult_t result = ncclNetSocket.listen(0, handle, &listenComm);
ncclResult_t result = ncclNetSocket.listen(nullptr, 0, handle, &listenComm);
if (result == ncclSuccess && listenComm) {
void *sendComm = nullptr;
+3 -3
Просмотреть файл
@@ -192,8 +192,8 @@ namespace RcclUnitTesting
case ncclCollAllReduce: ss << "ncclAllReduce"; break;
case ncclCollGather: ss << "ncclGather"; break;
case ncclCollScatter: ss << "ncclScatter"; break;
case ncclCollAllToAll: ss << "ncclAllToAll"; break;
case ncclCollAllToAllv: ss << "ncclAllToAllv"; break;
case ncclCollAlltoAll: ss << "ncclAlltoAll"; break;
case ncclCollAlltoAllv: ss << "ncclAlltoAllv"; break;
case ncclCollSend: ss << "ncclSend"; break;
case ncclCollRecv: ss << "ncclRecv"; break;
default: ss << "[Unknown]"; break;
@@ -276,7 +276,7 @@ namespace RcclUnitTesting
*numInputElements = totalRanks * N;
*numOutputElements = N;
break;
case ncclCollAllToAll:
case ncclCollAlltoAll:
*numInputElements = totalRanks * N;
*numOutputElements = totalRanks * N;
break;
+4 -4
Просмотреть файл
@@ -20,8 +20,8 @@ namespace RcclUnitTesting
ncclCollAllReduce,
ncclCollGather,
ncclCollScatter,
ncclCollAllToAll,
ncclCollAllToAllv,
ncclCollAlltoAll,
ncclCollAlltoAllv,
ncclCollSend,
ncclCollRecv,
ncclNumFuncs
@@ -36,8 +36,8 @@ namespace RcclUnitTesting
"AllReduce",
"Gather",
"Scatter",
"AllToAll",
"AllToAllv",
"AlltoAll",
"AlltoAllv",
"Send",
"Recv"
};
+2 -2
Просмотреть файл
@@ -22,8 +22,8 @@ namespace RcclUnitTesting
case ncclCollAllReduce: return DefaultPrepData_Reduce(collArgs, true);
case ncclCollGather: return DefaultPrepData_Gather(collArgs, false);
case ncclCollScatter: return DefaultPrepData_Scatter(collArgs);
case ncclCollAllToAll: return DefaultPrepData_AllToAll(collArgs);
case ncclCollAllToAllv: return DefaultPrepData_AllToAllv(collArgs);
case ncclCollAlltoAll: return DefaultPrepData_AllToAll(collArgs);
case ncclCollAlltoAllv: return DefaultPrepData_AllToAllv(collArgs);
case ncclCollSend: return DefaultPrepData_Send(collArgs);
case ncclCollRecv: return DefaultPrepData_Recv(collArgs);
default:
+6 -6
Просмотреть файл
@@ -647,18 +647,18 @@ namespace RcclUnitTesting
this->streams[groupId][localRank][collArg.streamIdx]),
"ncclScatter");
break;
case ncclCollAllToAll:
CHILD_NCCL_CALL_RANK(errCode, ncclAllToAll(
case ncclCollAlltoAll:
CHILD_NCCL_CALL_RANK(errCode, ncclAlltoAll(
collArg.inputGpu.ptr,
collArg.outputGpu.ptr,
collArg.numInputElements / collArg.totalRanks,
collArg.dataType,
this->comms[localRank],
this->streams[groupId][localRank][collArg.streamIdx]),
"ncclAllToAll");
"ncclAlltoAll");
break;
case ncclCollAllToAllv:
CHILD_NCCL_CALL_RANK(errCode, ncclAllToAllv(
case ncclCollAlltoAllv:
CHILD_NCCL_CALL_RANK(errCode, ncclAlltoAllv(
collArg.inputGpu.ptr,
collArg.options.sendcounts + (this->rankOffset + localRank)*this->totalRanks,
collArg.options.sdispls + (this->rankOffset + localRank)*this->totalRanks,
@@ -668,7 +668,7 @@ namespace RcclUnitTesting
collArg.dataType,
this->comms[localRank],
this->streams[groupId][localRank][collArg.streamIdx]),
"ncclAllToAllv");
"ncclAlltoAllv");
break;
case ncclCollSend:
CHILD_NCCL_CALL_RANK(errCode, ncclSend(