Commit 8070dec
Use runs-on GPU runners for CI (#212)
* Use runs-on GPU runners for CI
Replace self-hosted GPU runners with runs-on g4dn.xlarge spot instances,
matching the approach in mlverse/torch#1439. Also modernizes the workflow:
- Action versions: checkout@v4, setup-python@v5, setup-r@v2, etc.
- Fix deprecated ::set-output → $GITHUB_OUTPUT
- Container: ubuntu18.04 → ubuntu20.04 (18.04 is EOL)
- Add --runtime=nvidia to container options
- Add concurrency groups with cancel-in-progress
- Simplify matrix to single config (CUDA 11.2.1, cuML 21.12, R release)
- Drop ASAN matrix dimension
* Revert container to ubuntu18.04 for CUDA 11.2 compatibility
* Use CUDA 11.2.2 container (11.2.1 removed from Docker Hub)
* Bump container to ubuntu20.04 (18.04 glibc too old for Node 20 actions)
* Split CI into build-image (free runner) and test-gpu (GPU runner)
- Build Docker image with cuda.ml pre-installed on ubuntu-latest (free)
- Run tests on runs-on g4dn.xlarge GPU runner using the pre-built image
- Add .github/docker/Dockerfile following the same pattern as mlverse/torch
- Make CMAKE_CUDA_ARCHITECTURES configurable via env var (defaults to NATIVE)
so cross-compilation works on runners without a GPU (targets T4 = SM 75)
- Remove miniconda install (no longer needed for reticulate tests)
* Fix sklearn install: use scikit-learn package name and py_require()
The 'sklearn' PyPI package is deprecated in favor of 'scikit-learn'.
Also switch from py_install() to py_require() which is the modern
reticulate API for declaring Python dependencies.
* Fix configure warnings: normalizePath ordering and cmake unused variable
- Move download_libcuml() before normalizePath() so the directory exists
- Reference CUML_STUB_HEADERS_DIR in both Treelite found/not-found branches
so cmake doesn't warn about unused variable
* Fix TSVD tests for SVD sign ambiguity between cuML and sklearn
SVD components are only defined up to sign, so different implementations
can produce sign-flipped vectors that are mathematically equivalent.
Align signs before comparing components and transformed data.
* Fix sklearn max_iter type: use integer (10000L) not float (10000.0)
Modern sklearn strictly validates that max_iter is an int. R's default
numeric type is double, which reticulate passes as a Python float.
Using 10000L ensures it's passed as a Python int.
* Add CRAN-like check job (no CUDA, stub headers, ubuntu-latest)
Runs R CMD check --as-cran on ubuntu-latest with R release and devel.
No nvcc/CUDA available, so the package builds with stub headers — matching
what CRAN would see.
* Update roxygen
* export S3 methods
* roxygen updates
* Fix CRAN check: escape Rd braces, skip tests without cuML
- Escape literal braces in roxygen comments across R source files and
templates (e.g. {cuda.ml} -> \{cuda.ml\}, {"opt1",...} -> \{"opt1",...\})
- Regenerate all affected Rd files via devtools::document()
- Skip test_check() when cuML is not linked (CRAN-like environments)
- Use R CMD check directly in CRAN job (avoids rcmdcheck NOT_CRAN=true)
* Fix examples brace escaping and register S3 methods
- Revert brace escaping inside @examples blocks (R code, not Rd markup)
- Define cuda_ml_can_predict_class_probabilities methods as proper
functions so roxygen registers them as S3method() in NAMESPACE
* Add RAPIDS cuML 26.04 + CUDA 12 support
Build infrastructure:
- Dockerfile: CUDA 12.8.1 + Ubuntu 22.04 base image
- libcuml_versions.R: add 26.04 entry pointing to PyPI libcuml-cu12 wheel
- cuml.R: handle pip wheel extraction (lib64/ layout, .whl extension)
- configure.R: handle lib64/ vs lib/ for pip wheels
- CMakeLists.txt.in: C++17, rapids-cmake branch-26.04
- Workflow: target cuML 26.04
C++ API changes for cuML 26.04:
- svm_serde.h: namespace alias MLCommon::Matrix -> ML::matrix for
KernelParams and KernelType (header renamed kernelparams.h ->
kernel_params.hpp)
- fil.cu, fil_utils.h, fil_utils.cu: disable FIL on 26.04 with stubs
(fil.h replaced by modular headers; full adaptation TODO)
- random_projection.cu: disable on 26.04 with stubs (C++ API removed)
- knn.cu: disable on 26.04 with stubs (raft::spatial::knn types removed)
- random_forest_classifier.cu, random_forest_regressor.cu: guard FIL
prediction paths for 26.04
Backward compatible: cuML 21.x with CUDA 11 still works.
* Test both cuML 21.12 and 26.04 in CI
- Dockerfile: accept CUDA_IMAGE as build arg for different base images
- Workflow: matrix over cuML 21.12 (CUDA 11.2) and 26.04 (CUDA 12.8)
- Each version gets its own build-image and test-gpu job
* Fix rapids-cmake version and lib symlink for dual cuML support
- CMakeLists.txt.in: template RAPIDS_CMAKE_TAG and CMAKE_CXX_STANDARD
so they adapt to the cuML version being built against
- configure.R: set rapids-cmake tag (v26.04.00 for 26.x, branch-21.10
for 21.x) and C++ standard (17 for 26.x, 14 for 21.x)
- cuml.R: don't create premature lib symlink in download_libcuml()
* Derive rapids-cmake tag from cuML version instead of hardcoding
Use vYY.MM.00 for cuML >= 23.02 (stable tags), vYY.MM.00a for older
versions (only alpha tags available).
* Require cmake 3.30.4+ for cuML 26.04 (auto-downloaded if missing)
rapids-cmake v26.04 needs cmake >= 3.30.4. The existing auto-download
logic handles this, but the min version threshold was hardcoded to 3.21.1.
Now it's 3.30.4 for cuML >= 23.02, 3.21.1 for older versions.
* Fix cuML 26.04 build: raft/rmm deps, static_assert, device_allocator
- Download libraft-cu12 and librmm-cu12 wheels alongside libcuml-cu12
(cuml headers include raft/rmm headers which are in separate packages)
- Merge raft/rmm headers into libcuml/include/ during download
- Remove static_assert(CUML_VERSION_MAJOR == 21) — allow 26+
- Guard raft::mr::device::allocator (removed in raft 26.x) with version
conditionals in device_allocator.cu/.h and stream_allocator.cu
- Use raft/core/handle.hpp instead of raft/handle.hpp for v26+
* Resolve cuML PyPI deps dynamically instead of hardcoding URLs
- Add tools/config/utils/pypi.R with resolve_native_deps() that walks
the PyPI dependency tree for a package and returns download URLs for
all native C++ dependencies (libraft, librmm, rapids-logger, cccl, etc.)
- libcuml_versions.R: cuML 26.04 entry is now just "libcuml-cu12"
(the PyPI package name), not a hardcoded URL
- cuml.R: download_libcuml() detects PyPI package names vs direct URLs,
resolves the full dep tree, downloads all wheels, and merges their
include/ directories into libcuml/include/
- configure.R: load pypi.R utility
- Uses jsonlite for PyPI JSON API parsing
* Download CCCL 3.3 headers for cuML 26.04 builds
RMM 26.04 headers require CCCL >= 3.3 at compile time, but CCCL is not
a pip dependency (it's normally bundled with the CUDA toolkit). CUDA 12.x
ships CCCL 2.x which is too old. Download CCCL v3.3.0 from GitHub
releases (header-only, ~2MB) and merge into libcuml/include/.
Also handle pip wheels that extract to nested dirs like
nvidia/<subpackage>/include/.
* Put CUML_INCLUDE_DIR before CUDA toolkit includes
CCCL 3.3 headers (bundled in libcuml/include/) must take precedence
over the CUDA 12 toolkit's older CCCL 2.x headers. Swap include order
so cuml/raft/rmm/cccl headers are found first.
* Fix CCCL compat, pinned_allocator removal, and raft handle API
- Use RAPIDS-pinned CCCL commit (CUDA 12 compatible) instead of v3.3.0
release tag which includes CUDA 13-only code
- pinned_host_vector.h: guard thrust::cuda::experimental::pinned_allocator
(removed in CCCL 3.x); use plain host_vector on v26+
- handle_utils.cu: raft::handle_t no longer has set_stream(); reconstruct
with stream_view via constructor on v26+
* Switch to cuML 25.12 (no CCCL 3.x requirement)
cuML 26.04's rmm headers require CCCL >= 3.3 which conflicts with
CUDA 12.x toolkit's CCCL 2.x. cuML 25.12 vendors its own CCCL in
librmm/include/rapids/ and has no CCCL version check — clean CUDA 12
compatibility.
- Target cuML 25.12 instead of 26.04
- Version guards: >= 26 -> >= 25 (same API changes apply)
- Re-enable KNN (knn.hpp exists in 25.12 with same API)
- Remove CCCL GitHub download (not needed)
- Update PyPI resolver to handle version pins (==25.12.*)
* Define LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE for RMM
RMM headers require this define (normally set automatically by RMM's
cmake config, but we're using headers directly from the pip wheel).
* Revert cuML 25.x/26.x support (CCCL 3.x incompatible with CUDA 12)
All RAPIDS 25.x+ pip wheels require CCCL 3.x headers which are
incompatible with CUDA 12's bundled CCCL 2.x. No version of
libcuml-cu12 can be compiled against a stock CUDA 12 toolkit.
Revert to cuML 21.12 as the default for now. Supporting newer cuML
will require either CUDA 13 or a custom build environment.
---------
Co-authored-by: Tomasz Kalinowski <kalinowskit@gmail.com>1 parent 54fc957 commit 8070dec
51 files changed
Lines changed: 312 additions & 208 deletions
File tree
- .github
- docker
- workflows
- R
- man-roxygen
- man
- src
- tests
- testthat
- tools/config
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | | - | |
13 | | - | |
| 10 | + | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | | - | |
18 | | - | |
19 | 14 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 15 | | |
27 | | - | |
| 16 | + | |
| 17 | + | |
28 | 18 | | |
29 | 19 | | |
30 | | - | |
31 | 20 | | |
32 | 21 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 22 | | |
37 | 23 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 24 | + | |
47 | 25 | | |
48 | | - | |
| 26 | + | |
49 | 27 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 28 | + | |
56 | 29 | | |
57 | 30 | | |
58 | | - | |
59 | 31 | | |
60 | 32 | | |
61 | | - | |
| 33 | + | |
62 | 34 | | |
63 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
64 | 55 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
74 | 93 | | |
75 | | - | |
76 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
77 | 97 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 98 | + | |
108 | 99 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 100 | + | |
| 101 | + | |
112 | 102 | | |
113 | | - | |
114 | | - | |
| 103 | + | |
115 | 104 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 105 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
12 | 24 | | |
| |||
43 | 55 | | |
44 | 56 | | |
45 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
46 | 67 | | |
47 | 68 | | |
48 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
0 commit comments