# nvidia/cuml architecture

> Architecture diagram of the GitHub repository nvidia/cuml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nvidia/cuml
- Repository: https://github.com/nvidia/cuml

## Overview

cuML is a GPU-accelerated machine-learning library with a native Python estimator API, a compatibility layer for accelerating existing scikit-learn/UMAP/HDBSCAN workflows, and selected distributed algorithms through Dask. The main user path is to create or supply data, fit/transform/predict with an estimator, and receive results in the configured output format. The graph preserves the README’s major capability areas and the documented CPU fallback. Many algorithm implementations are represented at their existing directories because their source was not sampled; edges reflect README statements or shown source references, not assumed internal call chains.

Main entry points: [`python/cuml/cuml`](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml) (Estimator API), [`python/cuml/cuml/accel/estimator_proxy.py`](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/accel/estimator_proxy.py) (Estimator proxy), [`python/cuml/cuml/internals/base.py`](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/base.py) (Estimator runtime), [`python/cuml/cuml/internals/outputs.py`](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/outputs.py) (Output conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_native["GPU-native API"]
  node_datasets["Data generation"]
  node_estimator_api["Estimator API"]
end

subgraph group_capabilities["ML capabilities"]
  node_cluster["Clustering"]
  node_decomposition["Dimensionality reduction"]
  node_linear["Regression and classification"]
  node_preprocessing["Preprocessing"]
  node_neighbors["Nearest neighbors"]
  node_text["Text features<br/>[text.py]"]
  node_selection["Model selection"]
  node_explanation["Model explanation"]
  node_metrics["Metrics"]
end

subgraph group_accel["Compatibility acceleration"]
  node_accel_entry["Accelerator entry<br/>[__main__.py]"]
  node_patches["Library patches"]
  node_proxy["Estimator proxy<br/>[estimator_proxy.py]"]
  node_profiling["Profiling tools<br/>[profilers.py]"]
end

subgraph group_distributed["Distributed execution"]
  node_dask["Dask algorithms"]
end

subgraph group_runtime["Shared runtime"]
  node_internals["Estimator runtime<br/>[base.py]"]
  node_validation["Input validation<br/>[validation.py]"]
  node_output["Output conversion<br/>[outputs.py]"]
  node_settings["Global settings<br/>[global_settings.py]"]
end

node_user(("Python user"))
node_data["Input data"]
node_result["Model and results"]

node_user -->|"generates data"| node_datasets
node_user -->|"supplies data"| node_data
node_datasets -->|"provides samples"| node_cluster
node_data -->|"fits or transforms"| node_estimator_api
node_estimator_api -->|"returns results"| node_result
node_estimator_api -->|"runs algorithms"| node_cluster
node_estimator_api -->|"runs algorithms"| node_decomposition
node_estimator_api -->|"runs algorithms"| node_linear
node_estimator_api -->|"runs transforms"| node_preprocessing
node_estimator_api -->|"runs workflows"| node_neighbors
node_estimator_api -->|"runs workflows"| node_text
node_estimator_api -->|"runs workflows"| node_selection
node_estimator_api -->|"runs workflows"| node_explanation
node_estimator_api -.->|"evaluates models"| node_metrics
node_user -->|"starts accelerator"| node_accel_entry
node_accel_entry -.->|"patches libraries"| node_patches
node_patches -->|"wraps estimators"| node_proxy
node_proxy -->|"returns results"| node_result
node_proxy -.->|"uses GPU estimators"| node_estimator_api
node_proxy -->|"falls back to CPU"| node_user
node_user -->|"checks execution"| node_profiling
node_user -->|"submits distributed work"| node_dask
node_dask -->|"returns results"| node_result
node_estimator_api -->|"uses estimator base"| node_internals
node_internals -.->|"validates inputs"| node_validation
node_internals -->|"converts results"| node_output
node_output -->|"reads output mode"| node_settings
node_proxy -->|"converts outputs"| node_output

click node_datasets "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/datasets"
click node_estimator_api "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml"
click node_cluster "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/cluster"
click node_decomposition "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/decomposition"
click node_linear "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/linear_model"
click node_preprocessing "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/preprocessing"
click node_neighbors "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/neighbors"
click node_text "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/feature_extraction/text.py"
click node_selection "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/model_selection"
click node_explanation "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/explainer"
click node_metrics "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/metrics"
click node_accel_entry "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/accel/__main__.py"
click node_patches "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/accel/_patches"
click node_proxy "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/accel/estimator_proxy.py"
click node_profiling "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/accel/profilers.py"
click node_dask "https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/dask"
click node_internals "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/base.py"
click node_validation "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/validation.py"
click node_output "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/outputs.py"
click node_settings "https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/global_settings.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_datasets,node_estimator_api,node_user toneBlue
class node_cluster,node_decomposition,node_linear,node_preprocessing,node_neighbors,node_text,node_selection,node_explanation,node_metrics toneAmber
class node_accel_entry,node_patches,node_proxy,node_profiling toneMint
class node_dask toneRose
class node_internals,node_validation,node_output,node_settings,node_data,node_result toneIndigo
```

## Components

### GPU-native API

- [Data generation](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/datasets): `python/cuml/cuml/datasets`
- [Estimator API](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml): `python/cuml/cuml`

### ML capabilities

- [Clustering](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/cluster): `python/cuml/cuml/cluster`
- [Dimensionality reduction](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/decomposition): `python/cuml/cuml/decomposition`
- [Regression and classification](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/linear_model): `python/cuml/cuml/linear_model`
- [Preprocessing](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/preprocessing): `python/cuml/cuml/preprocessing`
- [Nearest neighbors](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/neighbors): `python/cuml/cuml/neighbors`
- [Text features](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/feature_extraction/text.py): `python/cuml/cuml/feature_extraction/text.py`
- [Model selection](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/model_selection): `python/cuml/cuml/model_selection`
- [Model explanation](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/explainer): `python/cuml/cuml/explainer`
- [Metrics](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/metrics): `python/cuml/cuml/metrics`

### Compatibility acceleration

- [Accelerator entry](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/accel/__main__.py): `python/cuml/cuml/accel/__main__.py`
- [Library patches](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/accel/_patches): `python/cuml/cuml/accel/_patches`
- [Estimator proxy](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/accel/estimator_proxy.py): `python/cuml/cuml/accel/estimator_proxy.py`
- [Profiling tools](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/accel/profilers.py): `python/cuml/cuml/accel/profilers.py`

### Distributed execution

- [Dask algorithms](https://github.com/nvidia/cuml/tree/main/python/cuml/cuml/dask): `python/cuml/cuml/dask`

### Shared runtime

- [Estimator runtime](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/base.py): `python/cuml/cuml/internals/base.py`
- [Input validation](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/validation.py): `python/cuml/cuml/internals/validation.py`
- [Output conversion](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/outputs.py): `python/cuml/cuml/internals/outputs.py`
- [Global settings](https://github.com/nvidia/cuml/blob/main/python/cuml/cuml/internals/global_settings.py): `python/cuml/cuml/internals/global_settings.py`

### Other components

- **Python user**
- **Input data**
- **Model and results**

## Connections

- Python user → Data generation: generates data (evidence: `README.md`)
- Python user → Input data: supplies data (evidence: `README.md`)
- Data generation → Clustering: provides samples (evidence: `README.md`)
- Input data → Estimator API: fits or transforms (evidence: `README.md`)
- Estimator API → Model and results: returns results (evidence: `README.md`)
- Estimator API → Clustering: runs algorithms (evidence: `README.md`)
- Estimator API → Dimensionality reduction: runs algorithms (evidence: `README.md`)
- Estimator API → Regression and classification: runs algorithms (evidence: `README.md`)
- Estimator API → Preprocessing: runs transforms (evidence: `README.md`)
- Estimator API → Nearest neighbors: runs workflows (evidence: `README.md`)
- Estimator API → Text features: runs workflows (evidence: `README.md`)
- Estimator API → Model selection: runs workflows (evidence: `README.md`)
- Estimator API → Model explanation: runs workflows (evidence: `README.md`)
- Estimator API → Metrics: evaluates models (evidence: `python/cuml/cuml/internals/mixins.py`)
- Python user → Accelerator entry: starts accelerator (evidence: `README.md`)
- Accelerator entry → Library patches: patches libraries
- Library patches → Estimator proxy: wraps estimators (evidence: `python/cuml/cuml/accel/_patches/sklearn/pipeline.py`)
- Estimator proxy → Model and results: returns results (evidence: `README.md`)
- Estimator proxy → Estimator API: uses GPU estimators (evidence: `python/cuml/cuml/accel/estimator_proxy.py`)
- Estimator proxy → Python user: falls back to CPU (evidence: `README.md`)
- Python user → Profiling tools: checks execution (evidence: `README.md`)
- Python user → Dask algorithms: submits distributed work (evidence: `README.md`)
- Dask algorithms → Model and results: returns results (evidence: `README.md`)
- Estimator API → Estimator runtime: uses estimator base (evidence: `python/cuml/cuml/internals/base.py`)
- Estimator runtime → Input validation: validates inputs
- Estimator runtime → Output conversion: converts results (evidence: `python/cuml/cuml/internals/base.py`)
- Output conversion → Global settings: reads output mode (evidence: `python/cuml/cuml/internals/outputs.py`)
- Estimator proxy → Output conversion: converts outputs (evidence: `python/cuml/cuml/accel/estimator_proxy.py`)
