Skip to content

Commit c32b15c

Browse files
authored
reduce benchmarked with ishmem (#722)
* added reduce benchmark with ishmem * removed suite definitions from cmake as they were added to CI repo
1 parent e41c140 commit c32b15c

File tree

5 files changed

+14
-87
lines changed

5 files changed

+14
-87
lines changed

CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,7 @@ if(ENABLE_ISHMEM)
326326
function(target_link_ishmem exec_name)
327327
target_link_libraries(${exec_name} ze_loader pmi_simple sma)
328328
target_link_libraries(${exec_name} ${CMAKE_BINARY_DIR}/lib/libishmem.a)
329-
endfunction()
330-
331-
add_compile_definitions(DRISHMEM)
332-
333-
else()
334-
335-
function(target_link_ishmem exec_name)
336-
329+
target_compile_definitions(${exec_name} PRIVATE DRISHMEM)
337330
endfunction()
338331

339332
endif()

benchmarks/gbench/CMakeLists.txt

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -29,80 +29,6 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
2929

3030
if(ENABLE_SYCL)
3131
add_subdirectory(shp)
32-
3332
add_custom_target(xhp-bench DEPENDS mhp-bench shp-bench)
34-
35-
add_custom_target(jfcst-bench DEPENDS jfcst-bench-results)
36-
add_custom_command(
37-
OUTPUT jfcst-bench-results
38-
# github actions log annotation
39-
COMMAND echo "::endgroup::"
40-
COMMAND dr-bench clean
41-
COMMAND dr-bench suite --gpus 4 --ppn 2
42-
COMMAND dr-bench plot
43-
DEPENDS xhp-bench)
44-
45-
add_custom_target(aurora-bench-1 DEPENDS aurora-bench-results)
46-
add_custom_command(
47-
OUTPUT aurora-bench-results
48-
# github actions log annotation
49-
COMMAND echo "::endgroup::"
50-
COMMAND dr-bench clean
51-
COMMAND dr-bench suite --gpus 12 --ppn 12
52-
COMMAND dr-bench plot
53-
DEPENDS xhp-bench)
54-
55-
# shp fails with PI_OUT_OF_RESOURCES when GPUS>4, 3DFFT fails always on
56-
# 2024.1 and sometimes on 2023.2 other shp benchmark also failed in 2024 on
57-
# 8 GPUs in initialization
58-
add_custom_target(aurora-bench-1-shplimited
59-
DEPENDS aurora-bench-results-shplimited)
60-
add_custom_command(
61-
OUTPUT aurora-bench-results-shplimited
62-
# github actions log annotation
63-
COMMAND echo "::endgroup::"
64-
COMMAND dr-bench clean
65-
COMMAND dr-bench suite --gpus 12 --ppn 12 --mhp-only
66-
COMMAND dr-bench suite --gpus 12 --ppn 12 --reference-only
67-
COMMAND dr-bench suite --gpus 4 --ppn 12 --shp-only
68-
COMMAND dr-bench plot
69-
DEPENDS xhp-bench)
70-
71-
add_custom_target(aurora-bench-2 DEPENDS aurora-bench-results-2)
72-
add_custom_command(
73-
OUTPUT aurora-bench-results-2
74-
# github actions log annotation
75-
COMMAND echo "::endgroup::"
76-
COMMAND dr-bench clean
77-
COMMAND dr-bench suite --min-gpus 13 --gpus 24 --ppn 12 --mhp-only
78-
COMMAND dr-bench suite --gpus 12 --ppn 12
79-
COMMAND dr-bench plot
80-
DEPENDS xhp-bench)
81-
82-
add_custom_target(aurora-bench-plus-2 DEPENDS aurora-bench-results-plus-2)
83-
add_custom_command(
84-
OUTPUT aurora-bench-results-plus-2
85-
# github actions log annotation
86-
COMMAND echo "::endgroup::"
87-
COMMAND dr-bench suite --min-gpus 13 --gpus 24 --ppn 12 --mhp-only
88-
COMMAND dr-bench plot
89-
DEPENDS xhp-bench)
90-
91-
add_custom_target(quick-bench-gpu DEPENDS quick-bench-gpu-results)
92-
add_custom_command(
93-
OUTPUT quick-bench-gpu-results
94-
COMMAND dr-bench clean
95-
COMMAND dr-bench suite --reps 10 --gpus 2
96-
COMMAND dr-bench plot
97-
DEPENDS xhp-bench)
98-
99-
add_custom_target(quick-bench-cpu DEPENDS quick-bench-cpu-results)
100-
add_custom_command(
101-
OUTPUT quick-bench-cpu-results
102-
COMMAND dr-bench clean
103-
COMMAND dr-bench suite --reps 10 --cores-per-socket 4
104-
COMMAND dr-bench plot
105-
DEPENDS xhp-bench)
106-
10733
endif()
10834
endif()

benchmarks/gbench/common/distributed_vector.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ void check_reduce(T actual) {
162162
}
163163
}
164164

165-
static void Reduce_DR(benchmark::State &state) {
165+
template <class... BackendT> static void Reduce_DR(benchmark::State &state) {
166166
T actual{};
167-
xhp::distributed_vector<T> src(default_vector_size, fill);
167+
xhp::distributed_vector<T, BackendT...> src(default_vector_size, fill);
168168
Stats stats(state, sizeof(T) * src.size(), 0);
169169
for (auto _ : state) {
170170
for (std::size_t i = 0; i < default_repetitions; i++) {
@@ -176,6 +176,10 @@ static void Reduce_DR(benchmark::State &state) {
176176
}
177177
DR_BENCHMARK(Reduce_DR);
178178

179+
#ifdef DRISHMEM
180+
DR_BENCHMARK(Reduce_DR<dr::mhp::IshmemBackend>)->Name("Reduce_DR_ishmem");
181+
#endif
182+
179183
static void Reduce_max_DR(benchmark::State &state) {
180184
T actual{};
181185
auto max = [](T x, T y) { return std::max(x, y); };

benchmarks/gbench/mhp/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ endif()
3636
# mhp-quick-bench is for development. By reducing the number of source files, it
3737
# builds much faster. Change the source files to match what you need to test. It
3838
# is OK to commit changes to the source file list.
39-
add_executable(mhp-quick-bench mhp-bench.cpp ../common/sort.cpp)
39+
add_executable(mhp-quick-bench mhp-bench.cpp ../common/distributed_vector.cpp)
4040

4141
foreach(mhp-bench-exec IN ITEMS mhp-bench mhp-quick-bench)
4242
target_compile_definitions(${mhp-bench-exec} PRIVATE BENCH_MHP)
4343
target_link_libraries(${mhp-bench-exec} benchmark::benchmark cxxopts DR::mpi)
44-
target_link_ishmem(${mhp-bench-exec})
44+
if(ENABLE_ISHMEM)
45+
target_link_ishmem(${mhp-bench-exec})
46+
endif()
4547
if(ENABLE_SYCL)
4648
target_link_libraries(${mhp-bench-exec} MKL::MKL_DPCPP)
4749
endif()

test/gtest/mhp/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ add_executable(mhp-quick-test
6464
target_compile_definitions(mhp-quick-test PRIVATE QUICK_TEST)
6565

6666
foreach(test-exec IN ITEMS mhp-tests mhp-tests-3 mhp-quick-test)
67+
if(ENABLE_ISHMEM)
68+
target_link_ishmem(${test-exec})
69+
endif()
6770
target_link_libraries(${test-exec} GTest::gtest_main cxxopts DR::mpi)
68-
target_link_ishmem(${test-exec})
6971
set_property(TARGET ${test-exec} PROPERTY RULE_LAUNCH_COMPILE
7072
"${CMAKE_COMMAND} -E time")
7173
endforeach()

0 commit comments

Comments
 (0)