Skip to content

Link to libcuvs dynamically in wheel builds - #8250

Merged
rapids-bot[bot] merged 11 commits into
NVIDIA:mainfrom
divyegala:cuvs-wheels-dynamic
Jun 12, 2026
Merged

Link to libcuvs dynamically in wheel builds#8250
rapids-bot[bot] merged 11 commits into
NVIDIA:mainfrom
divyegala:cuvs-wheels-dynamic

Conversation

@divyegala

@divyegala divyegala commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Now that libcuvs wheels are available on PyPI, we do not need to maintain the static link in our wheel builds. This should make CI jobs faster and eliminate libcuvs related cache misses.

@divyegala divyegala self-assigned this Jun 10, 2026
@divyegala divyegala added the improvement Improvement / enhancement to an existing function label Jun 10, 2026
@divyegala
divyegala requested a review from a team as a code owner June 10, 2026 19:50
@divyegala divyegala added the breaking Breaking change label Jun 10, 2026
@divyegala
divyegala requested a review from a team as a code owner June 10, 2026 19:50
@divyegala
divyegala requested review from bdice and robertmaynard June 10, 2026 19:50
@github-actions github-actions Bot added Cython / Python Cython or Python issue CMake labels Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 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

Adds libcuvs==26.8.* to packaging with CUDA-specific wheel variants and an extra-index-url, removes depends_on_libcuvs from py_rapids_build_cuml includes, drops CUML_USE_CUVS_STATIC from CMake and CI args, calls libcuvs.load_library() during cuML preload, and tightens linkage test handling.

Changes

libcuvs Dependency Integration

Layer / File(s) Summary
Dependency matrix configuration with CUDA variants
dependencies.yaml
depends_on_libcuvs gains output_types: requirements, an --extra-index-url for rapidsai-wheels-nightly, and specific selectors to pick libcuvs-cu12 for cuda: 12.*, libcuvs-cu13 for cuda: 13.*, with an unsuffixed libcuvs fallback.
Python package dependency declarations
python/libcuml/pyproject.toml, dependencies.yaml
Adds libcuvs==26.8.*,>=0.0.0a0 to [project].dependencies and [tool.rapids-build-backend].requires; removes depends_on_libcuvs from py_rapids_build_cuml includes.
CMake build configuration cleanup
python/libcuml/CMakeLists.txt, ci/build_wheel_libcuml.sh
Removes set(CUML_USE_CUVS_STATIC ON) from the cuVS configuration section and removes the -DCUML_USE_CUVS_STATIC=ON flag from SKBUILD_CMAKE_ARGS in the CI wheel build script.
Runtime preload ordering for libcuvs
python/libcuml/libcuml/load.py
Imports libcuvs and calls libcuvs.load_library() immediately after rapids_logger.load_library() during library preload.
Linkage test strictness update
python/libcuml/tests/test_libcuml_linkage.py
When ldd reports actual_path == "not found", librmm.so and librapids_logger.so are no longer conditionally skipped and will be recorded as linkage failures.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

ci

Suggested reviewers

  • robertmaynard
  • jcrist
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: switching from static to dynamic linking of libcuvs in wheel builds, which aligns with all file modifications.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for switching to dynamic libcuvs linking and its benefits (faster CI jobs, fewer cache misses).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 and usage tips.

@bdice bdice 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.

@jcrist

jcrist commented Jun 10, 2026

Copy link
Copy Markdown
Member

Don't we need to add libcuvs to the list of wheel libs loaded in libcuml here: https://github.com/rapidsai/cuml/blob/f2776c1e2e2848d69e46606fb4d72bc3310d6d32/python/libcuml/libcuml/load.py#L40-L48?

@divyegala
divyegala requested a review from a team as a code owner June 10, 2026 21:22
@divyegala
divyegala requested a review from dantegd June 10, 2026 21:22
@divyegala

Copy link
Copy Markdown
Contributor Author

@jcrist good catch!

Comment on lines -150 to -153
# librmm.so and librapids_logger.so may not be found
# but are loaded dynamically at runtime, skip these
if lib_name in ["librmm.so", "librapids_logger.so"]:
continue

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.

These libraries were never in the expected_libs dictionary that only tests CUDAtoolkit dependencies whose rpath is modified. As we explicitly load RAPIDS dependencies, we don't have to test for these linkages.

@divyegala
divyegala requested a review from a team as a code owner June 11, 2026 03:10
@github-actions github-actions Bot added the ci label Jun 11, 2026

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ci/build_wheel_libcuml.sh (1)

46-53: ⚠️ Potential issue | 🟠 Major

Add libcuvs* to auditwheel repair exclusions in ci/build_wheel_libcuml.sh
ci/build_wheel_libcuml.sh runs python -m auditwheel repair with an EXCLUDE_ARGS list that does not exclude libcuvs*, unlike ci/build_wheel_cuml.sh which excludes libcuvs.so. This can cause auditwheel to bundle libcuvs into the libcuml wheel, negating the intended dynamic runtime dependency model.

Add matching --exclude "libcuvs.so.*" / --exclude "libcuvs_c.so.*" (or equivalent patterns used by your cuvs artifacts) to EXCLUDE_ARGS in ci/build_wheel_libcuml.sh.

🤖 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 `@ci/build_wheel_libcuml.sh` around lines 46 - 53, The auditwheel repair
invocation in ci/build_wheel_libcuml.sh omits libcuvs from EXCLUDE_ARGS,
allowing libcuVS to be bundled into the libcuml wheel; update the EXCLUDE_ARGS
array used by the python -m auditwheel repair call to include patterns excluding
libcuvs (e.g., --exclude "libcuvs.so.*" and/or --exclude "libcuvs_c.so.*") so
auditwheel does not repair/bundle libcuvs into the wheel when running the
command that uses EXCLUDE_ARGS and writes to ${RAPIDS_WHEEL_BLD_OUTPUT_DIR}.
🤖 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.

Outside diff comments:
In `@ci/build_wheel_libcuml.sh`:
- Around line 46-53: The auditwheel repair invocation in
ci/build_wheel_libcuml.sh omits libcuvs from EXCLUDE_ARGS, allowing libcuVS to
be bundled into the libcuml wheel; update the EXCLUDE_ARGS array used by the
python -m auditwheel repair call to include patterns excluding libcuvs (e.g.,
--exclude "libcuvs.so.*" and/or --exclude "libcuvs_c.so.*") so auditwheel does
not repair/bundle libcuvs into the wheel when running the command that uses
EXCLUDE_ARGS and writes to ${RAPIDS_WHEEL_BLD_OUTPUT_DIR}.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e3625e54-c88b-4276-a336-9e62c62a68fb

📥 Commits

Reviewing files that changed from the base of the PR and between 932bc18 and d77249f.

📒 Files selected for processing (1)
  • ci/build_wheel_libcuml.sh

@divyegala

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 507fe90 into NVIDIA:main Jun 12, 2026
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change ci CMake Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants