Added alltoallv test and optional args variable on collective args (#514)
* Added alltoallv test and optional args variable on collective args
This commit is contained in:
+13
-29
@@ -155,32 +155,19 @@ namespace RcclUnitTesting
|
||||
InitComms(TestBed::GetDeviceIdsList(1, numGpus), numCollectivesInGroup);
|
||||
}
|
||||
|
||||
void TestBed::SetCollectiveArgs(ncclFunc_t const funcType,
|
||||
ncclDataType_t const dataType,
|
||||
ncclRedOp_t const redOp,
|
||||
int const root,
|
||||
size_t const numInputElements,
|
||||
size_t const numOutputElements,
|
||||
int const collId,
|
||||
int const rank,
|
||||
PtrUnion const scalarsPerRank,
|
||||
int const scalarMode)
|
||||
void TestBed::SetCollectiveArgs(ncclFunc_t const funcType,
|
||||
ncclDataType_t const dataType,
|
||||
size_t const numInputElements,
|
||||
size_t const numOutputElements,
|
||||
OptionalColArgs const &optionalArgs,
|
||||
int const collId,
|
||||
int const rank)
|
||||
{
|
||||
// Build list of ranks this applies to (-1 for rank means to set for all)
|
||||
std::vector<int> rankList;
|
||||
for (int i = 0; i < this->numActiveRanks; ++i)
|
||||
if (rank == -1 || rank == i) rankList.push_back(i);
|
||||
|
||||
ScalarTransport scalarTransport;
|
||||
if (scalarMode >= 0)
|
||||
{
|
||||
ASSERT_TRUE(scalarsPerRank.ptr != NULL);
|
||||
|
||||
// Capture scalars per rank in format to share with child processes
|
||||
int const numBytes = this->numActiveRanks * DataTypeToBytes(dataType);
|
||||
memcpy(scalarTransport.ptr, scalarsPerRank.ptr, numBytes);
|
||||
}
|
||||
|
||||
// Loop over all ranks and send CollectiveArgs to appropriate child process
|
||||
int const cmd = TestBedChild::CHILD_SET_COLL_ARGS;
|
||||
for (auto currRank : rankList)
|
||||
@@ -191,12 +178,9 @@ namespace RcclUnitTesting
|
||||
PIPE_WRITE(childId, collId);
|
||||
PIPE_WRITE(childId, funcType);
|
||||
PIPE_WRITE(childId, dataType);
|
||||
PIPE_WRITE(childId, redOp);
|
||||
PIPE_WRITE(childId, root);
|
||||
PIPE_WRITE(childId, numInputElements);
|
||||
PIPE_WRITE(childId, numOutputElements);
|
||||
PIPE_WRITE(childId, scalarMode);
|
||||
PIPE_WRITE(childId, scalarTransport);
|
||||
PIPE_WRITE(childId, optionalArgs);
|
||||
PIPE_CHECK(childId);
|
||||
}
|
||||
}
|
||||
@@ -412,7 +396,7 @@ namespace RcclUnitTesting
|
||||
// Sort numElements in descending order to cut down on # of allocations
|
||||
std::vector<int> sortedN = numElements;
|
||||
std::sort(sortedN.rbegin(), sortedN.rend());
|
||||
|
||||
OptionalColArgs optionalArgs;
|
||||
// Filter out any unsupported datatypes, in case only subset has been compiled for
|
||||
std::vector<ncclDataType_t> const& supportedDataTypes = this->GetAllSupportedDataTypes();
|
||||
std::vector<ncclDataType_t> dataTypes;
|
||||
@@ -479,13 +463,13 @@ namespace RcclUnitTesting
|
||||
totalRanks,
|
||||
&numInputElements,
|
||||
&numOutputElements);
|
||||
|
||||
optionalArgs.redOp = redOps[rdIdx];
|
||||
optionalArgs.root = roots[rtIdx];
|
||||
this->SetCollectiveArgs(funcTypes[ftIdx],
|
||||
dataTypes[dtIdx],
|
||||
redOps[rdIdx],
|
||||
roots[rtIdx],
|
||||
numInputElements,
|
||||
numOutputElements);
|
||||
numOutputElements,
|
||||
optionalArgs);
|
||||
|
||||
// Only allocate once for largest size
|
||||
if (neIdx == 0) this->AllocateMem(inPlaceList[ipIdx], managedMemList[mmIdx]);
|
||||
|
||||
مرجع در شماره جدید
Block a user