Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:Rapidsai Cuml Python RAPIDS Stack

From Leeroopedia


Knowledge Sources
Domains Infrastructure, Machine_Learning
Last Updated 2026-02-08 00:00 GMT

Overview

Python >= 3.11 runtime with the RAPIDS 26.4 ecosystem (cuDF, pylibraft, RMM) and scientific Python stack (NumPy, scikit-learn, scipy, treelite).

Description

This environment defines the Python interpreter and package dependencies required for cuML. All RAPIDS ecosystem packages are version-pinned to 26.4.* to ensure binary compatibility. The scientific Python stack (NumPy, scipy, scikit-learn) has minimum version constraints derived from API compatibility requirements. The cuml.accel module requires scikit-learn to be installed for transparent GPU acceleration of sklearn code.

Usage

This environment is required for all cuML Python API usage. It provides the Python bindings, data interchange formats (cuDF DataFrames, CuPy arrays), and the sklearn-compatible estimator interface. The cuml.accel accelerator also requires scikit-learn from this stack to intercept and accelerate sklearn imports.

System Requirements

Category Requirement Notes
Python >= 3.11, <= 3.13 Classifiers list 3.11 and 3.12; matrix includes 3.13
OS Linux Primary supported platform

Dependencies

RAPIDS Ecosystem (version-pinned)

  • cudf == 26.4.*
  • libcuml == 26.4.*
  • pylibraft == 26.4.*
  • rmm == 26.4.*

Scientific Python Stack

  • numpy >= 1.23, < 3.0
  • scikit-learn >= 1.5
  • scipy >= 1.13.0
  • treelite >= 4.6.1, < 5.0.0
  • joblib >= 0.11
  • packaging
  • rich

Optional Test Dependencies

  • xgboost >= 2.1.0
  • hdbscan >= 0.8.39, < 0.8.40
  • umap-learn == 0.5.7
  • hypothesis >= 6.0, < 7
  • pytest < 9.0
  • statsmodels

Credentials

No credentials required for the core Python stack. For testing:

  • CI: Set to "true" or "1" to indicate CI environment (adjusts test behavior).
  • HYPOTHESIS_ENABLED: Set to "true" or "1" to enable property-based testing with Hypothesis.

Quick Install

# Install core cuML (CUDA 12.x)
pip install cuml-cu12

# Install with test dependencies
pip install cuml-cu12[test]

# Install with conda (all dependencies resolved automatically)
conda install -c rapidsai -c conda-forge -c nvidia cuml python=3.12 cuda-version=12.9

Code Evidence

Python version requirement from python/cuml/pyproject.toml:81:

requires-python = ">=3.11"

Core dependencies from python/cuml/pyproject.toml:82-98:

dependencies = [
    "cuda-python>=13.0.1,<14.0",
    "cuda-toolkit[cublas,cufft,curand,cusolver,cusparse]>=12,<14",
    "cudf==26.4.*,>=0.0.0a0",
    "cupy-cuda13x>=13.6.0",
    "joblib>=0.11",
    "libcuml==26.4.*,>=0.0.0a0",
    "numba-cuda>=0.22.1",
    "numba>=0.60.0,<0.62.0",
    "numpy>=1.23,<3.0",
    "packaging",
    "pylibraft==26.4.*,>=0.0.0a0",
    "rich",
    "rmm==26.4.*,>=0.0.0a0",
    "scikit-learn>=1.5",
    "scipy>=1.13.0",
    "treelite>=4.6.1,<5.0.0",
]

sklearn version compatibility check from python/cuml/cuml/_thirdparty/_sklearn_compat.py:40-43:

import sklearn
from sklearn.utils.fixes import parse_version
sklearn_version = parse_version(parse_version(sklearn.__version__).base_version)

libcuml optional loading from python/cuml/cuml/__init__.py:8-14:

try:
    import libcuml
except ModuleNotFoundError:
    pass
else:
    libcuml.load_library()
    del libcuml

Common Errors

Error Message Cause Solution
ModuleNotFoundError: No module named 'cudf' RAPIDS cuDF not installed Install full RAPIDS stack: pip install cuml-cu12
ImportError: pylibraft version mismatch RAPIDS packages not version-aligned Ensure all RAPIDS packages are same 26.4.* version
sklearn version < 1.5 errors Old scikit-learn pip install scikit-learn>=1.5
ImportError: numba.cuda numba-cuda not installed pip install numba-cuda>=0.22.1

Compatibility Notes

  • RAPIDS Version Pinning: All RAPIDS ecosystem packages (cudf, pylibraft, rmm, libcuml) must be the same minor version (26.4.*). Mixing versions causes binary incompatibility.
  • scikit-learn Compatibility: cuml.accel wraps sklearn estimators. The _sklearn_compat.py module handles API differences between sklearn versions (e.g., tag system changes in sklearn 1.6).
  • NumPy 2.0: Supported (constraint is < 3.0). No known incompatibilities.
  • Build from Source: Requires additional build dependencies: cmake>=3.30.4, cython>=3.0.0,<3.2.0, ninja, and RAPIDS build libraries.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment