Accelerated Estimator Support#
cuml.accel accelerates the estimators listed below. Unsupported estimators
and operations continue to use their original CPU implementations.
Click an estimator name to display its full list of limitations.
General Behavior#
- Compatibility
The accelerator is tested with
scikit-learnversions 1.6 through 1.9,umap-learnversions 0.5.7 through 0.5.12, andhdbscanversions 0.8.39 through 0.8.44. Whencuml.acceldetects a version outside these ranges, it issues a runtime warning and continues. The untested version will likely still work, but it has not been validated and may have subtle compatibility issues. Some estimators use scikit-learn’s experimental Array API support and requirescikit-learn1.8 or newer for GPU acceleration.- CPU fallback
Estimators not listed below use their original CPU implementations. Listed estimators may also fall back for particular methods, hyperparameters, input types, or dependency versions. These fallbacks should be transparent and preserve the original workflow. Logging and Profiling explains how to identify which operations ran on the GPU and why others fell back to the CPU.
- Results
GPU and CPU implementations should provide comparable model quality, but they are not guaranteed to be numerically identical. Parallel floating-point operations may run in a different order, and some GPU algorithms use implementations designed for highly parallel hardware.
cuml.accelalso does not always generate the full set of fitted attributes that scikit-learn does. Missing attributes are typically inspection aids, such asn_iters_, rather than values required for inference. Compare appropriate model-quality metrics, such asmodel.scoreor accuracy, instead of comparing fitted coefficients directly.- Performance
Performance depends on the estimator and workload. Larger datasets generally benefit most. On small inputs, initialization and data-transfer costs can dominate, limiting the benefit of acceleration or even making execution slower. Some GPU operations use runtime-compiled kernels, so their first invocation may include compilation overhead. Warm up the operation before timing it, and compare end-to-end runtime with and without
cuml.accel. See Benchmarks for representative results.- Errors and warnings
Error and warning messages may differ from scikit-learn, and some errors may include C++ stack traces. Exceptions, failures, or measurably worse model quality are bugs and should be reported by opening an issue.
scikit-learn#
sklearn.cluster#
The algorithms used in cuML differ from those in scikit-learn. As such, you
shouldn’t expect the fitted attributes (e.g. labels_) to numerically match
an estimator fitted without cuml.accel.
To compare results between estimators, we recommend comparing scores like
sklearn.metrics.adjusted_rand_score or
sklearn.metrics.adjusted_mutual_info_score. For low-dimensional data, you
can also visually inspect the resulting cluster assignments.
KMeans
KMeans will fall back to CPU in the following cases:
If a callable
initis provided.If
Xis sparse.
SpectralClustering
SpectralClustering will fall back to CPU in the following cases:
If
assign_labelsis not"kmeans".If
affinityis not"nearest_neighbors"or"precomputed". Note that the default value ofaffinityin scikit-learn is"rbf", which is not GPU-accelerated.If
Xis sparse.
The following fitted attributes are currently not computed:
affinity_matrix_
DBSCAN
DBSCAN will fall back to CPU in the following cases:
If
algorithmisn’t"auto"or"brute".If
metricisn’t one of the supported metrics ("l2","euclidean","cosine","precomputed").If
Xis sparse.
Additional notes:
ONNX export via
skl2onnxis not supported for this estimator.
sklearn.covariance#
EmpiricalCovariance
EmpiricalCovariance has no known estimator-specific cuml.accel
limitations.
LedoitWolf
LedoitWolf has no known estimator-specific cuml.accel limitations.
sklearn.decomposition#
The sklearn.decomposition implementations used by cuml.accel use
different SVD solvers than the ones in scikit-learn, which may result in
numeric differences in the components_ and explained_variance_ values.
These differences should be small for most algorithms, but may be larger for
randomized or less-numerically-stable solvers like "randomized" or
"covariance_eigh".
PCA
PCA will fall back to CPU in the following cases:
If
n_components=0.If
n_components="mle".
Additional notes:
Parameters for the
"randomized"solver, such asrandom_state,n_oversamples, andpower_iteration_normalizer, are ignored.
IncrementalPCA
IncrementalPCA has no known estimator-specific cuml.accel limitations.
Additional notes:
partial_fitdoes not support sparse input. This matches scikit-learn; usefitfor sparse input or provide dense batches topartial_fit.
TruncatedSVD
TruncatedSVD will fall back to CPU in the following cases:
If
Xis sparse.
Additional notes:
Parameters for the
"randomized"solver, such asrandom_state,n_oversamples, andpower_iteration_normalizer, are ignored.
sklearn.ensemble#
The random forest implementation used by cuml.accel differs algorithmically
from the one in scikit-learn. As such, you
shouldn’t expect the fitted attributes (e.g. estimators_) to numerically match
an estimator fitted without cuml.accel.
To compare results between estimators, we recommend comparing scores like
sklearn.metrics.root_mean_squared_error (for regression) or
sklearn.metrics.log_loss (for classification).
RandomForestClassifier
RandomForestClassifier will fall back to CPU in the following cases:
If
criterionis"log_loss".If
oob_scoreis a callable.If
warm_start=True.If
monotonic_cstis notNone.If
max_samplesis an integer.If
min_weight_fraction_leafis not0.If
ccp_alphais not0.If
class_weightis notNone.If
sample_weightis passed tofitorscore.If
Xis sparse.If
Xcontains missing values (represented asNaN).If
yis a multi-output target.
RandomForestRegressor
RandomForestRegressor will fall back to CPU in the following cases:
If
criterionis"absolute_error"or"friedman_mse".If
oob_scoreis a callable.If
warm_start=True.If
monotonic_cstis notNone.If
max_samplesis an integer.If
min_weight_fraction_leafis not0.If
ccp_alphais not0.If
sample_weightis passed tofitorscore.If
Xis sparse.If
Xcontains missing values (represented asNaN).If
yis a multi-output target.
sklearn.kernel_ridge#
KernelRidge
KernelRidge will fall back to CPU in the following cases:
If
Xis sparse.If
kernelis not a string.
KernelRidge results should be almost identical to those of scikit-learn
when running with cuml.accel enabled. In particular, the fitted
dual_coef_ should be close enough that they may be compared via
np.allclose.
sklearn.linear_model#
The linear model solvers used by cuml.accel differ from those used in
scikit-learn. As such, you shouldn’t expect the fitted attributes (e.g.
coef_) to numerically match an estimator fitted without cuml.accel. For
some estimators (e.g. LinearRegression) you might get a close match, but
for others there may be larger numeric differences.
To compare results between estimators, we recommend comparing model quality
scores like sklearn.metrics.r2_score (for regression) or
sklearn.metrics.accuracy_score (for classification).
LinearRegression
LinearRegression will fall back to CPU in the following cases:
If
positive=True.
Additionally, the following fitted attributes are currently not computed:
rank_singular_
LogisticRegression
LogisticRegression will fall back to CPU in the following cases:
If
warm_start=True.If
intercept_scalingis not1.If the deprecated
multi_classparameter is used.If a callback is configured with
set_callbacks.
ElasticNet
ElasticNet will fall back to CPU in the following cases:
If
positive=True.If
warm_start=True.If
precomputeis notFalse.
Additionally, the following fitted attributes are currently not computed:
dual_gap_
Ridge
Ridge will fall back to CPU in the following cases:
If
positive=Trueorsolver="lbfgs".
Lasso
Lasso will fall back to CPU in the following cases:
If
positive=True.If
warm_start=True.If
precomputeis notFalse.
Additionally, the following fitted attributes are currently not computed:
dual_gap_
sklearn.manifold#
TSNE
TSNE will fall back to CPU in the following cases:
If
n_componentsis not2.If
initis an array.If
init="pca"andXis sparse.If
metricisn’t one of the supported metrics ("l2","euclidean","sqeuclidean","cityblock","l1","manhattan","minkowski","chebyshev","cosine","correlation").
Additional notes:
Even with a
random_state, the TSNE implementation used bycuml.accelisn’t completely deterministic.ONNX export via
skl2onnxis not supported for this estimator.
While the exact numerical output for TSNE may differ from that obtained without
cuml.accel, we expect the result quality to be approximately as
good in most cases. Beyond comparing the visual representation, you may find
comparing the trustworthiness score (computed via
sklearn.manifold.trustworthiness) or the kl_divergence_ fitted
attribute useful.
SpectralEmbedding
SpectralEmbedding will fall back to CPU in the following cases:
If
affinityis not"nearest_neighbors"or"precomputed".If
Xis sparse.If
Xhas only one feature.
The following fitted attributes are currently not computed:
affinity_matrix_
Additional notes:
ONNX export via
skl2onnxis not supported for this estimator.
sklearn.neighbors#
NearestNeighbors
NearestNeighbors will fall back to CPU in the following cases:
If
metricis not one of the supported metrics ("l2","euclidean","l1","cityblock","manhattan","taxicab","canberra","minkowski","lp","chebyshev","linf","jensenshannon","cosine","correlation","inner_product","sqeuclidean","haversine").
Additional notes:
The
algorithmparameter is ignored. cuML always uses the GPU-accelerated"brute"implementation.cuML does not implement
radius_neighbors, so this method always falls back to the CPU.ONNX export via
skl2onnxis not supported for this estimator.
KNeighborsClassifier
KNeighborsClassifier will fall back to CPU in the following cases:
If
metricis not one of the supported metrics ("l2","euclidean","l1","cityblock","manhattan","taxicab","canberra","minkowski","lp","chebyshev","linf","jensenshannon","cosine","correlation","inner_product","sqeuclidean","haversine").
Additional notes:
The
algorithmparameter is ignored. cuML always uses the GPU-accelerated"brute"implementation.
KNeighborsRegressor
KNeighborsRegressor will fall back to CPU in the following cases:
If
metricis not one of the supported metrics ("l2","euclidean","l1","cityblock","manhattan","taxicab","canberra","minkowski","lp","chebyshev","linf","jensenshannon","cosine","correlation","inner_product","sqeuclidean","haversine").
Additional notes:
The
algorithmparameter is ignored. cuML always uses the GPU-accelerated"brute"implementation.
KernelDensity
KernelDensity will fall back to CPU in the following cases:
If
metricis not one of the supported metrics ("cityblock","cosine","euclidean","l1","l2","manhattan","sqeuclidean","canberra","chebyshev","minkowski","hellinger","correlation","jensenshannon","hamming","kldivergence","russellrao","nan_euclidean").
Additional notes:
The
algorithm,atol,rtol,breadth_first, andleaf_sizeparameters are ignored. The GPU accelerated pairwise brute-force implementation in cuML will always be used.
sklearn.preprocessing#
StandardScaler
StandardScaler will fall back to CPU in the following cases:
If
Xis sparse.When run with
scikit-learn<1.8.If a callback is configured with
set_callbacks.
MinMaxScaler
MinMaxScaler will fall back to CPU in the following cases:
When run with
scikit-learn<1.8.
MaxAbsScaler
MaxAbsScaler will fall back to CPU in the following cases:
If
Xis sparse.When run with
scikit-learn<1.8.
PolynomialFeatures
PolynomialFeatures will fall back to CPU in the following cases:
If
Xis sparse.If
orderis"F".When run with
scikit-learn<1.8.
LabelEncoder
LabelEncoder has no known estimator-specific cuml.accel limitations.
LabelBinarizer
LabelBinarizer has no known estimator-specific cuml.accel limitations.
TargetEncoder
TargetEncoder will fall back to CPU in the following cases:
If
categoriesis not"auto".If
yis a multiclass target.If
random_stateis anumpy.random.RandomStateobject (integer seeds work fine).
Additional notes:
cuML and scikit-learn use different cross-validation fold assignment strategies during
fit_transform. Both are valid target encoding implementations, but samples are assigned to different folds, resulting in different leave-fold-out encodings for training data. Thetransformmethod on test data produces equivalent results since it uses global statistics computed from all training samples.
sklearn.svm#
The SVM implementations used by cuml.accel differ from those in scikit-learn.
As such,
you shouldn’t expect the fitted attributes (e.g. coef_ or
support_vectors_) to numerically match an estimator fitted without
cuml.accel.
To compare results between estimators, we recommend comparing model quality
scores like sklearn.metrics.r2_score (for regression) or
sklearn.metrics.accuracy_score (for classification).
SVC
SVC will fall back to CPU in the following cases:
If
kernel="precomputed"or is a callable.If
yis multiclass.If
probability=True. Theprobabilityparameter is deprecated inscikit-learn>=1.9, as well as incuml>=26.06. We recommend wrappingSVCwithsklearn.calibration.CalibratedClassifierCV, for exampleCalibratedClassifierCV(SVC(), ensemble=False). This approach is supported across scikit-learn versions and does not require CPU fallback.
SVR
SVR will fall back to CPU in the following cases:
If
kernel="precomputed"or is a callable.
LinearSVC
LinearSVC will fall back to CPU in the following cases:
If
Xis sparse.If
intercept_scalingis not1.If
multi_classis not"ovr".
Additional notes:
Use of sample weights may not produce exactly equivalent results when compared to replicating data according to weights.
LinearSVR
LinearSVR will fall back to CPU in the following cases:
If
Xis sparse.If
intercept_scalingis not1.
Additional notes:
Use of sample weights may not produce exactly equivalent results when compared to replicating data according to weights.
UMAP#
UMAP
UMAP will fall back to CPU in the following cases:
If
initis not"random"or"spectral".If
metricis not one of the supported metrics ("l1","cityblock","taxicab","manhattan","euclidean","l2","sqeuclidean","canberra","minkowski","chebyshev","linf","cosine","correlation","hellinger","hamming","jaccard").If
target_metricis not one of the supported metrics ("categorical","l2","euclidean").If
unique=True.If
densmap=True.If
ensure_all_finiteis notTrue.
Additional notes:
Reproducibility with the use of a seed (the
random_stateparameter) comes at the relative expense of performance.Parallelism during the optimization stage introduces numerical imprecision, which can lead to differences between CPU and GPU results.
ONNX export via
skl2onnxis not supported for this estimator.We have observed compatibility issues with UMAP when using
numba>=0.62.0. For best stability, we recommend usingnumba<0.62.0when accelerating UMAP withcuml.accel.
While the exact numerical output for UMAP may differ from that obtained without
cuml.accel, we expect the result quality to be approximately as
good in most cases. Beyond comparing the visual representation, you may find
comparing the trustworthiness score (computed via
sklearn.manifold.trustworthiness) useful.
HDBSCAN#
HDBSCAN
HDBSCAN will fall back to CPU in the following cases:
If
metricis not"l2"or"euclidean".If a
memorylocation is configured.If
match_reference_implementation=True.If
branch_detection_data=True.
Additionally, the following fitted attributes are currently not computed:
exemplars_outlier_scores_relative_validity_
Additional notes:
cuML’s
HDBSCANimplementation uses a parallel MST, which means the results are not deterministic when there are duplicates in the mutual reachability graph.ONNX export via
skl2onnxis not supported for this estimator.