Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7a6bb81
adding distirbuted cudf streaming tests
nirandaperera Jun 12, 2026
4476694
precommit
nirandaperera Jun 12, 2026
eeb68c7
style
nirandaperera Jun 12, 2026
e0cbaec
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera Jun 12, 2026
cef0222
minor fix
nirandaperera Jun 13, 2026
dc213d8
Clarify file structure in Environment class comment
nirandaperera Jun 15, 2026
637eb54
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera Jun 15, 2026
74a226f
precommit
nirandaperera Jun 15, 2026
02b3979
addressing coderabbit comments
nirandaperera Jun 15, 2026
6507340
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera Jun 15, 2026
7c6544f
Rename functions and variables for consistency
nirandaperera Jun 16, 2026
b851330
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera Jun 16, 2026
a2703d5
Fix include directory formatting in CMakeLists.txt
nirandaperera Jun 16, 2026
2adc3d8
Update CMakeLists.txt
nirandaperera Jun 16, 2026
64f8918
Fix comment formatting in CMakeLists.txt
nirandaperera Jun 16, 2026
2a5f160
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera Jun 16, 2026
7e91b73
fix cmake
nirandaperera Jun 16, 2026
fbc93c3
cmake style
nirandaperera Jun 16, 2026
8d8037d
fix cmake
nirandaperera Jun 16, 2026
0aed2dd
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera Jun 16, 2026
e7e8e5d
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera Jun 16, 2026
934cb95
precommit
nirandaperera Jun 16, 2026
11ead06
percommit
nirandaperera Jun 16, 2026
e6b8717
Merge branch 'main' into adding-cudf-streaming-dist-tests
nirandaperera Jun 22, 2026
e1c7ccb
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera Jun 22, 2026
106cc10
Merge branch 'main' of github.com:rapidsai/cudf into adding-cudf-stre…
nirandaperera Jun 22, 2026
cfe66a8
Trigger Build
nirandaperera Jun 22, 2026
c2f7ecb
attempting to fix numpy lint error
nirandaperera Jun 22, 2026
2171a27
Revert "attempting to fix numpy lint error" & adding pre-commit clean
nirandaperera Jun 22, 2026
41bb34e
run precommit AGAIN!
nirandaperera Jun 22, 2026
a87107f
Merge branch 'main' into adding-cudf-streaming-dist-tests
vyasr Jun 23, 2026
55851a0
Fix conda recipe test: use renamed libcudf_streaming_single_tests binary
vyasr Jun 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/check_style.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail
Expand Down Expand Up @@ -28,4 +28,5 @@ mkdir -p "$(dirname "${RAPIDS_CMAKE_FORMAT_FILE}")"
wget -O ${RAPIDS_CMAKE_FORMAT_FILE} "${FORMAT_FILE_URL}"

# Run pre-commit checks
pre-commit clean
pre-commit run --all-files --show-diff-on-failure
4 changes: 2 additions & 2 deletions conda/recipes/libcudf/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
schema_version: 1

Expand Down Expand Up @@ -437,7 +437,7 @@ outputs:
- libnvcomp
tests:
- script:
- test -f $PREFIX/bin/gtests/libcudf_streaming/cudf_streaming_single_tests
- test -f $PREFIX/bin/gtests/libcudf_streaming/libcudf_streaming_single_tests
- test -f $PREFIX/bin/libcudf_streaming_bench_pack
- test -f $PREFIX/bin/libcudf_streaming_bench_partition
- test -f $PREFIX/bin/libcudf_streaming_bench_ndsh_bench_read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand All @@ -12,7 +12,10 @@ set(CUDF_STREAMING_FOUND_UCXX OFF)
set(CUDF_STREAMING_HAVE_MPI OFF)
set(CUDF_STREAMING_HAVE_UCXX OFF)

if(BUILD_BENCHMARKS OR BUILD_EXAMPLES)
if(BUILD_BENCHMARKS
OR BUILD_EXAMPLES
OR BUILD_TESTS
)
rapids_find_package(
MPI QUIET
BUILD_EXPORT_SET cudf_streaming-exports
Expand All @@ -23,7 +26,7 @@ if(BUILD_BENCHMARKS OR BUILD_EXAMPLES)
endif()
endif()

if(BUILD_BENCHMARKS)
if(BUILD_BENCHMARKS OR BUILD_TESTS)
rapids_find_package(
ucxx QUIET
BUILD_EXPORT_SET cudf_streaming-exports
Expand Down
16 changes: 15 additions & 1 deletion cpp/libcudf_streaming/cmake/thirdparty/get_cudf.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand All @@ -12,6 +12,20 @@ set(CUDF_STREAMING_MIN_VERSION
)
find_and_configure_cudf(${CUDF_STREAMING_MIN_VERSION} cudf_streaming-exports)

# The cudf-dependent tests link against cudf::cudftestutil{,_impl}, which live in cudf's optional
# `testing` component. The transitive find_dependency(cudf) triggered by find_and_configure_cudf
# does not request it, so request it explicitly here when building tests. This avoids having to
# build cudf from source: the component is provided by the installed (e.g. conda) cudf package.
if(BUILD_TESTS AND NOT TARGET cudf::cudftestutil)
find_package(cudf ${CUDF_STREAMING_MIN_VERSION} REQUIRED COMPONENTS testing)
Comment thread
nirandaperera marked this conversation as resolved.

foreach(_target cudf::cudftestutil cudf::cudftestutil_impl)
if(NOT TARGET ${_target})
message(WARNING "cudf testing target NOT available: ${_target}")
endif()
endforeach()
endif()

if(cudf_REQUIRES_CUDA)
rapids_cuda_init_architectures(CUDF_STREAMING)

Expand Down
127 changes: 111 additions & 16 deletions cpp/libcudf_streaming/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand All @@ -20,30 +20,63 @@ if(NOT EXISTS "${_cudf_streaming_gtests_link}")
file(CREATE_LINK "${CUDF_STREAMING_BINARY_DIR}/gtests" "${_cudf_streaming_gtests_link}" SYMBOLIC)
endif()

add_library(cudf_streaming_test_sources OBJECT)
# 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(libcudf_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 "libcudf_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(libcudf_streaming_mpirun_test_add)

add_library(libcudf_streaming_test_sources OBJECT)
set_target_properties(
cudf_streaming_test_sources
libcudf_streaming_test_sources
PROPERTIES CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
CUDA_STANDARD 20
CUDA_STANDARD_REQUIRED ON
)
target_include_directories(
cudf_streaming_test_sources PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
libcudf_streaming_test_sources PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
target_compile_options(
cudf_streaming_test_sources
libcudf_streaming_test_sources
PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS};--expt-extended-lambda>
)
target_link_libraries(
cudf_streaming_test_sources
libcudf_streaming_test_sources
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(
libcudf_streaming_test_sources PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>"
)
target_sources(
cudf_streaming_test_sources
libcudf_streaming_test_sources
PRIVATE streaming/test_table_chunk.cpp
streaming/test_read_parquet.cpp
streaming/test_channel_metadata.cpp
Expand All @@ -55,9 +88,9 @@ target_sources(
test_shuffler.cpp
)

add_executable(cudf_streaming_single_tests main/single.cpp)
add_executable(libcudf_streaming_single_tests main/single.cpp)
set_target_properties(
cudf_streaming_single_tests
libcudf_streaming_single_tests
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CUDF_STREAMING_BINARY_DIR}/gtests"
INSTALL_RPATH "\$ORIGIN/../../../lib"
CXX_STANDARD 20
Expand All @@ -67,22 +100,84 @@ set_target_properties(
CUDA_STANDARD_REQUIRED ON
)
target_include_directories(
cudf_streaming_single_tests PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
libcudf_streaming_single_tests PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
target_link_libraries(
cudf_streaming_single_tests
libcudf_streaming_single_tests
PRIVATE cudf_streaming rapidsmpf::rapidsmpf GTest::gmock GTest::gtest
$<TARGET_NAME_IF_EXISTS:conda_env> cudf_streaming_test_sources
$<TARGET_NAME_IF_EXISTS:conda_env> libcudf_streaming_test_sources
)
rapids_test_add(
NAME cudf_streaming_single_tests
COMMAND cudf_streaming_single_tests
NAME libcudf_streaming_single_tests
COMMAND libcudf_streaming_single_tests
GPUS 1
PERCENT 100
INSTALL_COMPONENT_SET testing
)

# ##################################################################################################
# MPI and UCXX based tests -------------------------------------------------------------------------
# These executables reuse libcudf_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(libcudf_streaming_mpi_tests main/mpi.cpp)
set_target_properties(
libcudf_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(
libcudf_streaming_mpi_tests PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
target_link_libraries(
libcudf_streaming_mpi_tests
PRIVATE cudf_streaming rapidsmpf::rapidsmpf cudf_streaming::optional_communication GTest::gmock
GTest::gtest $<TARGET_NAME_IF_EXISTS:conda_env> libcudf_streaming_test_sources
)
libcudf_streaming_mpirun_test_add(TEST_TARGET libcudf_streaming_mpi_tests)

if(CUDF_STREAMING_HAVE_UCXX)
add_executable(libcudf_streaming_ucxx_tests main/ucxx.cpp)
set_target_properties(
libcudf_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(
libcudf_streaming_ucxx_tests PRIVATE "${CUDF_STREAMING_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
target_link_libraries(
libcudf_streaming_ucxx_tests
PRIVATE cudf_streaming
rapidsmpf::rapidsmpf
cudf_streaming::optional_communication
ucxx::ucxx
GTest::gmock
GTest::gtest
$<TARGET_NAME_IF_EXISTS:conda_env>
libcudf_streaming_test_sources
)
libcudf_streaming_mpirun_test_add(TEST_TARGET libcudf_streaming_ucxx_tests)
else()
cudf_streaming_skip_optional_target(libcudf_streaming_ucxx_tests "UCXX not found")
endif()
else()
cudf_streaming_skip_optional_target(libcudf_streaming_mpi_tests "MPI not found")
endif()

rapids_test_install_relocatable(
INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcudf_streaming
)
37 changes: 25 additions & 12 deletions cpp/libcudf_streaming/tests/environment.hpp
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
/**
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights
* reserved. SPDX-License-Identifier: Apache-2.0
/*
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <cudf_test/cudf_gtest.hpp>

#include <rapidsmpf/communicator/communicator.hpp>

#include <memory>

enum class TestEnvironmentType : int {
MPI,
UCXX,
SINGLE,
};

/**
* Base test environment that exposes a communicator to the test suite. Concrete,
* communicator-specific environments (single/MPI/UCXX) derive from this class and are defined in
* the corresponding file in main dir, where the communicator-specific state (e.g. the MPI
* communicator) and headers live. Exactly one of them is linked into each test executable.
*/
class Environment : public ::testing::Environment {
public:
Environment(int argc, char** argv);
Environment(int argc, char** argv) : argc_(argc), argv_(argv) {}
~Environment() override = default;

void SetUp() override;
void SetUp() override = 0;

void TearDown() override;
void TearDown() override = 0;

void barrier();
virtual void barrier() = 0;

[[nodiscard]] TestEnvironmentType type() const;
[[nodiscard]] virtual TestEnvironmentType type() const = 0;

constexpr rapidsmpf::config::Options& options() { return options_; }
rapidsmpf::config::Options& options() { return options_; }

std::shared_ptr<rapidsmpf::Communicator> split_comm();
virtual std::shared_ptr<rapidsmpf::Communicator> split_comm() = 0;

std::shared_ptr<rapidsmpf::Communicator> comm_;

private:
std::shared_ptr<rapidsmpf::Communicator> split_comm_{nullptr};
protected:
int argc_;
char** argv_;
rapidsmpf::config::Options options_;
};

Expand Down
Loading
Loading