Fixed unit-test env var list parsing and improved filtered test run speed (#1626)
* Fixed parsing of env var lists which were overwriting the mutable env var string and polluting future parses. * Fixed all tests to obey UT_DATATYPES and UT_REDOPS filters. * Allow tests to bail early via `GTEST_SKIP` if UT_DATATYPES or UT_REDOPS filters give a test size of zero. This allows tests to run much faster with filters on. * Wrapped the support checks in helper functions on `TestBed`.
此提交包含在:
+43
-7
@@ -14,14 +14,26 @@ namespace RcclUnitTesting
|
||||
|
||||
// Configuration
|
||||
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllReduce, ncclCollAllReduce, ncclCollAllReduce};
|
||||
std::vector<ncclRedOp_t> const redOps = {ncclSum, ncclSum, ncclSum};
|
||||
std::vector<ncclDataType_t> const dataTypes = {ncclFloat, ncclFloat, ncclFloat};
|
||||
std::vector<ncclRedOp_t> const testRedOps = {ncclSum, ncclSum, ncclSum};
|
||||
std::vector<ncclDataType_t> const testDataTypes = {ncclFloat, ncclFloat, ncclFloat};
|
||||
std::vector<int> const numElements = {1048576, 384 * 1024, 384};
|
||||
|
||||
int const numCollPerGroup = numElements.size();
|
||||
bool const inPlace = false;
|
||||
bool const useManagedMem = false;
|
||||
|
||||
std::vector<ncclDataType_t> dataTypes;
|
||||
testBed.GetSupportedDataTypes(dataTypes, testDataTypes);
|
||||
if (dataTypes.empty()) {
|
||||
GTEST_SKIP() << "Skipping... test datatypes excluded by UT_DATATYPES.";
|
||||
}
|
||||
|
||||
std::vector<ncclRedOp_t> redOps;
|
||||
testBed.GetSupportedRedOps(redOps, testRedOps);
|
||||
if (redOps.empty()) {
|
||||
GTEST_SKIP() << "Skipping... test reduction operations excluded by UT_REDOPS.";
|
||||
}
|
||||
|
||||
bool isCorrect = true;
|
||||
for (int totalRanks : testBed.ev.GetNumGpusList())
|
||||
for (int isMultiProcess : testBed.ev.GetIsMultiProcessList())
|
||||
@@ -127,14 +139,26 @@ namespace RcclUnitTesting
|
||||
|
||||
// Configuration
|
||||
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllReduce, ncclCollAllReduce, ncclCollAllReduce};
|
||||
std::vector<ncclRedOp_t> const redOps = {ncclSum, ncclSum, ncclSum};
|
||||
std::vector<ncclDataType_t> const dataTypes = {ncclFloat16, ncclFloat32, ncclFloat64};
|
||||
std::vector<ncclRedOp_t> const testRedOps = {ncclSum, ncclSum, ncclSum};
|
||||
std::vector<ncclDataType_t> const testDataTypes = {ncclFloat16, ncclFloat32, ncclFloat64};
|
||||
std::vector<int> const numElements = {1048576, 384 * 1024, 384};
|
||||
|
||||
int const numCollPerGroup = numElements.size();
|
||||
bool const inPlace = false;
|
||||
bool const useManagedMem = false;
|
||||
|
||||
std::vector<ncclDataType_t> dataTypes;
|
||||
testBed.GetSupportedDataTypes(dataTypes, testDataTypes);
|
||||
if (dataTypes.empty()) {
|
||||
GTEST_SKIP() << "Skipping... test datatypes excluded by UT_DATATYPES.";
|
||||
}
|
||||
|
||||
std::vector<ncclRedOp_t> redOps;
|
||||
testBed.GetSupportedRedOps(redOps, testRedOps);
|
||||
if (redOps.empty()) {
|
||||
GTEST_SKIP() << "Skipping... test reduction operations excluded by UT_REDOPS.";
|
||||
}
|
||||
|
||||
bool isCorrect = true;
|
||||
for (int totalRanks : testBed.ev.GetNumGpusList())
|
||||
for (int isMultiProcess : testBed.ev.GetIsMultiProcessList())
|
||||
@@ -230,8 +254,8 @@ namespace RcclUnitTesting
|
||||
{ncclCollAllToAll, ncclCollGather},
|
||||
{ncclCollBroadcast, ncclCollReduceScatter}};
|
||||
std::vector<std::vector<int>> const numElements = {{1250, 1048576}, {384, 384 * 1024}, {1048576, 127}};
|
||||
std::vector<ncclDataType_t> const dataTypes = {ncclFloat16, ncclFloat32, ncclBfloat16};
|
||||
std::vector<ncclRedOp_t> const redops = {ncclSum, ncclProd, ncclMax};
|
||||
std::vector<ncclDataType_t> const testDataTypes = {ncclFloat16, ncclFloat32, ncclBfloat16};
|
||||
std::vector<ncclRedOp_t> const testRedOps = {ncclSum, ncclProd, ncclMax};
|
||||
std::vector<int> const numCollsPerGroup = {2, 2, 2};
|
||||
std::vector<int> const numStreamsPerGroup = {1, 1, 1};
|
||||
std::vector<bool> const useHipGraphList = {true, false, true};
|
||||
@@ -241,6 +265,18 @@ namespace RcclUnitTesting
|
||||
int const numGroupCalls = groupCalls.size();
|
||||
int const numIterations = 10;
|
||||
|
||||
std::vector<ncclDataType_t> dataTypes;
|
||||
testBed.GetSupportedDataTypes(dataTypes, testDataTypes);
|
||||
if (dataTypes.empty()) {
|
||||
GTEST_SKIP() << "Skipping... test datatypes excluded by UT_DATATYPES.";
|
||||
}
|
||||
|
||||
std::vector<ncclRedOp_t> redOps;
|
||||
testBed.GetSupportedRedOps(redOps, testRedOps);
|
||||
if (redOps.empty()) {
|
||||
GTEST_SKIP() << "Skipping... test reduction operations excluded by UT_REDOPS.";
|
||||
}
|
||||
|
||||
bool isCorrect = true;
|
||||
for (int totalRanks : testBed.ev.GetNumGpusList())
|
||||
for (int isMultiProcess : testBed.ev.GetIsMultiProcessList())
|
||||
@@ -258,7 +294,7 @@ namespace RcclUnitTesting
|
||||
{
|
||||
std::vector<ncclFunc_t> funcTypes = groupCalls[groupCallIdx];
|
||||
OptionalColArgs options;
|
||||
options.redOp = redops[groupCallIdx];
|
||||
options.redOp = redOps[groupCallIdx];
|
||||
options.root = 0;
|
||||
|
||||
for (int collIdx = 0; collIdx < numCollsPerGroup[groupCallIdx]; ++collIdx)
|
||||
|
||||
新增問題並參考
封鎖使用者