Multi-GPU K-Means

View as Markdown

Source header: cuvs/cluster/mg_kmeans.h

Multi-GPU k-means clustering APIs

cuvsMultiGpuKMeansFit

Find clusters with single-node multi-GPU k-means using host data.

1CUVS_EXPORT cuvsError_t cuvsMultiGpuKMeansFit(cuvsResources_t res,
2cuvsKMeansParams_t params,
3DLManagedTensor* X,
4DLManagedTensor* sample_weight,
5DLManagedTensor* centroids,
6double* inertia,
7int* n_iter);

X, sample_weight, and centroids must be host-accessible, row-major, C-contiguous DLPack tensors. X and centroids must have dtype float32 or float64, and sample_weight must match X when provided.

Parameters

NameDirectionTypeDescription
resincuvsResources_tcuvsMultiGpuResources_t opaque C handle created by cuvsMultiGpuResourcesCreate or cuvsMultiGpuResourcesCreateWithDeviceIds.
paramsincuvsKMeansParams_tParameters for KMeans model.
XinDLManagedTensor*Host training instances to cluster. [dim = n_samples x n_features]
sample_weightinDLManagedTensor*Optional host weights for each observation in X. [len = n_samples]
centroidsinoutDLManagedTensor*Host centroids. When init is Array, used as the initial cluster centers. The final generated centroids are copied back to this tensor. [dim = n_clusters x n_features]
inertiaoutdouble*Sum of squared distances of samples to their closest cluster center.
n_iteroutint*Number of iterations run.

Returns

CUVS_EXPORT cuvsError_t