Skip to main content

cuML SQL API

Algeon exposes NVIDIA RAPIDS cuML as GPU UDTFs (user-defined table functions) in DataFusion SQL sessions. A UDTF either fits a model inside the query (TSVD, HDBSCAN, UMAP, logistic regression, random forests) or scores rows with a pretrained XGBoost, LightGBM or Treelite forest (cuml_forest_predict). Each result carries a row_ordinal and the id of the row it describes. The cuML UDTFs index lists every function; Discover & Validate GPU UDTFs and the GPU UDTF Catalog API cover discovery and validation.

Questions to explore​

Each question opens a captured example on its UDTF page. The examples read the demo investigations, which connect results to source records.

MerRec​

The MerRec investigation prepares shopper behavior features with SQL over 1.27 billion events, then scores or fits models on them in the same query.

EMBER2024​

Extracted file features from EMBER2024. Classifier comparisons use 1.56M Win32 training files and 359,994 later test files. The separate challenge cohort contains 6,315 malicious files.

Amazon Reviews​

Low-rating Electronics reviews from Amazon Reviews 2023, with 1,024-dimension BGE-M3 text embeddings.

Input and call shape​

Each relation argument (input, training, or predict) is a parenthesized SELECT subquery. Ordinary session tables and views can supply the projected rows. A bare table identifier is not an execution argument. ML Inputs specifies the canonical id, feature layouts, element types, and checks at planning and execution.

Execution and lifetime​

Embedded sessions install this SQL family with try_with_cuml_sql(), or with try_with_cuml_sql_config(CumlSqlConfig) to configure the models root that cuml_forest_predict reads. The Flight SQL server installs it for each session by default. GPU execution requires a binary built with the cuml Cargo feature and an installed AlgeonGpuBackend. Otherwise catalog entries remain discoverable with available=false and required_feature_disabled. The DataFusion session guide describes backend, execution-mode, and CumlSqlConfig setup.

The six fitting UDTFs evaluate their input within one call. Models and transforms are released after that call. There is no model cache, reuse across queries, or serialization, and no inference for neural networks trained in PyTorch. cuml_forest_predict instead reads and binds a model file from a server-configured models root. Without one configured, it is listed but unavailable with model_root_unconfigured. See Configuration for the [models] TOML table. Allocations run within the admitted query memory cap. Requests exceeding that cap produce a typed allocation error.

The GPU table functions design connects feature-matrix and model lifetimes to output ownership, native SQL consumers and the shared query memory cap.