RAPIDS cuML (CUDA-accelerated Machine Learning) is a suite of GPU-accelerated machine learning libraries and algorithms designed to be fully compatible with scikit-learn APIs, enabling users to transition seamlessly from CPU to GPU without significant code changes. It's part of the broader RAPIDS ecosystem for data science, optimized for CUDA 12. The current version is 26.4.0, following a monthly release cadence aligned with the RAPIDS project.
pip install libcuml-cu12Verified import paths — ran on the pinned version, not inferred.
This example demonstrates how to perform k-means clustering using cuML. It generates synthetic data with scikit-learn, converts it to a cuDF DataFrame for GPU processing, and then fits a KMeans model to find clusters. It requires `cudf` and `scikit-learn`.
Ensure that sparse input data is only provided to cuML algorithms that explicitly support it, or convert sparse data to a dense format before passing it to unsupported algorithms.
If using custom or wrapped estimators, ensure they implement `_validate_data` and set `feature_names_in_` after fitting, consistent with scikit-learn's guidelines.
Review existing code for direct usage of `handle` objects and refactor to use higher-level cuML APIs. cuML now manages GPU resources internally for most use cases.
Explicitly specify `output_type` in the constructor for cuML estimators if you rely on a particular output type (e.g., `output_type='cudf'`).
If using cuML with Dask, ensure you install `dask` and `distributed` separately (e.g., `pip install dask distributed`).
Update method calls to use the `as_*` prefix (e.g., `model.as_cudf(X)` instead of `model.convert_to_cudf(X)`).