Skip to content

Modernize cuda.ml for CUDA 13.3 and RAPIDS cuML 26.6 - #211

Draft
t-kalinowski wants to merge 19 commits into
mainfrom
cran-updates
Draft

Modernize cuda.ml for CUDA 13.3 and RAPIDS cuML 26.6#211
t-kalinowski wants to merge 19 commits into
mainfrom
cran-updates

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Apr 24, 2026

Copy link
Copy Markdown
Member

Summary

Modernizes cuda.ml for CUDA 13.3 and RAPIDS cuML 26.6 while retaining version-guarded support for the existing cuML 21.x build paths.

The installation flow can now bootstrap RAPIDS cuML from pip wheels when a compatible GPU and CUDA toolkit are available. CRAN and non-GPU environments continue to receive a stub-only build with clearer diagnostics.

Why

The native integration assumed CUDA 11, cuML 21 APIs, the older Treelite/FIL interface, and a manually provisioned RAPIDS prefix. Current RAPIDS releases changed API signatures, resource handling, packaging layouts, and several model structures.

These differences caused compilation failures, incorrect host/device transfers, ignored normalization, invalid FIL probability output, stale incremental builds, and GPU CI packages being configured without GPU access.

Public-facing changes

  • Adds automatic RAPIDS cuML bootstrap through uv or Python/pip for CUDA 12 and 13.
  • Improves installation diagnostics and documents CUDA_HOME, CUML_PREFIX, CUML_BOOTSTRAP, and related configuration options.
  • Preserves normalize_input = TRUE behavior for lasso, elastic net, and ridge models on modern cuML.
  • Corrects FIL probability output for multiclass models using max_index postprocessing.
  • Correctly forwards KNN n_bits and updates behavior for modern KNN implementations.
  • Stabilizes TSVD component signs across cuML versions.
  • Produces clear errors for capabilities no longer supported by modern cuML:
    • non-default legacy FIL loading controls;
    • IVFSQ KNN;
    • random forest serialization without Treelite/FIL;
    • random projection when its cuML C API is unavailable.
  • Updates installation and package documentation for the current GPU and RAPIDS requirements.

Internal changes

  • Adapts clustering, decomposition, linear model, random forest, SVM, KNN, t-SNE, and UMAP bindings to modern cuML and RAFT APIs.
  • Retains version guards for the bundled cuML 21.x paths.
  • Replaces ambiguous Thrust copy dispatch with explicit host/device-aware asynchronous CUDA copies.
  • Migrates FIL and Treelite integration to the current forest model, import, prediction, and serialization APIs.
  • Uses modern RAFT stream resources and RAPIDS logging types.
  • Adds out-of-tree CMake builds, reliable incremental rebuilds, RAPIDS library discovery, and runtime library paths.
  • Moves GPU-linked package installation into the GPU-visible CI job.
  • Updates the CI image to CUDA 13.3 on Ubuntu 24.04 and verifies cuML linkage before running GPU tests.
  • Regenerates documentation with roxygen2 8.0.

Validation

  • CRAN check on R release
  • CRAN check on R devel
  • Docker CI image build
  • GPU-linked installation and full GPU test suite
  • Targeted FIL probability tests with RAPIDS 26.4 and Treelite 4.7
  • Regression tests for normalization, FIL controls, KNN compatibility, serialization, and stub-only behavior

All GitHub Actions checks pass.

Comment thread .github/docker/Dockerfile
&& rm -rf /tmp/* /root/.cache

# Install cuda.ml with tests
RUN R CMD INSTALL --install-tests /build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's important to keep installing the package in the docker image to avoid using the expensive GPU runner for compiling the C++ source.

@t-kalinowski t-kalinowski changed the title Updates for CRAN and CUDA Modernize cuda.ml for CUDA 13.3 and RAPIDS cuML 26.6 Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants