Build AllReduce only mode (#443)

* Initial commit of all_reduce_only support

* Working AllReduce only build

* Removing printfs and restoring release build

* Restore P2P index

* Updates to build_allreduce_only mode.

* cleaning up macro ifdefs

[ROCm/rccl commit: 7e55b211c5]
This commit is contained in:
Stanley Tsang
2021-10-26 16:36:46 -07:00
committed by GitHub
parent 15143b1cfb
commit a6feafd5dc
6 changed files with 104 additions and 35 deletions
+45 -32
View File
@@ -12,38 +12,51 @@ if(BUILD_TESTS)
include_directories(${GTEST_INCLUDE_DIRS})
# Collect source files for tests
set(TEST_SOURCES_SINGLE_PROCESS
test_AllGather.cpp
test_AllReduce.cpp
test_AllReduceGroup.cpp
test_Broadcast.cpp
test_Reduce.cpp
test_ReduceScatter.cpp
test_GroupCalls.cpp
test_CombinedCalls.cpp
test_AllReduceAbort.cpp
test_BroadcastAbort.cpp
test_Scatter.cpp
test_Gather.cpp
test_AllToAll.cpp
test_AllToAllv.cpp
)
set(TEST_SOURCES_MULTI_PROCESS
test_AllGatherMultiProcess.cpp
test_AllReduceMultiProcess.cpp
test_AllReduceGroupMultiProcess.cpp
test_AllToAllMultiProcess.cpp
test_BroadcastMultiProcess.cpp
test_CombinedCallsMultiProcess.cpp
test_GatherMultiProcess.cpp
test_GroupCallsMultiProcess.cpp
test_ReduceMultiProcess.cpp
test_ReduceScatterMultiProcess.cpp
test_ScatterMultiProcess.cpp
)
if(BUILD_ALLREDUCE_ONLY)
set(TEST_SOURCES_SINGLE_PROCESS
test_AllReduce.cpp
test_AllReduceAbort.cpp
test_AllReduceGroup.cpp
)
else()
# Collect source files for tests
set(TEST_SOURCES_SINGLE_PROCESS
test_AllGather.cpp
test_AllReduce.cpp
test_AllReduceGroup.cpp
test_Broadcast.cpp
test_Reduce.cpp
test_ReduceScatter.cpp
test_GroupCalls.cpp
test_CombinedCalls.cpp
test_AllReduceAbort.cpp
test_BroadcastAbort.cpp
test_Scatter.cpp
test_Gather.cpp
test_AllToAll.cpp
test_AllToAllv.cpp
)
endif()
if(BUILD_ALLREDUCE_ONLY)
set(TEST_SOURCES_MULTI_PROCESS
test_AllReduceMultiProcess.cpp
test_AllReduceGroupMultiProcess.cpp
)
else()
set(TEST_SOURCES_MULTI_PROCESS
test_AllGatherMultiProcess.cpp
test_AllReduceMultiProcess.cpp
test_AllReduceGroupMultiProcess.cpp
test_AllToAllMultiProcess.cpp
test_BroadcastMultiProcess.cpp
test_CombinedCallsMultiProcess.cpp
test_GatherMultiProcess.cpp
test_GroupCallsMultiProcess.cpp
test_ReduceMultiProcess.cpp
test_ReduceScatterMultiProcess.cpp
test_ScatterMultiProcess.cpp
)
endif()
add_executable(UnitTests ${TEST_SOURCES_SINGLE_PROCESS})
target_include_directories(UnitTests PRIVATE ${ROCM_PATH} ${GTEST_INCLUDE_DIRS})
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES})
+18 -1
View File
@@ -35,7 +35,23 @@ namespace CorrectnessTests
dataset.Release();
}
#if defined(BUILD_ALLREDUCE_ONLY)
INSTANTIATE_TEST_SUITE_P(AllReduceCorrectnessSweep,
AllReduceCorrectnessTest,
testing::Combine(
// Reduction operator
testing::Values(ncclSum),
// Data types
testing::Values(ncclFloat32),
// Number of elements
testing::Values(1024, 1048576),
// Number of devices
testing::Values(2,3,4,5,6,7,8),
// In-place or not
testing::Values(false, true),
testing::Values("RCCL_ENABLE_CLIQUE=0", "RCCL_ENABLE_CLIQUE=1")),
CorrectnessTest::PrintToStringParamName());
#else
INSTANTIATE_TEST_SUITE_P(AllReduceCorrectnessSweep,
AllReduceCorrectnessTest,
testing::Combine(
@@ -60,4 +76,5 @@ namespace CorrectnessTests
testing::Values(false, true),
testing::Values("RCCL_ENABLE_CLIQUE=0", "RCCL_ENABLE_CLIQUE=1")),
CorrectnessTest::PrintToStringParamName());
#endif
} // namespace
+18 -1
View File
@@ -47,7 +47,23 @@ namespace CorrectnessTests
dataset2.Release();
dataset3.Release();
}
#if defined(BUILD_ALLREDUCE_ONLY)
INSTANTIATE_TEST_SUITE_P(AllReduceGroupCorrectnessSweep,
AllReduceGroupCorrectnessTest,
testing::Combine(
// Reduction operator
testing::Values(ncclSum),
// Data types
testing::Values(ncclFloat32),
// Number of elements
testing::Values(1024, 1048576),
// Number of devices
testing::Values(2,3,4,5,6,7,8),
// In-place or not
testing::Values(false, true),
testing::Values("RCCL_ENABLE_CLIQUE=0", "RCCL_ENABLE_CLIQUE=1")),
CorrectnessTest::PrintToStringParamName());
#else
INSTANTIATE_TEST_SUITE_P(AllReduceGroupCorrectnessSweep,
AllReduceGroupCorrectnessTest,
testing::Combine(
@@ -63,4 +79,5 @@ namespace CorrectnessTests
testing::Values(false, true),
testing::Values("RCCL_ENABLE_CLIQUE=0", "RCCL_ENABLE_CLIQUE=1")),
CorrectnessTest::PrintToStringParamName());
#endif
} // namespace