Repository navigation
Adding cudf streaming dist tests #22864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 32 commits into
NVIDIA:main
from
nirandaperera:adding-cudf-streaming-dist-tests
Jun 23, 2026
Merged
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
7a6bb81
adding distirbuted cudf streaming tests
nirandaperera 4476694
precommit
nirandaperera eeb68c7
style
nirandaperera e0cbaec
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera cef0222
minor fix
nirandaperera dc213d8
Clarify file structure in Environment class comment
nirandaperera 637eb54
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera 74a226f
precommit
nirandaperera 02b3979
addressing coderabbit comments
nirandaperera 6507340
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera 7c6544f
Rename functions and variables for consistency
nirandaperera b851330
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera a2703d5
Fix include directory formatting in CMakeLists.txt
nirandaperera 2adc3d8
Update CMakeLists.txt
nirandaperera 64f8918
Fix comment formatting in CMakeLists.txt
nirandaperera 2a5f160
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera 7e91b73
fix cmake
nirandaperera fbc93c3
cmake style
nirandaperera 8d8037d
fix cmake
nirandaperera 0aed2dd
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera e7e8e5d
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera 934cb95
precommit
nirandaperera 11ead06
percommit
nirandaperera e6b8717
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera e1c7ccb
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera 106cc10
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera cfe66a8
Trigger Build
nirandaperera c2f7ecb
attempting to fix numpy lint error
nirandaperera 2171a27
Revert "attempting to fix numpy lint error" & adding pre-commit clean
nirandaperera 41bb34e
run precommit AGAIN!
nirandaperera a87107f
Merge branch 'main' into adding-cudf-streaming-dist-tests
vyasr 55851a0
Fix conda recipe test: use renamed libcudf_streaming_single_tests binary
vyasr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,33 @@ if(NOT EXISTS "${_cudf_streaming_gtests_link}") | |||||
| file(CREATE_LINK "${CUDF_STREAMING_BINARY_DIR}/gtests" "${_cudf_streaming_gtests_link}" SYMBOLIC) | ||||||
| endif() | ||||||
|
|
||||||
| # Create a separate test case for each of these n_ranks. | ||||||
| set(nranks_to_run 1 2 5) | ||||||
|
|
||||||
| # A helper function to create a test case for each parallelism (defined by nranks_to_run). | ||||||
| # TEST_TARGET is the name of the test target (required). This adds len(nranks_to_run) test cases | ||||||
| # identified by <TEST_TARGET>_<n_ranks>. NOTE: When running ctest, the TEST_TARGET executable should | ||||||
| # be located in the ./gtests/ directory relative to the PWD. | ||||||
| function(cudf_streaming_mpirun_test_add) | ||||||
| set(options) # no options | ||||||
| set(one_value TEST_TARGET) | ||||||
| set(multi_value) # no multi_value args | ||||||
| cmake_parse_arguments(_MPIRUN_TEST "${options}" "${one_value}" "${multi_value}" ${ARGN}) | ||||||
|
|
||||||
| if(NOT DEFINED _MPIRUN_TEST_TEST_TARGET) | ||||||
| message(FATAL_ERROR "cudf_streaming_mpirun_test_add called without a test prefix") | ||||||
| endif() | ||||||
|
|
||||||
| message(STATUS "Adding mpirun test: ${_MPIRUN_TEST_TEST_TARGET} nranks: ${nranks_to_run}") | ||||||
| foreach(np IN ITEMS ${nranks_to_run}) | ||||||
| # add the test using the relative path of the target | ||||||
| add_test( | ||||||
| NAME "${_MPIRUN_TEST_TEST_TARGET}_${np}" COMMAND mpirun --map-by node --bind-to none -np | ||||||
| ${np} "gtests/${_MPIRUN_TEST_TEST_TARGET}" | ||||||
| ) | ||||||
| endforeach(np) | ||||||
| endfunction(cudf_streaming_mpirun_test_add) | ||||||
|
|
||||||
| add_library(cudf_streaming_test_sources OBJECT) | ||||||
| set_target_properties( | ||||||
| cudf_streaming_test_sources | ||||||
|
|
@@ -38,6 +65,13 @@ target_link_libraries( | |||||
| PRIVATE cudf_streaming rapidsmpf::rapidsmpf cudf::cudftestutil cudf::cudftestutil_impl | ||||||
| PUBLIC GTest::gmock GTest::gtest | ||||||
| ) | ||||||
| # cudf::cudftestutil_impl injects cudf test-utility .cu sources (via INTERFACE_SOURCES) that are | ||||||
| # compiled into this object library. Those sources use device lambdas, so they require the same CUDA | ||||||
| # flags cudf builds them with (notably --expt-extended-lambda from CUDF_CUDA_FLAGS). | ||||||
| target_compile_options( | ||||||
| cudf_streaming_test_sources | ||||||
| PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>" | ||||||
| ) | ||||||
| target_sources( | ||||||
| cudf_streaming_test_sources | ||||||
| PRIVATE streaming/test_table_chunk.cpp | ||||||
|
|
@@ -81,6 +115,63 @@ rapids_test_add( | |||||
| INSTALL_COMPONENT_SET testing | ||||||
| ) | ||||||
|
|
||||||
| # ################################################################################################## | ||||||
| # MPI and UCXX based tests ------------------------------------------------------------------------- | ||||||
| # These executables reuse cudf_streaming_test_sources but provide a different test environment main | ||||||
| # (main/mpi.cpp / main/ucxx.cpp), and are launched via mpirun for multiple ranks. | ||||||
| if(CUDF_STREAMING_HAVE_MPI) | ||||||
| add_executable(cudf_streaming_mpi_tests main/mpi.cpp) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: let's make test names complete and matching the package/library name. This would also match the same prefix being proposed for benchmarks here. |
||||||
| set_target_properties( | ||||||
| cudf_streaming_mpi_tests | ||||||
| PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CUDF_STREAMING_BINARY_DIR}/gtests" | ||||||
| INSTALL_RPATH "\$ORIGIN/../../../lib" | ||||||
| CXX_STANDARD 20 | ||||||
| CXX_STANDARD_REQUIRED ON | ||||||
| CXX_EXTENSIONS ON | ||||||
| CUDA_STANDARD 20 | ||||||
| CUDA_STANDARD_REQUIRED ON | ||||||
| ) | ||||||
| target_include_directories( | ||||||
| cudf_streaming_mpi_tests PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include" | ||||||
| "${CMAKE_CURRENT_SOURCE_DIR}" | ||||||
| ) | ||||||
| target_link_libraries( | ||||||
| cudf_streaming_mpi_tests | ||||||
| PRIVATE cudf_streaming rapidsmpf::rapidsmpf cudf_streaming::optional_communication GTest::gmock | ||||||
| GTest::gtest $<TARGET_NAME_IF_EXISTS:conda_env> cudf_streaming_test_sources | ||||||
| ) | ||||||
| cudf_streaming_mpirun_test_add(TEST_TARGET cudf_streaming_mpi_tests) | ||||||
|
|
||||||
| if(CUDF_STREAMING_HAVE_UCXX) | ||||||
| add_executable(cudf_streaming_ucxx_tests main/ucxx.cpp) | ||||||
| set_target_properties( | ||||||
| cudf_streaming_ucxx_tests | ||||||
| PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CUDF_STREAMING_BINARY_DIR}/gtests" | ||||||
| INSTALL_RPATH "\$ORIGIN/../../../lib" | ||||||
| CXX_STANDARD 20 | ||||||
| CXX_STANDARD_REQUIRED ON | ||||||
| CXX_EXTENSIONS ON | ||||||
| CUDA_STANDARD 20 | ||||||
| CUDA_STANDARD_REQUIRED ON | ||||||
| ) | ||||||
| target_include_directories( | ||||||
| cudf_streaming_ucxx_tests PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include" | ||||||
| "${CMAKE_CURRENT_SOURCE_DIR}" | ||||||
| ) | ||||||
| target_link_libraries( | ||||||
| cudf_streaming_ucxx_tests | ||||||
| PRIVATE cudf_streaming rapidsmpf::rapidsmpf cudf_streaming::optional_communication | ||||||
| GTest::gmock GTest::gtest $<TARGET_NAME_IF_EXISTS:conda_env> | ||||||
| cudf_streaming_test_sources | ||||||
| ) | ||||||
| cudf_streaming_mpirun_test_add(TEST_TARGET cudf_streaming_ucxx_tests) | ||||||
| else() | ||||||
| cudf_streaming_skip_optional_target(cudf_streaming_ucxx_tests "UCXX not found") | ||||||
| endif() | ||||||
| else() | ||||||
| cudf_streaming_skip_optional_target(cudf_streaming_mpi_tests "MPI not found") | ||||||
| endif() | ||||||
|
|
||||||
| rapids_test_install_relocatable( | ||||||
| INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcudf_streaming | ||||||
| ) | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /** | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights | ||
| * reserved. SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include "../environment.hpp" | ||
|
|
||
| #include <cudf_test/cudf_gtest.hpp> | ||
|
|
||
| #include <mpi.h> | ||
| #include <rapidsmpf/communicator/mpi.hpp> | ||
| #include <rapidsmpf/config.hpp> | ||
| #include <rapidsmpf/progress_thread.hpp> | ||
|
|
||
| #include <memory> | ||
|
|
||
| namespace { | ||
| class MPIEnvironment : public Environment { | ||
| public: | ||
| using Environment::Environment; | ||
|
|
||
| [[nodiscard]] TestEnvironmentType type() const override { return TestEnvironmentType::MPI; } | ||
|
|
||
| void SetUp() override | ||
| { | ||
| rapidsmpf::mpi::init(&argc_, &argv_); | ||
|
|
||
| RAPIDSMPF_MPI(MPI_Comm_dup(MPI_COMM_WORLD, &mpi_comm_)); | ||
|
|
||
| options_ = rapidsmpf::config::Options(rapidsmpf::config::get_environment_variables()); | ||
|
|
||
| comm_ = std::make_shared<rapidsmpf::MPI>( | ||
| mpi_comm_, options_, std::make_shared<rapidsmpf::ProgressThread>()); | ||
| } | ||
|
|
||
| void TearDown() override | ||
| { | ||
| split_comm_ = nullptr; // Clean up the split communicator. | ||
| comm_ = nullptr; // Clean up the communicator. | ||
|
|
||
| RAPIDSMPF_MPI(MPI_Comm_free(&mpi_comm_)); | ||
| RAPIDSMPF_MPI(MPI_Finalize()); | ||
| } | ||
|
|
||
| void barrier() override { RAPIDSMPF_MPI(MPI_Barrier(mpi_comm_)); } | ||
|
|
||
| std::shared_ptr<rapidsmpf::Communicator> split_comm() override | ||
| { | ||
| // Return cached split communicator if it exists | ||
| if (split_comm_ != nullptr) { return split_comm_; } | ||
|
|
||
| // Initialize configuration options from environment variables. | ||
| rapidsmpf::config::Options options{rapidsmpf::config::get_environment_variables()}; | ||
|
|
||
| // Create the new split communicator | ||
| int rank; | ||
| RAPIDSMPF_MPI(MPI_Comm_rank(mpi_comm_, &rank)); | ||
| MPI_Comm split_comm = MPI_COMM_NULL; | ||
| RAPIDSMPF_MPI(MPI_Comm_split(mpi_comm_, rank, 0, &split_comm)); | ||
| return std::shared_ptr<rapidsmpf::MPI>( | ||
| new rapidsmpf::MPI(split_comm, options, comm_->progress_thread()), | ||
| // Don't leak the split handle. | ||
| [comm = split_comm](rapidsmpf::MPI* x) mutable { | ||
| delete x; | ||
| MPI_Comm_free(&comm); | ||
| }); | ||
| } | ||
|
nirandaperera marked this conversation as resolved.
Resolved
|
||
|
|
||
| private: | ||
| MPI_Comm mpi_comm_{MPI_COMM_NULL}; | ||
| }; | ||
| } // namespace | ||
|
|
||
| Environment* GlobalEnvironment = nullptr; | ||
|
|
||
| int main(int argc, char** argv) | ||
| { | ||
| ::testing::InitGoogleTest(&argc, argv); | ||
| GlobalEnvironment = new MPIEnvironment(argc, argv); | ||
| ::testing::AddGlobalTestEnvironment(GlobalEnvironment); | ||
| return RUN_ALL_TESTS(); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.