Abstract
Uniform Manifold Approximation and Projection (UMAP) is a premier dimensionality reduction technique, yet its standard CPU implementation faces significant scalability challenges with large datasets. This paper introduces a high-fidelity, GPU-accelerated UMAP implementation within the RAPIDS cuML library. By re-engineering the algorithm's core stages—k-nearest neighbors search, neighborhood weighting, and stochastic gradient descent—using custom CUDA kernels and optimized memory management, the authors achieve speedups of up to 100x over traditional CPU implementations while maintaining mathematical faithfulness.
Introduction
Dimensionality reduction is essential for visualizing high-dimensional data, such as genomic sequences or image features, in 2D or 3D space. UMAP has emerged as a gold standard due to its ability to preserve local data structures better than predecessors like PCA. However, as datasets scale into the millions of samples, the standard Python implementation (UMAP-learn) becomes a computational bottleneck, often requiring hours for a single run.
Previous GPU-based attempts, such as GPUMAP, offered speed improvements but often compromised on "faithfulness"—the accuracy and reproducibility of the resulting embeddings compared to the original CPU implementation. This work presents a GPU-accelerated UMAP that is both significantly faster and mathematically consistent with the original algorithm.
Methodology
The authors re-engineered UMAP’s three primary computational stages for GPU execution:
- k-Nearest Neighbors (k-NN) Graph Construction: The standard CPU-based search was replaced with the FAISS library, a high-performance similarity search tool optimized for GPUs.
- Neighborhood Weighting: The team developed "fused kernels" to combine multiple operations (e.g., mean computation and smoothing) into a single GPU pass. This minimizes data movement between memory and processors, yielding a 12–15x speedup for this stage.
- Embedding Updates via Stochastic Gradient Descent (SGD): To address race conditions in parallel updates, the authors utilized shared memory caching. This technique aggregates updates locally on the GPU before committing them to global memory, drastically reducing atomic collisions.
Furthermore, the implementation includes a GPU-accelerated trustworthiness score to efficiently evaluate embedding quality.
Experimental Setup
The implementation was benchmarked across various domains:
- Image Classification: MNIST, Fashion MNIST, CIFAR-100, and COIL-20.
- Scientific/Tabular Data: Digits, Shuttle, and a single-cell RNA (scRNA) dataset (64.5k samples).
- Large-Scale NLP: The GoogleNews Word2vec dataset, comprising 3 million samples in 300 dimensions.
Key Results and Insights
The cuML implementation demonstrates massive performance gains. On the MNIST dataset, it achieved a 104.9x speedup over UMAP-learn. For the 3-million-sample GoogleNews dataset, where the CPU version failed to complete within a three-hour window, the GPU version finished in just 9.5 minutes.
Beyond raw speed, the authors addressed the "faithfulness gap." Direct GPU ports often suffer from precision issues due to parallel floating-point summation. By offering an optional 64-bit float accumulation mode, the authors ensured GPU results can match CPU outputs with high precision. As shown in the performance table below, cuML UMAP consistently outperforms previous GPU implementations like GPUMAP in both speed and trustworthiness scores.
The research also highlights that memory management is the primary bottleneck in GPU programming. By focusing on "zero-copy" exchanges and keeping data on the device, the authors minimized the latency "tax" associated with CPU-GPU data transfers.
Limitations and Future Work
While the current implementation excels at single-GPU training and distributed inference (embedding 10 million points in under 5 seconds using 8 GPUs), distributed training remains an open research challenge. Additionally, users must balance reproducibility and speed; 64-bit accumulation, while more precise, can reduce performance by 11x to 20x. Future work will focus on scaling the training phase across multi-node GPU clusters and further optimizing hyperparameter tuning workflows.
Summary updated