From 6d6dccfebeea1288d3aa2fbfcc54334851106f80 Mon Sep 17 00:00:00 2001 From: Yiltan Date: Wed, 19 Mar 2025 14:31:07 -0400 Subject: [PATCH] Sync Reverse Offload Scripts (#52) * Sync Reverse Offload scripts - Disable IPC unit tests when IPC is not available in the rocSHMEM configuration * Added missing ptr in ipc_policy [ROCm/rocshmem commit: 3428957de96035f2f77bee1d58f12dcd41beb5c0] --- projects/rocshmem/scripts/build_configs/ro_ipc | 3 ++- projects/rocshmem/scripts/build_configs/ro_net | 7 ++++--- .../rocshmem/scripts/build_configs/ro_net_debug | 7 +++++-- projects/rocshmem/src/ipc_policy.hpp | 2 ++ projects/rocshmem/tests/unit_tests/CMakeLists.txt | 13 ++++++++++--- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/projects/rocshmem/scripts/build_configs/ro_ipc b/projects/rocshmem/scripts/build_configs/ro_ipc index 0d07b18af3..cfe359eb57 100755 --- a/projects/rocshmem/scripts/build_configs/ro_ipc +++ b/projects/rocshmem/scripts/build_configs/ro_ipc @@ -23,8 +23,9 @@ cmake \ -DUSE_COHERENT_HEAP=ON \ -DUSE_THREADS=OFF \ -DUSE_WF_COAL=OFF \ - -DUSE_SINGLE_NODE=ON \ -DUSE_HOST_SIDE_HDP_FLUSH=OFF\ + -DUSE_MANAGED_HEAP=OFF \ + -DUSE_RO=ON \ $src_path cmake --build . --parallel 8 cmake --install . diff --git a/projects/rocshmem/scripts/build_configs/ro_net b/projects/rocshmem/scripts/build_configs/ro_net index 6f6e72e288..240e7735b5 100755 --- a/projects/rocshmem/scripts/build_configs/ro_net +++ b/projects/rocshmem/scripts/build_configs/ro_net @@ -19,12 +19,13 @@ cmake \ -DPROFILE=OFF \ -DUSE_GPU_IB=OFF \ -DUSE_DC=OFF \ + -DUSE_IPC=OFF \ -DUSE_COHERENT_HEAP=ON \ + -DUSE_THREADS=OFF \ + -DUSE_WF_COAL=OFF \ + -DUSE_HOST_SIDE_HDP_FLUSH=OFF\ -DUSE_MANAGED_HEAP=OFF \ -DUSE_RO=ON \ - -DUSE_IPC=ON \ - -DUSE_THREADS=ON \ - -DUSE_WF_COAL=OFF \ $src_path cmake --build . --parallel 8 cmake --install . diff --git a/projects/rocshmem/scripts/build_configs/ro_net_debug b/projects/rocshmem/scripts/build_configs/ro_net_debug index 8468dead93..54e0309730 100755 --- a/projects/rocshmem/scripts/build_configs/ro_net_debug +++ b/projects/rocshmem/scripts/build_configs/ro_net_debug @@ -20,9 +20,12 @@ cmake \ -DUSE_GPU_IB=OFF \ -DUSE_DC=OFF \ -DUSE_IPC=OFF \ - -DUSE_THREADS=ON \ + -DUSE_COHERENT_HEAP=ON \ + -DUSE_THREADS=OFF \ -DUSE_WF_COAL=OFF \ - -DUSE_COHERENT_HEAP=OFF \ + -DUSE_HOST_SIDE_HDP_FLUSH=OFF\ + -DUSE_MANAGED_HEAP=OFF \ + -DUSE_RO=ON \ $src_path cmake --build . --parallel 8 cmake --install . diff --git a/projects/rocshmem/src/ipc_policy.hpp b/projects/rocshmem/src/ipc_policy.hpp index 1c44aad67a..e2f1590e20 100644 --- a/projects/rocshmem/src/ipc_policy.hpp +++ b/projects/rocshmem/src/ipc_policy.hpp @@ -125,6 +125,8 @@ class IpcOffImpl { char **ipc_bases{nullptr}; + int *pes_with_ipc_avail{nullptr}; + __host__ void ipcHostInit(int my_pe, const HEAP_BASES_T &heap_bases, MPI_Comm thread_comm) {} diff --git a/projects/rocshmem/tests/unit_tests/CMakeLists.txt b/projects/rocshmem/tests/unit_tests/CMakeLists.txt index 688917c3a6..fc09ff9a7f 100644 --- a/projects/rocshmem/tests/unit_tests/CMakeLists.txt +++ b/projects/rocshmem/tests/unit_tests/CMakeLists.txt @@ -91,12 +91,19 @@ target_sources( #forward_list_gtest.cpp free_list_gtest.cpp #context_ipc_gtest.cpp - ipc_impl_simple_coarse_gtest.cpp - ipc_impl_simple_fine_gtest.cpp - ipc_impl_tiled_fine_gtest.cpp wavefront_size_gtest.cpp ) +if (USE_IPC) + target_sources( + ${PROJECT_NAME} + PRIVATE + ipc_impl_simple_coarse_gtest.cpp + ipc_impl_simple_fine_gtest.cpp + ipc_impl_tiled_fine_gtest.cpp + ) +endif() + ############################################################################### # ROCSHMEM DEPENDENCY ###############################################################################