Skip to content

Enable cudf_streaming distributed (MPI/UCXX) tests in CI - #22954

Merged
rapids-bot[bot] merged 11 commits into
NVIDIA:mainfrom
nirandaperera:enable_cudf_streaming_dist_tests_ci
Jul 2, 2026
Merged

Enable cudf_streaming distributed (MPI/UCXX) tests in CI#22954
rapids-bot[bot] merged 11 commits into
NVIDIA:mainfrom
nirandaperera:enable_cudf_streaming_dist_tests_ci

Conversation

@nirandaperera

Copy link
Copy Markdown
Contributor

Description

The installed/CI test path for libcudf_streaming previously only included libcudf_streaming_single_tests — the mpirun-launched MPI and UCXX gtest executables were registered with plain add_test() and never installed, so they silently did not run in CI. On the Python side, the pytest suite only ran single-rank. This PR makes the distributed tests first-class in CI.

Changes

cpp/libcudf_streaming/tests/CMakeLists.txt — unify test registration/installation (rapidsmpf-style):

  • Removed the rapids-test machinery (rapids_test_init / rapids_test_add / rapids_test_install_relocatable), since rapids_test_install_relocatable cannot faithfully round-trip a launcher-prefixed command (mpirun ... <exe>) into the installed CTestTestfile, which is why the MPI/UCXX tests had been left out.
  • All tests (single, MPI, UCXX) are now registered with plain add_test() using each executable's absolute build path, and every test target is tagged with a custom COMPONENT testing marker property.
  • A property scan discovers the tagged targets and installs them; the build-tree CTestTestfile.cmake is then re-rooted at install time (absolute build path → ./) and written next to the installed executables. The testing component remains EXCLUDE_FROM_ALL.
  • Net effect: cmake --install . --component testing now installs the single, mpi, and ucxx test executables plus a CTestTestfile.cmake that runs all of them; dropped the rapids GPU resource-spec scheduling (not needed — we don't run ctests in parallel across GPUs).

ci/run_cudf_streaming_pytests.sh — run the Python tests under mpirun across multiple ranks (1 2 3 4 5 8), matching rapidsmpf/ci/run_pytests.sh.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Signed-off-by: niranda perera <niranda.perera@gmail.com>
@nirandaperera
nirandaperera requested review from a team as code owners June 23, 2026 23:15
@nirandaperera
nirandaperera requested a review from bdice June 23, 2026 23:15
@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Jun 23, 2026
@nirandaperera nirandaperera added bug Something isn't working non-breaking Non-breaking change labels Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR updates libcudf_streaming test registration and install logic in CMake, caches the UCXX split communicator in tests, adds OpenMPI setup for CI ctest runs, expands the streaming pytest runner to multiple MPI rank counts, and removes a pre-commit clean step from the style check script.

Changes

CMake and UCXX test updates

Layer / File(s) Summary
CTest helpers and CTestTestfile generation
cpp/libcudf_streaming/tests/CMakeLists.txt
Writes a build-tree CTestTestfile.cmake that descends into tests, keeps nranks_to_run, introduces libcudf_streaming_test_add() for single-process tests, updates libcudf_streaming_mpirun_test_add() to emit one add_test() per rank using absolute executable paths under mpirun -np N, and adds libcudf_streaming_targets_with_property() to enumerate targets by property filter.
Testing markers and registration calls
cpp/libcudf_streaming/tests/CMakeLists.txt
Adds COMPONENT testing to libcudf_streaming_single_tests, libcudf_streaming_mpi_tests, and libcudf_streaming_ucxx_tests, and replaces rapids_test_add with libcudf_streaming_test_add for the single-process target.
Custom install and CTestTestfile relocation
cpp/libcudf_streaming/tests/CMakeLists.txt
Replaces rapids_test_install_relocatable with custom install logic that discovers COMPONENT testing targets, installs executables to bin/gtests/libcudf_streaming, and generates an install-time script that rewrites absolute build-tree paths to ./ in the installed CTestTestfile.cmake.
UCXX split communicator caching
cpp/libcudf_streaming/tests/main/ucxx.cpp
UCXXEnvironment::split_comm() lazily initializes and caches the split communicator, TearDown() resets the cached communicator before MPI_Finalize(), and the environment gains a split_comm_ member to store the cached value.

CI Script Updates

Layer / File(s) Summary
MPI CI execution updates
ci/run_cudf_streaming_ctests.sh, ci/run_cudf_streaming_pytests.sh
Updates SPDX headers, exports OpenMPI variables before ctest, captures pytest CLI args in EXTRA_ARGS, defines run_mpirun_test(nrank) with --cache-clear --verbose, and runs pytest under mpirun for rank counts 1, 2, and 5.
Remove pre-commit clean step
ci/check_style.sh
Removes the pre-commit clean invocation before running the pre-commit suite.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • rapidsai/cudf#22864: Both PRs modify cpp/libcudf_streaming/tests/CMakeLists.txt to add or adjust MPI multi-rank mpirun-launched add_test() registration logic via a *_mpirun_test_add helper.

Suggested labels

improvement, 3 - Ready for Review

Suggested reviewers

  • pentschev
  • vyasr
  • bdice
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: enabling distributed MPI/UCXX tests in CI.
Description check ✅ Passed The description accurately matches the changes to CI scripts and CMake test registration for distributed libcudf_streaming tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
cpp/libcudf_streaming/tests/CMakeLists.txt (1)

259-263: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Relocate script ignores DESTDIR, unlike the rest of the install.

The install(TARGETS ...) at Line 236 honors $ENV{DESTDIR} (CMake prepends it automatically for staged installs), but the hand-written file(WRITE "${CMAKE_INSTALL_PREFIX}/...") here does not. Under a DESTDIR-staged install the executables land in $DESTDIR/$PREFIX/bin/gtests/libcudf_streaming/, while CTestTestfile.cmake is written to the real $PREFIX, splitting the two apart (and potentially writing outside the staging root).

♻️ Honor DESTDIR in the relocation target path
 file(READ "${_src_ctestfile}" _ctest_contents)
 string(REPLACE "\"${_build_gtests_prefix}" "\"./" _ctest_contents "${_ctest_contents}")
-file(WRITE "${CMAKE_INSTALL_PREFIX}/bin/gtests/libcudf_streaming/CTestTestfile.cmake"
+file(WRITE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/gtests/libcudf_streaming/CTestTestfile.cmake"
      "${_ctest_contents}"
 )

$ENV{DESTDIR} is written literally inside the [=[ ]=] block and expands when the script runs at install time, matching CMake's standard staged-install behavior.

Please confirm whether the conda/CI install for the testing component ever runs with DESTDIR set; if it always installs directly to $PREFIX, this is purely defensive.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/libcudf_streaming/tests/CMakeLists.txt` around lines 259 - 263, The
file(WRITE) operation for CTestTestfile.cmake does not respect the DESTDIR
environment variable, unlike the install(TARGETS) command which honors it
automatically. To fix this, modify the file(WRITE) call that targets
"${CMAKE_INSTALL_PREFIX}/bin/gtests/libcudf_streaming/CTestTestfile.cmake" to
prepend "$ENV{DESTDIR}" to the path, changing it to
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/gtests/libcudf_streaming/CTestTestfile.cmake"
to ensure the CTestTestfile.cmake is written to the correct location during
staged installs with DESTDIR set.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/run_cudf_streaming_pytests.sh`:
- Around line 20-27: The mpirun command in the run_mpirun_test function uses -np
with values up to 5, which can exceed available MPI slots on smaller CI runners
and cause failures. Add the --oversubscribe flag to the mpirun command
invocation (the line starting with "mpirun --map-by node") to allow the MPI
processes to oversubscribe the available slots, ensuring the test runs
successfully regardless of the runner's slot availability.

---

Nitpick comments:
In `@cpp/libcudf_streaming/tests/CMakeLists.txt`:
- Around line 259-263: The file(WRITE) operation for CTestTestfile.cmake does
not respect the DESTDIR environment variable, unlike the install(TARGETS)
command which honors it automatically. To fix this, modify the file(WRITE) call
that targets
"${CMAKE_INSTALL_PREFIX}/bin/gtests/libcudf_streaming/CTestTestfile.cmake" to
prepend "$ENV{DESTDIR}" to the path, changing it to
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/gtests/libcudf_streaming/CTestTestfile.cmake"
to ensure the CTestTestfile.cmake is written to the correct location during
staged installs with DESTDIR set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a7fc3129-79ff-4bd2-867f-527aabf2c851

📥 Commits

Reviewing files that changed from the base of the PR and between ab94837 and ed49ca1.

📒 Files selected for processing (2)
  • ci/run_cudf_streaming_pytests.sh
  • cpp/libcudf_streaming/tests/CMakeLists.txt

Comment thread ci/run_cudf_streaming_pytests.sh Outdated
Signed-off-by: niranda perera <niranda.perera@gmail.com>
Signed-off-by: niranda perera <niranda.perera@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/run_cudf_streaming_ctests.sh`:
- Around line 29-33: Add a GPU preflight check in run_cudf_streaming_ctests.sh
before the ctest invocation so the job fails fast when no NVIDIA device is
visible. Use the existing script flow around the OpenMPI environment setup and
the ctest call to verify GPU availability first, and exit with a clear,
actionable error message if the check fails. Keep the check close to the ctest
entrypoint so misconfigured CI workers are caught early instead of producing
opaque test failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6c1da75e-2b40-450b-8008-59cb13b892a2

📥 Commits

Reviewing files that changed from the base of the PR and between ecd0852 and c483d8b.

📒 Files selected for processing (3)
  • ci/run_cudf_streaming_ctests.sh
  • ci/run_cudf_streaming_pytests.sh
  • cpp/libcudf_streaming/tests/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (2)
  • ci/run_cudf_streaming_pytests.sh
  • cpp/libcudf_streaming/tests/CMakeLists.txt

Comment thread ci/run_cudf_streaming_ctests.sh
Signed-off-by: niranda perera <niranda.perera@gmail.com>
@nirandaperera
nirandaperera requested a review from a team as a code owner June 24, 2026 19:27
Signed-off-by: niranda perera <niranda.perera@gmail.com>
@nirandaperera
nirandaperera force-pushed the enable_cudf_streaming_dist_tests_ci branch from c7e1a0e to d8294ea Compare June 24, 2026 22:01

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little concerned by some of the changes in this file. Why did we need to write custom relocation logic? Is it because using mpirun requires something specific from the choice of paths?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vyasr
Oh okay. IINM, rapids_test_add + rapids_test_install_relocatable handles relocation/ paths, by recreating the CTestTestFile.txt file based on resource specs. But, if I pass a test command like this, mpirun --map-by node ... -np <nranks> ... <test_exec>, the installation gets messed up (recreated ctest test file contains malformed paths). This was the original question I posted in rapids build channel.

So, changes in this file, adds test with a new component tag testing and then installs them to the bin path. Then installs the ctesttestfile with paths adjusted.

@vyasr vyasr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving so we can get testing up and running ASAP. We'll defer the CMake improvements to a follow-up.

@nirandaperera

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit ffadbfb into NVIDIA:main Jul 2, 2026
136 checks passed
@nirandaperera

Copy link
Copy Markdown
Contributor Author

Thanks @vyasr

@coderabbitai coderabbitai Bot mentioned this pull request Jul 8, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CMake CMake build issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants