Manuscript Offprint
arXiv:2611.03934Accelerating FastDEC Clustering Algorithm with GPUs
Abstract
Fast Dominance Estimation Clustering (FastDEC) is an efficient variant of Density Peak Clustering (DPC), offering high clustering quality through dominance-based density estimation, while still being constrained by the computational cost of both exact -nearest-neighbor (-NN) construction and dominance component (DC) processing. In this paper, we present SymWarp-FastDEC, a graphics processing unit (GPU)-accelerated implementation of FastDEC. The proposed framework employs a set of GPU-specialized optimizations. At its core is SymTri-NN, an exact self--NN kernel that exploits the symmetry of the search setting through upper-triangular traversal and warp-cooperative top- selection. In addition, we introduce WP-DC, a warp-parallel dominance component (DC) reduction algorithm specifically designed to exploit the architectural characteristics of modern GPUs. Combined with a memory-adaptive execution planner and stream scheduling strategy, WP-DC effectively eliminates DC reduction as a runtime bottleneck.
We evaluate SymWarp-FastDEC on synthetic datasets and a diverse collection of real-world benchmarks. Experimental results demonstrate substantial end-to-end acceleration, and on all evaluated equivalence benchmarks SymWarp-FastDEC produces clustering outputs identical to the original FastDEC implementation. Relative to the FastDEC variant employing a widely used, highly optimized exact GPU -NN baseline, FAISS GpuIndexFlatL2, our approach delivers approximately to higher end-to-end performance, with both performing exhaustive (exact) -NN search and the advantage generally increasing as data dimensionality grows. Relative to the original single-threaded Python Fast-DEC reference implementation, speedups reach up to approximately ; this extreme figure arises in a very high-dimensional setting where that baseline's k-d-tree-based search degrades, and is not representative of the typical acceleration.
Keywords: FastDEC, Density Peak Clustering, DPC, clustering, GPGPU, data mining
1 Introduction
The proliferation of big data and the increasing complexity of computational tasks have created a growing demand for efficient and scalable data analysis algorithms. Clustering, a fundamental technique in data mining and machine learning, aims to group similar data objects into meaningful clusters based on their intrinsic characteristics (Fahad et al. 2014; Sajana et al. 2016; Bhattacharjee and Mitra 2021; Yin et al. 2026). Among the various clustering paradigms, density-based methods have attracted considerable attention because of their ability to identify clusters with arbitrary shapes while effectively handling noise and outliers (Yin et al. 2026). Density Peak Clustering (DPC), introduced by Rodriguez and Laio in 2014, is a representative density-based clustering algorithm that identifies cluster centers as data points exhibiting high local density and large distances from other points with higher densities (Rodriguez and Laio 2014). It is suitable for a wide range of real-world applications (Wei et al. 2023) but is computationally expensive. The calculation of local densities and pairwise distances limits scalability as dataset size increases (Wang et al. 2024).
Fast Dominance Estimation Clustering (FastDEC) (Yang et al. 2022) advances density peak clustering by integrating k-Nearest Neighbors (k-NN) graphs with dominance estimation to form dominance components (DC), significantly improving the efficiency of the clustering process. Nevertheless, opportunities for further improvements remain, particularly by exploiting parallel processing. Parallel computing has proven to be a practical solution for handling big data (Fang et al. 2008; Langdon 2013;
Shirkhorshidi et al. 2014; Xu et al. 2024). Traditionally, supercomputers were required for high-performance parallel computing to solve complex scientific problems (Upadhyaya 2013) but modern graphics processing units (GPUs) offer an alternative for general-purpose high-performance computing (Owens et al. 2008). In particular, they have been used to significantly accelerate algorithms for clustering problems (Li et al. 2022)—for example, by applying the general-purpose CUDA programming model on NVIDIA GPU architectures (Li et al. 2016). In this paper, we show that FastDEC's performance can be further enhanced by leveraging the parallel processing capabilities of GPUs.
Our primary contributions are summarized as follows:
-
To the best of our knowledge, we introduce the first GPU-accelerated FastDEC framework capable of scaling to large datasets, high-dimensional feature spaces, and a large number of cluster centers.
-
We propose a high-performance GPU-based k-NN algorithm specifically designed for FastDEC. Leveraging query-reference symmetry via tiled upper-triangular traversal, the method achieves efficient nearest-neighbor computation on large-scale, high-dimensional datasets.
-
We propose an efficient index-free algorithm for Dominance Component (DC) Inter-Dominance Estimation and Reduction on GPUs. Through warp-parallel reduction, memory-adaptive slab planning, and streamed ping-pong execution, the algorithm eliminates the nearest-neighbor constraints imposed by most existing GPU-based k-NN methods.
-
We decouple DC Inter-Dominance Estimation and Reduction from the spatial indexing structures employed during Density Estimation, thereby enhancing the flexibility, scalability, and general applicability of the FastDEC framework.
The remainder of this paper is structured as follows. Section 2 provides background on GPU architectures and reviews related work on Density Peak Clustering (DPC) and GPU-accelerated DPC methods. Section 3 introduces our GPU-accelerated Fast-DEC framework and describes its design, implementation, parallelization strategies, and optimization techniques. Section 4 presents a comprehensive experimental evaluation across diverse datasets and benchmarks the proposed method against FastDEC variants employing similarity-search algorithms from well-established libraries. Finally, Section 5 summarizes the main findings and outlines avenues for future work.
2.1 GPGPU
From a hardware perspective, and using NVIDIA terminology, a GPU consists of an array of streaming multiprocessors (SMs). Each SM contains multiple execution cores. These cores execute threads according to a Single-Instruction Multiple-Thread (SIMT) execution model, in which groups of threads typically execute the same instruction stream while operating on different data elements. Each SM possesses its own register file and a block of shared memory that is accessible only to the threads executing on that SM. In GPGPU programming, three principal memory types are commonly utilised: registers, shared memory, and global memory (also known as device memory). Registers are the fastest form of on-chip storage available to a thread, but the available register space is extremely limited. Shared memory is an on-chip memory resource that offers significantly lower latency and higher bandwidth than global memory. Shared memory typically ranges from tens to hundreds of kilobytes per SM depending on the GPU architecture. In contrast, device memory resides physically on the graphics card but outside the SMs themselves. It is referred to as global memory because it is accessible to all threads executing on the GPU. Device memory may also be accessed from the host through CUDA-managed memory mechanisms or explicit data-transfer operations. Because it is located off-chip, access latency may require hundreds of clock cycles, making it significantly slower than register or shared-memory access. Effective GPU programming therefore requires techniques that minimise or hide memory latency. Common approaches include tiled data loading from device memory into shared memory and pipelined execution strategies (NVIDIA 2026).
GPU threads are lightweight and incur minimal creation and context-switching overhead. Thousands of threads can be executed concurrently to help hide memory access latency. Threads are organised into groups known as warps, whose threads execute the same instruction stream on different data elements. Warps are further grouped into thread blocks. Each thread block is guaranteed to reside entirely on a single SM, enabling threads within the block to cooperate through shared memory and synchronisation primitives. In contrast, communication and synchronisation between different thread blocks are limited. Finally, thread blocks are organised into a computational grid, which is processed collectively by the GPU's array of streaming multiprocessors.
2.2 Density Peak Clustering (DPC)
Density Peak Clustering (DPC) is a density-based clustering algorithm proposed by Rodriguez and Laio in 2014 in their seminal Science paper, Clustering by Fast Search and Find of Density Peaks (FSFDP) (Rodriguez and Laio 2014). The fundamental idea of DPC is to identify cluster centers as data points that exhibit both high local density and a relatively large distance from any other point of higher density. These points, referred to as density peaks, are assumed to represent the centers of the underlying clusters. Similar to other density-based clustering algorithms, such as DBSCAN and
MeanShift, DPC can identify clusters with arbitrary shapes by estimating the density distribution of data points and exploiting the connectivity of high-density regions.
DPC and its numerous variants have been successfully applied across a wide range of domains. In bioinformatics, DPC has been employed for gene expression analysis, protein classification, and biological network analysis. In image processing and computer vision, it has been used for image segmentation, feature extraction, and object recognition. Applications have also been reported in social network analysis, anomaly detection, market basket analysis, and other data mining tasks (Guan et al. 2021; Li et al. 2022; Wei et al. 2023; Wang et al. 2024; Ren et al. 2025; Wang et al. 2025).
The FSFDP algorithm for DPC follows three key steps:
-
Density Estimation: For each point , the local density is estimated using a cutoff distance , where all neighbors within contribute to the density.
-
Distance to Higher Density: For each point , the distance to the nearest point of higher density is computed. Points with both large and large are identified as cluster centers, a.k.a. density peaks.
-
Cluster Assignment: Remaining points are assigned to the same cluster as their nearest denser neighbor, ensuring propagation of cluster membership.
By combining local density and relative distance to identify density peaks, FSFDP provides a mechanism for identifying cluster centers without prior knowledge of the number of clusters. It inspired many subsequent advancements in density peak clustering, including FastDEC (Yang et al. 2022), FastDPeak (Chen et al. 2020), and the GPU-accelerated FSFDP (Li et al. 2016).
2.3 Variants of the DPC Algorithm
FSFDP, like other well-known density-based clustering algorithms, suffers from high computational complexity, primarily due to the pairwise distance calculations it requires (Wang et al. 2024). In particular, it relies on brute-force search to find the nearest denser (ND) object for each data point, making it impractical for handling large datasets. Several variants of DPC have been proposed that aim to improve its efficiency and scalability. They explore different strategies, including: (1) algorithmic optimizations; (2) hardware acceleration through parallelization, and (3) data volume reduction. Below, we survey representative publications with a focus on those that do not rely on approximations and thus do not cover the algorithms in the third category Amagata and Hara (2021); Ma et al. (2023, 2024). The discussion of FastDEC, the algorithm we aim to improve in this paper, is deferred to a separate subsection.
2.3.1 Algorithmic optimizations
Algorithmic optimizations employ efficient data structures and algorithms for density estimation, local density peak identification, and cluster formation. They primarily apply modifications along two axes: (1) in the method for finding density peaks, and (2) in the method for combining local density peaks into final clusters.
Liu et al. (2018) propose SNN-DPC (Shared Nearest Neighbor DPC) to improve scalability by constructing a Shared Nearest Neighbor (SNN) graph from a k-NN graph. The edges are reweighted based on the number of shared neighbors, and DPC is applied to this compact graph.
Chen et al. (2020) propose FastDPeak to accelerate DPC for large-scale data, replacing traditional cutoff-based density estimation with kNN-density, which can be computed more efficiently using spatial indexing (e.g., cover trees). This reduces computational complexity from to . The algorithm distinguishes local and non-local density peaks, applying tailored strategies to compute dependent distances (): triangle inequality optimizations for local peaks and neighbor-based searches for non-local peaks.
Rasool et al. (2020) introduce an index-based approach, named Index-DPC, to accelerate density and distance computations. Several lists buffer object-wise significance information, and an efficient query algorithm avoids redundant comparisons.
Chen and Zhou (2021) propose C-DP to solve the problem of traditional DPC having difficulties to determine the correct number of clusters when dealing with datasets containing a single cluster with multiple density peaks. They apply the CURE (Clustering Using Representatives) algorithm on the density peak points identified by the traditional DPC. It iteratively combines sub-clusters with the closest representative point pairs using a Contraction Factor () to control cluster shape during CURE merging. C-DP requires tuning of the contraction factor and the merging strategy also adds computational overhead.
Zheng et al. (2021) proposed QuickDSC (Quick Density Subgraph Clustering), which partitions the input k-NN graph into subgraphs based on mutual k-NN connections and then applies DPC to each subgraph, thereby reducing computational costs. Subsequently, Jia et al. (2024) introduced the Adaptive Density Subgraph Clustering (ADSC) algorithm to overcome the limitations of QuickDSC, such as constraints on cluster size arising from the use of density subgraphs, which may result in an excessive number of small clusters and hinder accurate clustering, particularly when the true number of clusters is unknown.
2.3.2 Hardware Acceleration
Numerous studies have demonstrated the effectiveness of GPU acceleration in data clustering applications. For example, G-DBSCAN, a GPU-accelerated implementation of the density-based clustering algorithm DBSCAN, achieves significant performance improvements over conventional CPU-based implementations (Andrade et al. 2013). Similarly, GPU-accelerated implementations of the k-means algorithm have demonstrated substantial reductions in execution time compared with CPU implementations (Li et al. 2023).
Li et al. (2016) accelerate the DPC algorithm using CUDA (Paralleled FSFDP), optimizing thread/block models and shared memory usage to maximize GPU resource utilization. The authors use CUDA to parallelize the computation of distance matrices and potentials, achieving 7–15.75× speedup compared to CPU implementations.
Ge et al. (2017) speed up the DPC algorithm by accelerating all-pairs distance computation via massive GPU parallelism (CUDA-DP). It uses a structure-of-arrays data layout for coalesced memory access and parallel reduction for local density () and dependent distance () calculations. Experimental results show that it achieves 7-45x speedup vs. single-threaded CPU-based DPC on mid-sized datasets of 10k-100k points. Although it scales poorly on datasets with more than 500k points, CUDA-DP, together with Paralleled FSFDP above, demonstrates the feasibility of GPU-based DPC acceleration.
Su et al. (2020) present GPU-Accelerated Density Peaks Clustering (GDPC) to accelerate DPC. The core idea here is leveraging GPU parallelism to speed up the computationally intensive parts of the DPC algorithm. It relies on a spatial index structure called vectorized VP-tree to enable coalesced memory access, with nodes stored in GPU memory. Redundant distance calculations are reduced via VP-tree pruning. CUDA streams are used for overlapped VP-tree construction and distance computations. It also parallelizes the query process, using warp-centric work assignment to minimize divergence and ballot-counting optimization for efficient density computation within cutoff distance . However, the VP-tree construction may become a bottleneck for high-dimensional data ( dimensions), and the cutoff distance also requires tuning.
Multicore CPU computing provides an alternative approach to parallel clustering algorithms. Amagata and Hara (2021) propose several algorithms (Ex-DPC, Approx-DPC, S-Approx-DPC) in this category. Ex-DPC is an exact DPC accelerated by multicore parallelism. It uses an in-memory -d tree to accelerate local density () computation via range searches and dependent distance () computation via incremental nearest-neighbor searches. The local density computation is parallelized across
CPU cores using dynamic load balancing. Approximation strategies are applied to Approx-DPC and S-Approx-DPC: Approx-DPC uses grid-based joint range searches for coalesced memory access, and S-Approx-DPC employs grid sampling to trade precision for speed via cell-level clustering. Similar to GDPC, relying on a tree-based structure limits the exact algorithm's applicability to high-dimensional data.
2.4 Fast Dominance Estimation Clustering (FastDEC)
FastDEC leverages fast dominance estimation on k-Nearest Neighbors (k-NN) graphs (Yang et al. 2022) to improve the efficiency and robustness of DPC. The core concept of FastDEC revolves around dominance, where a point is considered to dominate another if it has a higher density and is within a certain distance threshold. By estimating dominance relationships, FastDEC effectively identifies cluster centers and assigns points to the nearest dominant center, forming clusters. Experimental results in both artificial and real-world datasets demonstrate that FastDEC consistently achieves top-tier results in clustering quality metrics (ARI and NMI). It outperforms or matches state-of-the-art methods such as Quickshift++, FINCH, QuickDSC, and SNN-DPC, all while maintaining competitive computational runtime.
Traditional DPC algorithms, such as the one proposed by Rodriguez and Laio (Rodriguez and Laio 2014), estimate the significance of data points using density and geometric distance factors. However, these algorithms often suffer from high computational complexity and require tuning multiple parameters. FastDEC addresses these challenges by integrating the nearest density-higher (NDH) relation with the k-NN graph to form dominance-components (DCs). The algorithm introduces the concept of direct k-NN dominators (DkD) and uses a novel significance estimation that incorporates the global rank of the dominator, in addition to density and geometric distance. It offers several distinct advantages:
-
Efficiency: It uses k-NN graphs to accelerate the identification of dominance components (LDPs - local Density Peaks), reducing computational complexity to near-linear in N and k via space indexing, avoiding the quadratic time complexity of traditional DPC.
-
Simplicity: It requires only one parameter, the number of nearest neighbors (k), which controls neighborhood granularity, simplifying configuration and tuning. It replaces DPC's fixed—and often difficult to choose—radius-based density estimation with kernel-based density estimation over the k nearest neighbors.
-
Robustness: Its clustering quality remains superior to competing methods across a wide range of k values (10 ≤ k ≤ 200) (Yang et al. 2022), and it is more robust to noise due to reliance on k-NN graphs and dominance estimation.
-
Interpretability: It introduces dominance estimation, evaluating the significance of data points using the global rank of the dominator, in addition to density and geometric distance.
The three main steps of the FastDEC algorithm can be broadly described as follows:
-
Density Estimation: For each data point, the algorithm estimates its local density using a fast, k-NN-based density estimation technique, which can employ different kernel functions.
-
Dominance Estimation: The algorithm then estimates the dominance relationships between points. A point p is considered to dominate another point q if p has a higher density and is within the distance threshold of q.
-
Cluster Formation: Based on the dominance relationships, the algorithm identifies cluster centers as points that are not dominated by any other point. This step relies on the global ranking factor of DCs to determine inter-relationships between DCs, so that DCs can be reduced to form the cluster centers. Each data point is then assigned to the nearest dominant center, forming clusters.
Algorithm 1 FastDEC
Require: Dataset , initial neighborhood size , target number of clusters Ensure: Cluster labels 1: Build space index for and construct the -NN graph for each point 2: Estimate the local density of each point from its -NN distances 3: Identify dominance links and extract the initial DCs 4: if the number of clusters is not specified then 5: Treat all DCs as cluster centers 6: Assign labels by dominance-based cluster formation 7: return 8: end if 9: Adjust the neighborhood size, if necessary, until at least DCs are obtained 10: If more than DCs are detected, reduce them by inter-dominance significance 11: Select the final DCs as cluster centers 12: Assign all remaining points by following closest density-higher (CDH) links 13: return
We now consider the steps of the algorithm in detail. Algorithm 1 outlines the overall framework. Lines 1 and 2 estimate the density of each data point using a -NN-based density estimator, as presented in Algorithm 2 and explained in detail in Section 2.4.1. Direct -NN Dominator (DkD) detection, shown in Line 3, is described in Algorithm 3. The extraction of Dominance Components (DCs), performed in Lines 10 and 11, is presented in Algorithm 4. Finally, Line 12 assigns all remaining data points to the identified cluster centers using Algorithm 5, thereby completing the clustering process.
2.4.1 Density Estimation
FastDEC estimates local density by first constructing a -nearest-neighbor (-NN) graph for the input dataset. Let denote a dataset containing samples. For each sample , the algorithm searches for its nearest distinct neighbors under the selected distance metric, where distinct means a different index ; points with coordinates identical to but a different index remain eligible neighbors. In the reference implementation of Yang et al., the -NN search is performed using an exact -d tree by default, although FastDEC itself only requires a -NN graph and is not tied to a particular nearest-neighbor search method. The query retrieves neighbors, including the point itself, after which the self-match is removed to obtain the k nearest distinct neighbors.
The -NN search produces two matrices: a neighbor-index matrix and a neighbor-distance matrix . Each entry stores the index of the -th nearest neighbor of , and each entry stores the corresponding distance.
The local density of each point is then estimated from its k-NN distances using an exponential kernel density estimator with a globally determined bandwidth based on the average nearest-neighbor distance. Specifically, FastDEC first computes the global mean nearest-neighbor distance over all points and their retrieved neighbors as
The density of point is then defined as
This estimator assigns high density to points located in compact neighborhoods, since small neighbor distances contribute larger exponential weights. Conversely, points in sparse regions or near cluster boundaries tend to have larger k-NN distances and therefore receive smaller density values.
The resulting density vector induces the density ordering used in the subsequent dominance detection stage, where each point is compared with its neighbors to identify nearby samples of higher density.
The original FastDEC paper describes a Gaussian kernel density estimator as the default density estimator. However, the reference implementation used in our experiments employs the exponential kernel density estimator defined below. To ensure fidelity to the published source code and reproducibility of results, we follow the implementation rather than the textual description in the original paper.
Algorithm 2 Density Estimation
Require: Dataset , neighborhood size , metric
Ensure: Density vector and -NN graph
1: Construct the -NN graph and obtain the neighbor-index matrix and neighbor-distance matrix ; let denote the distance from to its -th nearest neighbor.
2: Compute the mean -NN distance .
3: For each point , compute .
4: return and
2.4.2 Dominance Estimation
Dominance estimation, also known as Dominance Component (DC) detection, identifies points that are locally dominated by denser neighboring points. Let denote the density of point , and let be the ordered set of its nearest neighbors, sorted by increasing distance from . For each point , FastDEC scans and selects the first neighbor satisfying . This neighbor is defined as the closest density-higher (CDH) point of and is denoted .
A point without such a neighbor is a -NN mode. A dominance component (DC) is the set of points that reach a given -NN mode by repeatedly following cdh links (Yang et al. 2022); each DC contains exactly one mode, which is its densest point. For brevity, we identify each DC with its mode throughout this paper, and the modes form the pool of candidate cluster centers. Thus, the initial DC set is defined as
This step converts the density-ordered -NN graph into a directed dominance structure: every point other than a -NN mode points toward a nearby higher-density sample.
An adaptive refinement step is introduced to handle the scenario where the number of detected DCs is smaller than the requested number of clusters: the neighborhood
Algorithm 3 Dominance Detection
Require: Ordered -NN graph , density vector
Ensure: Dominance links cdh, DCs
1: for all points do 2: Find the nearest point such that 3: if such a point exists then 4: Define as the CDH point of : cdh(i) 5: else 6: Treat as a DC 7: end if 8: end for 9: is undefined} 10: return cdh and
size is iteratively halved and DC detection is re-invoked on the truncated (already-computed) indexing graph until enough DCs are found. This is a cheap way of enlarging the pool of density-peak candidates without any additional nearest-neighbor search. This halving is bounded: if is reduced to 1 and the number of detected DCs is still below the requested number of clusters, the procedure terminates and reports failure rather than halving further, since would be meaningless.
Because the -NN neighborhood is a strict subset of the full dataset, some points that appear to be local density maxima under this truncated search are not true global peaks—they are "false DCs" produced when a cluster's true higher-density mode lies just outside the -NN radius (e.g., on a plateau, saddle region, or at cluster boundaries with insufficient ). DC detection therefore over-approximates the true set of density peaks: a point is retained as a DC exactly when none of its own nearest neighbors has higher density. This candidate set therefore over-approximates the set of cluster centers: it may also contain spurious peaks. This over-approximation is deliberately cheap and is what allows the subsequent, more expensive step, DC reduction (also known as DC inter-dominance estimation), to perform an exhaustive ( per DC) dominance re-check restricted only to the small DC set—recovering the equivalent of DPC's global /decision-graph score without paying the full cost on the entire dataset.
2.4.3 DC Reduction
Given the set of DCs obtained from local dominance detection, FastDEC applies a DC reduction step to select the final cluster centers. Let denote the set of DCs, where is the number of DCs identified by the local dominance step. For each DC , the algorithm queries its complete nearest-neighbor ordering over the dataset and searches for the nearest point whose density exceeds that of the DC, i.e., .
This search estimates the inter-dominance relation between DCs and higher-density regions. For each DC , two quantities are recorded: , the geometric distance from to its nearest higher-density point, and , the rank at which that higher-density point appears in the global nearest-neighbor ordering. If no higher-density point exists, the DC is treated as globally dominant and is assigned the maximum observed distance and rank values.
The algorithm then normalizes the DC density, geometric distance, and dominance rank using min-max normalization. A significance score is computed for each DC as
where is the normalized density of DC , is its normalized distance to the nearest higher-density point, and is the normalized global dominance rank. DCs with high are simultaneously dense, well separated from higher-density regions, and difficult to dominate in the global neighbor ordering. The DC reduction step selects the top DCs with the largest significance scores, where is the desired number of clusters:
Algorithm 4 DC Reduction
Require: DCs , densities , dominance links cdh, target number of clusters
Ensure: Final cluster centers , completed dominance links cdh
1: for all do
2: Find the nearest higher-density point to in the global neighbor ordering
3: Record its distance and dominance rank
4: cdh() \quad global CDH link; left undefined if no such exists
5: end for
6: Min-max normalize , , and
7: Score each DC by .
8: Select the top DCs with the largest as
9: return and cdh
The selected set is used as the final set of cluster centers. In addition, the nearest higher-density point found for each DC is stored as its CDH link, , completing the dominance links that local dominance detection left undefined; this applies to every DC, including those not selected as centers, so that they and the points dominated by them can be labeled during cluster formation.
2.5 Cluster Formation
After the final cluster centers have been selected, FastDEC forms clusters by propagating labels along the dominance structure. Let denote the final set of selected cluster centers, and let denote the CDH point associated with sample (for a DC, the global CDH link recorded during DC reduction). The algorithm first initializes all sample labels as unassigned. Each selected center is then assigned a unique cluster label .
The remaining points are processed in descending order of density. For each unassigned point , FastDEC assigns it the same label as its CDH point, i.e., .
Because points are visited from high density to low density, the CDH point of has already received a label when is processed. This procedure defines a label propagation process over the directed dominance graph, where every non-center point
Algorithm 5 Cluster Formation
Require: Selected centers , dominance links cdh, densities
Ensure: Cluster labels
1: Assign distinct labels to all centers in
2: for all points in descending order of do
3: if is unlabeled then
4: Assign the label of cdh()
5: end if
6: end for
7: return
inherits the cluster membership of the denser point that dominates it. Consequently, each cluster consists of a selected density center and all samples that reach that center by repeatedly following CDH links.
Of the four steps, Step 1 (Density Estimation) and Step 3 (DC Reduction) dominate the runtime, largely because they require a substantial number of pairwise distance computations. Accordingly, this paper concentrates on accelerating these two stages.
3 GPU-accelerated FastDEC
FastDEC delivers high clustering quality with strong robustness to parameter choice and native support for arbitrary-shaped clusters, but its CPU-based implementation does not scale to datasets with millions of points. The dominant cost lies in the construction and maintenance of a spatial index—typically a -d tree—used to obtain the self--nearest-neighbor graph that underlies both density estimation and Dominance Component (DC) reduction. Because indexing overhead grows superlinearly with the number of points , and because DC reduction is tightly coupled to the index structure it queries, both stages become the dominant cost well before reaches millions of points. Closing this gap requires more than tuning the existing CPU pipeline: the self--NN and DC reduction stages must be rethought from the ground up.
A second, largely orthogonal limitation is FastDEC's failure to scale with dimensionality. The exact variant, which relies on a k-d tree for density estimation, degrades sharply once dimensionality exceeds roughly 10–20—a direct consequence of the curse of dimensionality, under which the pruning power of tree-based indices collapses as grows (Weber et al. 1998). Substituting an approximate index such as NNDescent extends density estimation to higher dimensions, but only relocates the bottleneck: DC reduction, no longer backed by the accuracy guarantees of an exact index, incurs substantial additional computation even on moderately sized datasets. Recent GPU-native exact k-NN methods are similarly oriented toward low-dimensional data: CLOVER (Kamel et al. 2025), for example, prunes distance computations using a graph over Voronoi cells and is explicitly optimized for 3D data; its evaluation is limited to 3- and 4-dimensional datasets, and its effectiveness on high-dimensional embeddings has not been demonstrated.
We address both limitations by re-architecting FastDEC's self-k-NN-based density estimation and DC reduction stages for GPU execution rather than porting the existing CPU pipeline. First, we remove redundant computation inherent to the self-k-NN setting: since the query and reference sets are identical, every off-diagonal pairwise distance benefits two points at once, so we compute only the upper-triangular block of the distance matrix and apply a bidirectional update, roughly halving the work of a generic k-NN formulation. Second, we replace index-based traversal with a family of FastDEC-specific, index-free kernels: self-k-NN distances are expressed as block-tiled matrix multiplication over precomputed squared norms, with warp-cooperative top- maintenance filtering candidates before they reach the heap, and DC reduction is likewise recast as a dense, index-free reduction over the same GPU-resident data. Because this formulation never builds or maintains an index, it avoids the branch divergence and irregular memory access patterns associated with tree traversal on GPUs while eliminating the dependency between indexing and DC reduction that constrains existing GPU-accelerated k-NN approaches. Crucially, the resulting pipeline remains exact: both self-k-NN construction and DC reduction are performed without algorithmic approximation, preserving the clustering quality, parameter robustness, and arbitrary-shape support of FastDEC. Although the redesign preserves the asymptotic complexity of these stages, it substantially lowers practical execution costs through redundant computation elimination, efficient GPU parallelization, and enhanced data reuse and memory locality. In particular, SymTri-kNN performs arithmetic with working memory, where is the traversal tile size chosen by the memory-adaptive planner, while WP-DC performs arithmetic, where is the number of candidate DC points. Because the memory-adaptive traversal never materializes the distance matrix, memory consumption grows approximately linearly with the stored dataset and neighbor lists, and no index construction is required. This enables datasets substantially larger and higher-dimensional than those practical under the original CPU implementation, although runtime remains quadratic in the number of points.
The resulting workflow performs exact self-k-NN and exact DC reduction on the GPU, improving scalability while, by design, computing the same density, dominance, and reduction criteria as the original FastDEC pipeline (up to floating-point precision). The proposed algorithm offers the following key features:
-
An index-free, purpose-built self-k-nearest-neighbor (k-NN) algorithm, termed SymTri-kNN, is used for density estimation. We show that SymTri-kNN scales favorably with dimensionality over the tested range (up to 32,768 dimensions): the dominant -dependent work is performed by highly optimized general matrix-matrix multiplication (GEMM) calls, one per visited tile. Top- heap maintenance, self-exclusion, and upper-triangular traversal are strictly independent of . We demonstrate empirically that this problem-specific design outperforms a widely used general-purpose GPU k-NN baseline: the FastDEC variant built on SymTri-kNN is approximately faster end-to-end than the FastDEC variant built on FAISS' exact GPU k-NN, with both variants performing exhaustive k-NN search and the speed advantage generally widening on higher-dimensional datasets.
-
A new DC reduction algorithm, Warp-Parallel DC Reduction (WP-DC), is introduced that does not depend on the index structure generated during density estimation. It features a dominance component reduction kernel that fuses closest density-higher (CDH) selection with dominance-count accumulation in a single GPU pass.
By decoupling DC reduction from density estimation, the proposed design removes restrictions on the choice of k in GPU-based similarity search algorithms and enables a wider range of GPU-accelerated k-NN methods to be integrated into the FastDEC framework. Consequently, future advances in k-NN algorithms can be incorporated directly into the framework.
We combine SymTri-kNN with WP-DC to form a GPU-accelerated end-to-end FastDEC pipeline, SymWarp-FastDEC, in which the computationally dominant stages execute on the GPU, and present the end-to-end speedups in Section 4.
In the following sections, we detail each step of the FastDEC framework, with particular emphasis on the two most computationally intensive steps, and describe the enhancements and optimizations that adapt the algorithm for efficient GPU acceleration when clustering large, high-dimensional datasets.
3.1 SymTri-kNN: Symmetric Upper-Triangular Exact Self-kNN on the GPU
FastDEC operates in the self-k-NN regime, where the query and reference sets are identical . General-purpose GPU k-NN libraries—including FAISS (GpuIndexFlatL2)—typically still treat Q and R as independent. As a result, they compute both and and then apply additional filtering to remove the trivial self-match .
We introduce SymTri-kNN, a CUDA-based exact self-k-NN algorithm tailored to FastDEC. SymTri-kNN exploits the symmetry of the pairwise distance matrix to eliminate redundant distance computation and to update the neighbor lists of both endpoints from each off-diagonal tile. Specifically, it leverages the assumption on three levels:
-
Triangular traversal. Squared-L2 distances are obtained from a tiled Single-precision General Matrix-Matrix Multiplication (SGEMM) of the form , but only tiles with are launched, halving the GEMM work, and the input reads it performs, relative to a -vs- schedule.
-
Symmetric bidirectional top- update. Each off-diagonal tile is computed once and consumed by two stream-ordered, warp-cooperative selection passes: a forward pass that updates the top- heaps of block , and a reverse pass that updates those of block from the same tile, without a second GEMM. From the second tile row onward, the forward pass also marks, in a bitmap, the tile entries that beat the current -th-best distance of their reference point, so that the reverse pass reads only those entries rather than the whole tile. Each point's heap persists in global memory between kernel launches and is staged into shared memory by a single warp for the duration of an update; since every heap is owned by exactly one warp at a time and successive tile kernels are stream-ordered, insertions require no cross-warp locking. Ballot-filtered candidate gating ensures that only candidates beating the heap's current -th-best distance are inserted, so only candidates that can actually improve a heap pay the update cost.
-
Index-based self-exclusion. A candidate whose global index equals that of the query point is rejected inside the same warp-wide predicate used for ballot-filtered candidate gating, so self-exclusion adds no separate branch to the insertion loop.
Because exclusion is by index rather than by distance, exact duplicates of a point (identical coordinates, different indices) remain eligible neighbors, and no host-side post-processing of the neighbor lists is required to remove self-matches.
Squared point norms are precomputed once, so that each squared distance is reconstructed from a single dot product produced by the SGEMM; arbitrary dimensionality is therefore handled by cuBLAS rather than by custom shared-memory tiling.
3.1.1 Symmetric Upper Triangle Traversal
This algorithmic component exploits the symmetry of the pairwise distance matrix through tiled upper-triangular traversal. Figure 1 illustrates the idea. Panel (a) depicts the block-tile structure of the query-reference distance matrix, organized as a grid of query blocks (rows) against reference blocks (columns). Tiles on and above the diagonal are explicitly computed via GEMM: off-diagonal tiles (shaded blue) pair two distinct blocks, while diagonal tiles (shaded orange) correspond to self-blocks where i = j. Tiles below the diagonal (hatched) are skipped entirely, since their distances are reused from the already-computed transpose tile rather than recomputed. An inset highlights a representative tile to indicate the detail expanded in panel (b).
Panel (b) details the per-tile computation pipeline. A query block (qb points) and reference block (rb points) are passed to a single SGEMM call that computes . The squared point norms and are then added to and the result clamped to be non-negative, yielding the distance tile . This single distance tile drives two independent, warp-cooperative top-k updates: a row-wise update maintaining the smallest distances for , and a column-wise update maintaining the smallest distances for — the latter reading the tile column-wise (by a strided read, an explicit transpose, or, from the second tile row onward, only the entries marked in the survivor bitmap) and skipped for diagonal tiles ( ). This dual-update design allows a single GEMM tile to advance the top-k neighbor

Fig. 1: The grid of point blocks used by the exact self-k-NN kernel. (a) Because the reference set and query set are identical, only the upper-triangular and diagonal tiles () are computed. Each computed tile is reused, through a second (reverse) selection pass, for its transposed position rather than recomputed, reducing the number of GEMM calls by approximately one half. Diagonal tiles () require updates only once. (b) Detail of a computed tile. A single GEMM computes the term for the entire tile, which is combined with precomputed squared norms to form the distance tile. The resulting distances are then processed by two independent warp-cooperative kernels that update the top- heaps of both the query block and the reference block from the same computation.
lists of both its query and reference blocks, which is what enables the upper-triangular traversal in panel (a) to avoid redundant computation.
Algorithm 6 formalizes the block-tiled traversal outlined above. It begins by pre-computing the squared norm of every point once (line 1) and giving each point an empty, bounded-capacity max-heap to hold its current best candidates (line 2). The points are then partitioned into query and reference blocks, and the algorithm sweeps only the upper-triangular block pairs (lines 4-7): since the query and reference sets are identical, computing pair and its mirror separately would be redundant, so each unordered pair of blocks is visited exactly once. For the visited pair, a single dense matrix multiplication produces the cross term for the entire tile in one call (line 8), which is then combined with the precomputed norms to reconstruct the squared Euclidean distance tile (line 9)—turning the dominant
Algorithm 6 SYMTRI-KNN: Exact Self-k-NN via Tiled Upper-Triangular Computation
Require: point set , neighbor count
Ensure: for every point : its nearest neighbors (dist, idx)
1: norm for all precompute squared norms once
2: for all per-point top- candidate heap
3: choose block sizes from available device memory square tiling is required for symmetry
4: for do iterate query blocks
5:
6: for do reference blocks: upper triangle only
7:
8: one SGEMM call per tile
9: for all tile entries
10: UPDATETOPK(, idx(), idx(), ) row-wise: updates query block
11: if then
12: UPDATETOPK(, idx(), idx(), ) mirrored update of — no recomputation
13: end if
14: end for
15: end for
16: for to do
17: sorted ascending by distance
18: (elementwise)
19: end for
20: return
cost of the algorithm into a small number of large, hardware-optimized GEMM calls rather than a pairwise distance loop.
The resulting tile is consumed by the UPDATETOPK subroutine (Algorithm 7), which the driver calls twice whenever : once on to update the query block's heaps, and once on —at no extra distance computation cost—to update the reference block's heaps, so one computed tile resolves both directions of the pair; diagonal tiles () require only the first call, since they have no mirror. Inside UPDATE-TOPK, each target point's heap is updated independently and in parallel: a candidate
Algorithm 7 UPDATETOPK: Candidate-Filtered Heap Update for One Distance Tile
1: procedure UPDATETOPK(H, targets, sources, D) 2: for each targets in parallel do 3: 4: for each sources do 5: if and then 6: insert into ; 7: end if 8: end for 9: end for 10: end procedure
is only inserted if it beats the point's current -th-best distance, so points whose neighbor lists are already unlikely to change do most of their work in a cheap comparison rather than a heap update.
The block size used for GEMM tiling is chosen adaptively from the amount of free device memory at runtime, with a fallback search over candidate sizes if the preferred allocation fails. This allows a single implementation to adapt its tile size to the size of the set of points and the available memory of the device without manual retuning per data set or GPU; the underlying cost of pairwise-distance is not affected by this adaptivity.
3.1.2 Tile Size Planner and Traversal Scheduler
The planner is responsible for choosing the dot-product tile size and allocating the reusable workspace. The block size that parameterizes this traversal is selected once, before the main loop begins, through a two-stage procedure that separates prediction from verification. First, given the amount of free device memory reported at runtime, the implementation reserves a fixed fraction of it as a workspace budget and searches a small set of candidate block sizes—coarser for large point sets, finer for small ones—returning the largest candidate whose quadratic memory footprint fits within that budget and does not exceed . Preferring the largest feasible size is deliberate: larger GEMM tiles push the underlying dense linear algebra kernel closer to peak throughput and amortize launch overhead over more useful work. Second, because a free-memory query only estimates whether a contiguous allocation will actually succeed, the implementation attempts the allocation at the predicted size and, if it fails, falls back through a further list of decreasing candidate sizes until one succeeds. The resulting size is applied uniformly to both the query and reference block dimensions, which is what preserves the square, symmetric tiling the traversal scheduler relies on. Because this workspace is allocated once and reused across the entire traversal, the cost of the search is incurred a single time per invocation, independent of how many block pairs are subsequently processed, allowing the same implementation to adapt its tile size to point sets of very different sizes without manual returning—though this adaptivity to dataset size does not change the arithmetic complexity of the underlying pairwise-distance computation.
The planner therefore optimizes for three goals:
-
Large SGEMM efficiency. Larger tiles give the BLAS backend more work per call and generally improve GPU utilization.
-
Memory feasibility. The tile size is selected according to available memory, avoiding hard failure on smaller GPUs.
-
Symmetry preservation. Query and reference tile sizes are kept equal, so that upper-triangular scheduling remains valid.
The scheduler traverses the pairwise tile matrix produced by the planned square tiling. The traversal scheduler restricts the double loop over query and reference blocks to the upper triangle of the block grid (Algorithm 6, lines 4–13; Figure 1a). Because a query or reference block is simply a pointer offset into a single resident device buffer, forming a block requires no data movement; the scheduler instead controls only which block pairs are visited, and in what order the resulting distance tile is consumed. For an off-diagonal pair with , a single GEMM call produces the pairwise dot-product tile, which is then read twice under two different traversal orders rather than recomputed: once row-wise, to update the top- heaps of the query block, and once more, to update the top- heaps of the reference block—read directly in column order for small , or first transposed on-chip into a coalesced layout for larger —so that one tile resolves both directions of the pair at the cost of a single matrix multiplication. Diagonal pairs () require only the row-wise pass, since scanning a block against itself already gives every point in it a turn as query against every other point, with self-matches excluded explicitly. This traversal order lets the scheduler visit each unordered block pair exactly once while still fully updating every block it touches, halving the number of GEMM calls relative to a naive dense traversal without any loss of correctness.
Within each update kernel, scheduling is warp-based: a CUDA block consists of 256 threads (8 warps), with each warp assigned to the top- update of a single point, as described in Section 3.1.3.
3.1.3 Warp-Cooperative Top- Selection
SymTri-NN uses a streaming warp-cooperative top- selection algorithm to avoid materializing and sorting full pairwise distance lists, converting exact -NN search from full-list sorting into streaming top- maintenance. Each warp is assigned to one data point and maintains the current best nearest-neighbor set of that point as a small max-heap in shared memory. For each distance tile, the warp proceeds as follows:
-
Load the point's current top- heap from global memory to shared memory.
-
Scan a tile of candidate points cooperatively across warp lanes.
-
Use warp ballots to identify candidates that improve the heap.
-
Insert only improving candidates into the shared-memory max-heap.
-
Write the updated heap back to global memory.
Algorithm 8 details the warp-cooperative procedure used to update the top- neighbor heaps from a computed distance tile. Each warp is assigned to a single query point
Algorithm 8 Warp-Cooperative Top-k Selection
Require: Distance tile represented by dot products ; squared norms ; tile offsets ; current top- heaps ; neighbor count
Ensure: Updated top- heaps
1: Assign one warp to each query point in the query tile 2: Load into shared memory 3: distance of the root of Lexicographically largest retained pair 4: for all candidate batches of 32 reference points do 5: Each warp lane evaluates one candidate 6: Compute . 7: Clamp 8: Mark lane active iff
and .
9: Ballot(active lanes) 10: while do 11: Select one active lane from 12: Broadcast from 13: if then recheck: may have dropped since the ballot 14: Lane 0 replaces the root of the shared-memory max-heap (ordered lexicographically by ) with and restores the heap 15: Lane 0 updates distance of the root of 16: Broadcast to all lanes 17: end if 18: Remove from 19: end while 20: end for 21: Write back to global memory
and maintains that point's top- heap in shared memory, using the distance of the current worst retained neighbor (the heap root) as a rejection threshold.
Reference points are processed in batches of 32, with each of the warp's 32 lanes evaluating one candidate in parallel. Each lane computes the squared Euclidean distance from the precomputed dot product and squared norms, clamping the result to be non-negative to guard against floating-point error. A lane is marked active if its candidate is a valid, sufficiently close neighbor—that is, and —and a warp-wide ballot produces a 32-bit mask identifying the set of active lanes. If the mask is empty, which is the common case once the heap holds good neighbors, the warp skips the heap entirely and proceeds to the next batch.
Because concurrent lanes cannot safely update a shared heap simultaneously, active candidates are then inserted serially: one active lane at a time is extracted from the ballot mask with __ffs, and its distance and index are broadcast to the warp via warp-shuffle instructions. Because an earlier insertion in the same batch may have lowered , lane 0 first rechecks the candidate against the current and discards it if it no longer qualifies; otherwise it performs the heap insertion and recomputes , which is broadcast back to all lanes before the next candidate is processed. This continues until all active candidates in the batch have been consumed, after which the warp proceeds to the next batch of 32 reference points. Once all candidates in the tile have been evaluated, the updated heap is written back to global memory.
The key GPU optimization is thus the combination of warp-cooperative execution with ballot-filtered candidate insertion. Warp-level ballot and shuffle operations replace slow thread-synchronization primitives, distance computation and threshold filtering exploit full warp-wide parallelism, and the sequential heap update is confined to a single lane and performed only for candidates that can actually change the top- set—every other candidate is rejected by a single parallel comparison.
The core data structure is a max-heap over distances, with the root storing the worst neighbor retained so far. Top- selection repeatedly asks one question: is this new candidate closer than the worst neighbor currently retained? With the worst neighbor at the root, this comparison is ; only a candidate that improves the top- list replaces the root and restores the heap—implemented as a hole-based sift-down that shifts entries down without pairwise swapping—at a cost of . Therefore, processing all candidates for one point costs approximately
(1) where is the number of candidates that actually enter the heap. Usually , especially once the heap has been filled with good neighbors.
Keeping the heap in shared memory for the duration of a tile avoids repeated global-memory accesses during heap updates. Once all tiles have been processed, the retained neighbors for each point are sorted with an insertion sort for small or a GPU radix sort for larger . Since is small in FastDEC relative to , sorting these elements incurs negligible cost. A final kernel then converts the retained squared distances to Euclidean distances by taking their square roots, yielding values suitable for downstream processing.
SymTri-kNN breaks distance ties deterministically in favor of the smaller point index. Because each point receives its candidates in increasing index order and the heap treats the larger index as worse on equal distances, the distance-only admission test (line 8 of Algorithm 8) already retains the lexicographically smallest (, index) pairs, and the final sort uses the same order. This makes the neighbor lists, and hence DC detection, reproducible. On MNIST, ties affected about 2% of rows at without changing any selected CDH point in the cases examined.
3.2 Density Estimation
Density estimation is integrated into the end-to-end SymWarp-FastDEC pipeline and operates directly on the self-k-NN distances produced by the GPU stage. Consistent with the original reference implementation, it uses the exponential kernel density estimator and procedure described in Section 2.4.1 (Algorithm 2).
The computational cost of density estimation is , which is negligible relative to the self-k-NN computation and the DC reduction stage. Consequently, density estimation is executed on the host without a dedicated GPU kernel, as GPU acceleration of this stage would have minimal impact on overall runtime.
3.3 Dominance Component Detection
Dominance Component detection is integrated into the end-to-end pipeline and uses the same procedure described in Section 2.4.2 (Algorithm 3). For each point, the ordered k-NN list is scanned to identify the first neighbor with strictly higher density; points for which no such neighbor exists are returned as DCs.
Like density estimation, this stage has computational complexity and is therefore inexpensive relative to the dominant self-k-NN and DC reduction stages. Consequently, it is executed on the host.
Retaining the complete k-column neighbor table produced during density estimation, rather than only the nearest higher-density match, enables the adaptive k-halving fallback (Section 2.4.2) to reuse subsets of the already-computed neighborhoods. Density estimation and Dominance Component detection can therefore be recomputed without requiring an additional self-k-NN invocation.
To verify that these host-side stages do not limit end-to-end performance, we also evaluated a fully GPU-resident variant that keeps the neighbor graph on the GPU and executes density estimation, DC detection, and cluster assignment there as well. At matched precision, it selected the same DC counts and ordered centers as the default pipeline in all tested configurations. However, in FP32 it saved only about 0.6s per fit on the 500k-point synthetic sweep (a speedup at 4096d) and gave at most on the million-point workloads; a substantial relative gain appeared only on sub-second fits such as mnist_70k_2d. Because self-k-NN dominates the runtime, we retain the simpler host-side implementation of these stages.
3.4 Dominance Component Reduction
DC reduction is the process that reduces the set of dominance components (DCs) to the final cluster centers. For each DC, this requires computing a dominance score, defined by three factors: the DC's normalized density, its distance to its CDH point, and its global rank—the number of reference points closer to the DC than its CDH. Once dominance scores are computed, DCs are sorted in descending order by score, and the top are selected as cluster centers.
Computing the dominance score is expensive: it requires the distance from each DC to every point in the reference dataset, sorted in ascending order so that the rank can be read off as the number of points closer than the CDH. The original CPU-based FastDEC obtains these distances by reusing the spatial index graph already built during density estimation, performing an -nearest-neighbor search for each DC, where is the size of the reference dataset. This coupling is efficient on CPU, where the index can be built once and cached in memory for reuse across the DC reduction step. It is impractical on GPU for several reasons. First, GPUs are inefficient at constructing complex index structures such as -d trees and at sorting large arrays of distances. Second, most GPU-based -NN libraries do not support queries for as many neighbors as requires; FAISS, for example, caps at 2048, far below for datasets of practical size. Third, GPU memory is a scarce resource, and an index graph large enough to support this search would consume memory better spent on computation, degrading parallel performance. Finally, coupling DC reduction to the density-estimation index limits FastDEC's flexibility, restricting which -NN algorithms and hardware configurations it can exploit.
To address these limitations, we propose a fast and efficient DC reduction algorithm that decouples dominance-score computation from density estimation and eliminates the need for any pre-built index or large-scale distance sorting. This decoupling allows DC reduction to instead rely on a -NN algorithm purpose-built for GPU execution, improving computational efficiency and scalability on large datasets while allowing FastDEC to benefit directly from future advances in GPU-based -NN methods. Our experimental results demonstrate that the proposed DC reduction algorithm performs consistently well across all datasets evaluated, accounting for less than 1% of the total runtime on 11 of the 15 datasets evaluated and for at most 7.36% on any of them. The algorithm effectively eliminates DC reduction as a computational bottleneck.
3.4.1 Warp-Parallel DC Reduction (WP-DC)
We propose WP-DC (Warp-Parallel DC Reduction), a GPU algorithm that casts distance evaluation between DC points and the reference dataset as a single tiled SGEMM operation and performs CDH selection (Stage A) and rank counting (Stage B) using warp-level reductions. A fast path fuses the two reduction stages when the dataset fits within a single slab. The implementation further employs a memory-adaptive slab planner and streamed double-buffered (ping-pong) execution to improve GPU utilization across varying dataset sizes.
Algorithm 9 summarizes the proposed DC reduction algorithm on the GPU. The expensive DC-to-dataset dot products are evaluated by SGEMM, while the two remaining operations are expressed as warp-level reductions. Stage A (Algorithm 10) selects the closest higher-density point for each DC, and Stage B (Algorithm 11) counts the number of points lying strictly inside the corresponding CDH radius.
WP-DC computes the inter-dominance quantities used to rank DC points and identify the final cluster centers. For each DC point, it determines (i) its CDH point, searched over the entire dataset rather than only its nearest neighbors, (ii) the corresponding distance, and (iii) a global rank defined as the number of data points closer than the CDH distance. To improve computational efficiency, WP-DC reformulates the dominant distance computation from explicit pairwise loops as matrix multiplications and employs fused GPU reductions to efficiently extract the CDH information and global ranks. Given a dataset with densities and a set of DC points with densities , the algorithm computes, for each DC , three quantities: the index of its CDH point, the corresponding CDH distance , and
Algorithm 9 Warp-Parallel DC Reduction (high-level workflow)
Require: Dataset with densities ; DCs with densities
Ensure: CDH distance , CDH index , and rank for every DC
1:
2:
3: , ,
4: iff one full dataset block fits in the GEMM buffer
5: for each DC tile of size (streamed/pipelined) do
6: if then
7: \quad single SGEMM,
8: STAGEA-REDUCE()() update and
9: STAGEB-REDUCE()() \quad reuse the same ; atomic accumulation into
10: else
11: for each dataset block of size do
12: \quad SGEMM tile
13: STAGEA-REDUCE()() merge across blocks via atomic packed min
14: end for
15: for each dataset block of size do
16: \quad SGEMM tile, recomputed
17: STAGEB-REDUCE()() \quad atomic accumulation into
18: end for
19: end if
20: end for
21: for to do
22: if then
23: ,
24: else
25:
26: if then
27:
28: end if
29: end if
30: end for
31: return
the rank . The CDH point is defined as
(2) and the rank is the number of dataset points closer to than its CDH point:
In exact arithmetic, and whenever , equals the CDH's zero-based position in the reference implementation's full sorted neighbor list, since the DC itself lies strictly inside the CDH radius at distance zero and is counted. The two can differ only under distance ties: the reference's positional rank may then depend on how its search index orders equidistant points, whereas counts only points strictly inside the CDH radius and is independent of that ordering. If no higher-density point exists for , the algorithm assigns sentinel values to indicate that has no valid CDH.
As in SymTri-kNN (Section 3.1), explicit coordinate-wise distance computation is replaced with dense matrix multiplication: for a DC tile and a dataset slab , a single SGEMM call computes the dot-product matrix , which combines with precomputed squared norms and to reconstruct squared distances as , where . The norm vectors and are computed once and reused in both reduction stages.
The computation is organized over DC tiles and dataset slabs. A DC tile contains at most T DC points, and each dataset slab contains at most B data points. For each tile-slab pair, SGEMM produces the corresponding dot-product matrix, which is consumed by two warp-parallel reducers. The algorithm uses a warp-per-DC mapping: each GPU warp is responsible for one DC point in the current tile, while the lanes of the warp partition the dataset slab.
The first reducer, Stage A, described in Algorithm 10, identifies the closest higher-density point for each DC point. Each lane scans a strided subset of the slab and considers only points satisfying . For all admissible points, the lane reconstructs and keeps its best candidate pair in registers. The lane-local
Algorithm 10 STAGEA-REDUCER: Fused Warp-Parallel CDH Selection
Require: Dot-product tile ; norms ; densities
Ensure: Per-DC best squared distance and index for this tile
1: for each DC in parallel (one warp per DC) do 2: 3: for each point processed by this lane do 4: if then must be strictly denser than 5: 6: if or then 7: 8: end if 9: end if 10: end for 11: 12: if then 13: ATOMICPACKEDMIN() lock-free 64-bit atomicMin on packed () 14: end if 15: end for
candidates are then reduced within the warp using shuffle instructions. The comparison is lexicographic:
Thus, the smallest distance is selected, with deterministic tie-breaking by the smaller dataset index.
The Stage A warp reduction is lock-free within the warp. Candidate distances and indices are kept in registers, and warp shuffle primitives exchange these register values directly between lanes. No shared-memory reduction, block-level barrier, or fine-grained atomic operation is required during the scan. After the warp-level reduction, lane 0 holds the best candidate for that DC point over the current slab.
To merge slab-level winners into the persistent CDH state, the algorithm packs each candidate pair into a 64-bit word:
Because all squared distances are non-negative FP32 values, their unsigned IEEE-754 bit patterns preserve numeric ordering. Consequently, an unsigned atomic minimum on implements an ordered minimum over . This reduces global synchronization to one compact atomic update per warp-level winner rather than one atomic update per candidate point.
Algorithm 11 STAGEB-REDUCER: Fused Warp-Parallel Rank Counting
Require: Dot-product tile ; norms ; CDH squared distance per DC
Ensure: Partial rank count for each DC in this tile
1: for each DC in parallel (one warp per DC) do 2: if then 3: continue 4: end if 5: 6: for each point processed by this lane do 7: 8: if then 9: 10: end if 11: end for 12: 13: if then 14: ATOMICADD() 15: end if 16: end for
After Stage A, the packed CDH state of each DC point is decoded into the squared CDH distance
(6) and the CDH index . The second reducer, Stage B, illustrated in Algorithm 11, then computes the rank associated with each DC point. Using the same distance reconstruction, each lane counts its assigned points satisfying . The lane-local counts are summed within the warp using shuffle reduction. Only the resulting warp-level count is added to the global rank accumulator:
where
As in Stage A, the hot loop uses only register-local updates and warp-level shuffle communication. The only global synchronization is one atomic addition per DC point and slab.
When the dataset slab can cover the full dataset in memory, the algorithm uses a fused single-slab execution. In this case, the SGEMM result for a DC tile is consumed first by Stage A and then immediately by Stage B. This avoids recomputing the dot-product matrix for rank counting. Otherwise, the algorithm uses a two-pass tiled execution: Stage A first scans all dataset slabs to find the CDH state of every DC point, and Stage B then scans the slabs again to compute ranks from the selected CDH distances.
Finally, the squared CDH distances are converted to Euclidean distances, i.e., . If a DC point has no valid CDH, the output values are set to sentinels. If the rank count is zero, the rank is also assigned a sentinel value. The final outputs of the reduction are therefore
(9) which are subsequently used by FastDEC to score and select the final cluster centers. Final square-root conversion and sentinel handling are fused in one kernel pass (fused finalize kernel).
Before entering the significance-score computation described in Section 2.4.3, sentinels (, ) are replaced with the maximum and values observed across all DCs, consistent with the original CPU FastDEC convention for globally dominant DCs (those with no valid CDH). WP-DC also assigns the rank sentinel when the rank count is zero. Since the DC itself is counted whenever , this occurs only when a higher-density point coincides with the DC (), a degenerate case that requires exact duplicate points with different densities. Such a DC receives the same maximum-rank fill value as a globally dominant DC.
The runtime advantage of this design comes from three sources. First, the dominant arithmetic is expressed as SGEMM, enabling highly optimized GPU matrix-multiplication kernels. Second, both CDH selection and rank counting are performed by warp-level register reductions, avoiding shared-memory reductions and block-wide synchronization in the inner loops. Third, global atomic operations are applied only after each warp has reduced a whole slab of candidates or counts, greatly reducing contention relative to a point-wise atomic design.
3.4.2 Planner and scheduler
WP-DC uses a memory-adaptive planner to choose between tiled two-pass execution and a fused single-slab execution. For a DC tile of size and a dataset slab of size , the SGEMM output requires bytes. The planner estimates the available memory after fixed allocations and a 1024 MiB reserve, applies a 0.85 safety factor, divides the budget across two ping-pong buffers, and caps the per-buffer budget at 2560 MiB. It then computes the largest full-dataset DC tile,
If is at least the minimum tile size, the planner sets and enables the fused path, allowing Stage B to reuse the Stage-A SGEMM output and eliminate an additional matrix multiplication. Otherwise, WP-DC uses dataset slabs of size 32768 and performs separate Stage-A and Stage-B passes. The planner therefore reduces redundant SGEMM work whenever sufficient memory is available while retaining a bounded-memory execution mode for large datasets.
In addition to the default single-stream mode, DC reduction can optionally be scheduled across two CUDA streams. The scheduler distributes tile-slab work between the streams using two ping-pong buffers for dot-product output. When stream interleaving is enabled, consecutive work units are assigned alternately to the two streams. Operations that depend on the same buffer are kept within the same stream; for example,
In the fused path, CUDA stream ordering guarantees that the reducer kernels consume a buffer only after SGEMM has produced it, and that Stage B executes only after the CDH distance has been decoded. In the two-pass path, Stage A and Stage B are separated by a stream synchronization because rank counting requires the final CDH distance. Atomic minimum updates in Stage A and atomic additions in Stage B make partial results from different slabs safe under stream interleaving. The two buffers prevent a subsequent SGEMM from overwriting data that a reducer is still consuming.
The goal is to expose overlap between SGEMM and reduction kernels while preserving the dependency ordering required by each tile/slab pipeline. The primary benefit is the potential to overlap parts of SGEMM with the reducer for slab k, thereby reducing idle gaps between SGEMM and custom kernels. Potential benefits include:
-
Better GPU utilization. SGEMM is compute-intensive, whereas the reducer kernels are lighter and primarily memory-bound. Interleaving can exploit these complementary resource profiles.
-
Reduced serialization and pipelined execution. Independent tile/slab units need not wait behind a single stream queue, allowing one stream to consume dot_buf [0] while the other produces into dot_buf [1].
-
Safe cross-slab accumulation. Stage A uses atomicMin and Stage B uses atomicAdd, allowing concurrent updates from multiple streams.
The tradeoff is that ping-pong scheduling is not always faster. If SGEMM already saturates the GPU, there may be little opportunity for overlap. WP-DC therefore treats stream interleaving as a configurable policy: single-stream scheduling is simpler and more reproducible, while ping-pong scheduling aims for higher throughput when useful overlap exists.
3.4.3 Warp-level reduction vs block-wide shared-memory reduction
In the proposed DC reduction, we employ warp-level reduction rather than block-wide shared-memory reduction to match the native execution granularity of the GPU. Each warp (32 lanes) is assigned to one DC, and lanes process candidate data points in a stride-32 pattern, yielding fully regular SIMT execution. Partial minima (Stage A) and partial counts (Stage B) are merged via warp shuffle instructions in a logarithmic tree, so inter-thread exchange occurs in registers without block-wide barriers. In contrast, block-level reduction typically requires repeated shared-memory read/write phases and global synchronization via thread-block barriers, which introduces stall time and under-utilization as the active thread set shrinks across reduction levels. Consequently, warp-level reduction reduces synchronization cost, lowers shared-memory pressure, and minimizes reduction latency in the hot path.
This design also improves scalability under tiled/slabbed processing. Let B denote threads per block and W the warp width; moving from thread-wise global updates to warp-aggregated updates reduces global atomic traffic approximately from O(B) to O(B/W) per reduction event, while preserving correctness through packed argmin and atomic accumulation. Because each warp independently resolves one DC reduction, scheduler mapping is straightforward and occupancy remains robust as the number of DCs grows, provided slab sizes keep per-warp work sufficiently large. Overall, the warp-centric formulation is expected to yield higher throughput than block-wide reductions for this workload by co-optimizing synchronization, memory movement, and hardware-aligned parallel decomposition. We therefore use the warp-parallel reduction throughout this work.
3.5 Cluster Assignment
Algorithm 12 follows the label-propagation procedure of Algorithm 5 (Section 2.5): the c centers receive distinct labels, and the remaining points, in descending density order, inherit the label of their CDH point. The only addition is a guard (line 9) for a point that has no higher-density point anywhere in the dataset but was not selected as a center. This can occur only when more than c points tie exactly at the global maximum density; such a point is then assigned to the cluster of a selected center of the same density. The case did not arise in any experiment reported in this paper.
Algorithm 12 Final Cluster Assignment
Require: : density array, : closest density-higher links, : indices of the centers
Ensure: : cluster assignment for all points
1: 2: 3: for all do 4: 5: 6: end for
7: for all points in descending order of do 8: if then 9: if then 10: 11: else 12: 13: end if 14: end if 15: end for
4 Experimental Results
This section describes the experimental setup, including the system configuration, datasets, and algorithms employed in the evaluation. It subsequently presents the experimental results and analyzes the performance of the proposed algorithm.
4.1 Experimental Configuration
The computing environment used to execute and test our algorithm is equipped with an AMD EPYC 7543 32-Core CPU (base clock 2.8 GHz), 256GB of RAM and a NVIDIA RTX A6000 GPU, featuring 10,752 CUDA cores, delivering up to 38.7 TFLOPS of single-precision (FP32) performance, with 48 GB of GDDR6 ECC memory and 768 GB/s of memory bandwidth. The operating system is Rocky Linux 9.7 (Blue Onyx) with the CUDA Toolkit 13.2.2 GPU computing platform installed. All
GPU computations in all implementations, including every cuBLAS SGEMM call, use strict FP32 arithmetic; TF32 tensor-core math is disabled.
All reported runtimes are measured as wall-clock time for the FastDEC pipeline, including host-to-device transfers and all computation from k-NN construction through cluster assignment, but excluding the one-time cost of loading the dataset from disk into host memory. For each configuration, we perform four runs, discard the first as a warm-up iteration to exclude one-time CUDA context initialization and JIT compilation overheads, and report the mean of the remaining three runs. Across the more than 400 measured implementation–configuration combinations, the coefficient of variation (CV) of the three timed runs was at most 2.35%, below 1.5% in 95.7% of cases, and 0.28% at the median. This run-to-run variability is far smaller than the narrowest speedup of SymWarp-FastDEC over any baseline reported in this paper (1.70×).
All implementations are compiled for compute capability 8.6 (sm_86). The faissgpu baseline links against FAISS 1.12.0, built from source with its classic GPU kernels (cuVS disabled) using nvcc 13.0 and GCC 11, with Intel MKL 2023.2 as the CPU BLAS backend. DC reduction uses the default single-stream schedule (the optional stream interleaving described in Section 3.4.1 is disabled), and host-side stages run on a single CPU thread. Every timed stage returns control to the host only after its GPU work has completed, so the host wall-clock timers capture all GPU execution without additional synchronization.
4.2 Datasets
In our experiments, we evaluate the proposed approach using five different types of datasets.
4.2.1 Image Patch Datasets
The image patch datasets are composed of small grayscale image patches, which are collected from unlabelled imagery by cropping out random -by- chunks. Each -by- pixel grayscale patch is represented as a vector of pixel intensities (i.e., ). The method described in the paper (Coates and Ng 2012) is used to normalize the brightness and contrast of the patches: for each , we subtract out the mean of the intensities and divide by the standard deviation. A small value is added to the variance before division to avoid dividing by zero and also suppress noise. The images used to create the image patches datasets are animal photographs drawn from the Open Images Dataset (Kuznetsova et al. 2020), a large-scale, publicly available collection of web images released by Google.
4.2.2 WikiGiga GloVe Datasets
The GloVe datasets (glove.2024.wikigiga) are downloaded from the Global Vectors for Word Representation (GloVe) project (Pennington et al. 2014) established by the Natural Language Processing Group at Stanford University. GloVe is an unsupervised learning algorithm that produces vector representations of words by leveraging aggregated global word-word co-occurrence statistics from a corpus. The resulting representations exhibit meaningful linear substructures within the word vector space. The datasets used in our experiments contain pre-trained word vectors derived from the 2024 Wikipedia and Gigaword 5 datasets, comprising 11.9 billion tokens and a 1.2 million uncased vocabulary (Carlson et al. 2025). These vectors are available in dimensionalities of 50, 100, 200, and 300. We use all four to evaluate how runtime scales with dimensionality at a fixed dataset size, and the dimensionality used in each of the remaining experiments is stated with its results.
4.2.3 MNIST Datasets
The MNIST dataset is a standard benchmark consisting of 70,000 grayscale images of handwritten digits (0–9), including 60,000 training images and 10,000 testing images LeCun et al. (1998). In our experiments, the training and testing sets were combined into a single dataset of 70,000 images. The MNIST8M dataset is a large-scale extension of MNIST generated using the InfiMNIST data augmentation procedure Loosli et al. (2007) and contains approximately 8.1 million handwritten digit images. In both datasets, each image has a resolution of pixels and is represented as a 784-dimensional feature vector belonging to one of 10 digit classes. MNIST8M is widely used for benchmarking the performance and scalability of large-scale classification and nearest neighbor search algorithms Loosli et al. (2007) due to its size and high dimensionality.
4.2.4 Deep1B Datasets
The Deep1B dataset is a widely used benchmark for evaluating billion-scale nearest neighbor search algorithms in machine learning and database systems Babenko and Lempitsky (2016). It consists of one billion 96-dimensional image embedding vectors extracted from the ImageNet dataset using a pre-trained GoogLeNet model. The datasets used in our experiments are subsets sampled from the Deep1B dataset.
4.2.5 Synthetic Datasets
The synthetic datasets are created by using a random data generator producing a uniform data distribution, so that no natural clustering structure exists. This avoids favoring methods that exploit clustered data.
4.3 Algorithms Used
FastDEC provides a framework for density peak clustering in which different k-NN search algorithms can be employed at the density estimation step. Our GPU-based implementation retains this flexibility by design. We evaluate the performance of several exact k-NN algorithms from well-known open-source libraries against our GPU-accelerated self-k-NN algorithm, which is specifically optimized and tailored to the requirements of FastDEC.
We compare the following variants of FastDEC:
-
FastDEC-pycpu (pycpu): the original CPU-based FastDEC implementation in Python (Yang et al. 2022).
-
FastDEC-faissgpu (faissgpu): uses the GpuIndexFlatL2 index of the GPU-based FAISS library for density estimation.
-
FastDEC-knncuda (knncuda): uses an adapted version of the open-source KnnCuda library for density estimation.
-
SymWarp-FastDEC (symwarp): the algorithm proposed in this paper, which incorporates optimizations specifically designed to accelerate FastDEC on modern GPUs.
Because pycpu is a single-threaded, unoptimized Python/k-d-tree reference, the large speedups reported against it mainly reflect the cost of that baseline rather than the efficiency of SymWarp-FastDEC itself. We report them to establish that the GPU pipeline is a practical drop-in replacement (same interface and parameters) for the original implementation. The comparisons against the GPU baselines, faissgpu and knncuda, which are described below, are the more informative measure of the proposed method's efficiency.
FAISS (Facebook AI Similarity Search) is an open-source library for large-scale similarity search and clustering of dense vectors, supporting both exact and approximate nearest-neighbor search on CPUs and GPUs (Meta AI Research 2024; Johnson et al.
2019). Designed to support similarity search at billion-vector scales, FAISS provides highly optimized GPU implementations that have demonstrated substantial performance improvements through efficient distance computation and k-selection (Johnson et al. 2019). We use its GpuIndexFlatL2 index, which performs exhaustive GPU-accelerated search using squared Euclidean distance, as the exact k-NN backend for FastDEC's density estimation stage. To adapt FAISS to FastDEC's self-k-NN workload, we retrieve neighbors per point, discard the trivial self-match by index (so that exact duplicates remain eligible), and retain the k nearest remaining points. Since FAISS's METRIC_L2 returns squared Euclidean distances, we apply the square root before writing the results to the transposed output buffers consumed by the rest of FastDEC. FAISS therefore serves as an established, highly optimized GPU baseline against which we evaluate our proposed self-k-NN algorithm for accelerating FastDEC on large-scale datasets.
FastDEC-knncuda uses an adapted version of KnnCuda (Garcia et al. 2008, 2010), an open-source library for exact GPU-based k-NN search, in the density estimation stage. KnnCuda identifies the k nearest neighbors in two steps: it first computes all pairwise distances between the query and reference points and stores them in a distance matrix in GPU global memory; it then applies a modified insertion sort to each column of the matrix to extract the k nearest neighbors of each query point. We chose KnnCuda for its conceptual simplicity and exact k-NN search. However, its quadratic memory requirement limits its scalability to large datasets. The distance matrix has dimensions , which, for FastDEC's self-query workload ( ), requires memory. For example, at , the matrix alone would occupy 4 TB in single precision, far exceeding the memory capacity of any current GPU. Furthermore, KnnCuda does not explicitly handle self-matches: when the reference and query sets are identical, each point is its own nearest neighbor at distance zero, and this match must be excluded from its own k-NN list.
To overcome these limitations, we retain KnnCuda's shared-memory-tiled distance computation kernel and integrate it into a memory-adaptive, batched pipeline for large-scale self-query k-NN search. The pipeline performs top- selection within each batch and then merges the intermediate results using a linear-time merge step. The modifications are as follows:
- Native self-query handling
Rather than duplicating the dataset into separate reference and query buffers, the reference set is used as both reference and query after a single host-to-device transfer. The distance-selection kernel is further enhanced with index-based self-exclusion, so a point cannot be selected as its own nearest neighbor while exact duplicates remain eligible.
- Memory-adaptive batched distance computation
The tiled shared-memory distance kernel is preserved unmodified in its per-tile computation, but it is never invoked against the full matrix. Instead, the reference set is partitioned into batches of points, and only a single distance tile is materialized in device memory at any time:
-
Adaptive batch sizing. Before processing, the implementation derives the largest batch size that fits in the available device memory, aiming to maximize the data processed in each batch. This makes batch size a function of the actual GPU's available memory at runtime, rather than a fixed constant.
-
Per-batch pipeline. For each batch of reference points: (i) the tiled shared-memory kernel computes a squared-distance tile against all query points; (ii) the modified insertion-sort kernel (point 3 below) reduces each column to its smallest entries within the batch; (iii) a linear-merge kernel (point 4 below) folds the batch's top- list into the running, globally accumulated top- list per query point, offsetting batch-relative indices to global reference indices.
This reduces device memory for the distance structure from to , where B is bounded only by available free memory, allowing the same kernel to remain memory-feasible for larger N by shrinking B; this resolves the memory bottleneck but does not change the underlying time complexity of the distance computation.
3. Top-k selection within a batch
The top- candidates of each batch are selected with KnnCuda's original modified insertion sort, extended only with the self-match exclusion described in point 1. For each query column, one thread scans the batch's candidates in reference-index order and maintains a sorted list of the smallest distances seen so far. A candidate that is not smaller than the current -th entry is rejected with a single comparison; otherwise, larger entries are shifted down and the candidate is written into its sorted position. The scan requires threshold tests, plus up to additional comparisons and shifts per accepted candidate, giving work per query column in the worst case. Because the sorted list resides in global memory and each accepted candidate may shift up to entries, the selection cost grows with . We deliberately retain this original selection kernel rather than replacing it with an asymptotically faster alternative such as heap-based selection, so that FastDEC-knncuda remains faithful to the published KnnCuda algorithm and its modifications are confined to what is needed to scale it to large self-query workloads. FastDEC-faissgpu, which builds on the highly optimized FAISS library, serves as the complementary state-of-the-art GPU baseline.
4. Linear merge of accumulated and batch results
After each batch's top- candidates are selected, they must be merged with the top- list accumulated from all previously processed batches. Since both the batch result and the running accumulated result are already sorted in ascending order per query column, the merge is performed as a single linear merge of two sorted lists (analogous to the merge step of merge-sort) rather than by re-inserting each batch candidate one at a time — the latter would cost up to per query column in the worst case. The merge writes its output into a separate pair of buffers, and these buffers are then pointer-swapped (“ping-ponged”) with the accumulated-result buffers before the next batch, avoiding a copy step.
After applying these optimizations, FastDEC-knncuda preserves KnnCuda's original tiled distance kernel (widening only its index arithmetic to 64 bits for large tiles), while removing its memory ceiling through adaptive batching combined with an efficient batch-accumulation pipeline (per-batch insertion-sort selection paired with linear merging), and further incorporates the self-match exclusion required for a correct self-query k-NN.
The results presented in this paper were obtained by running the FastDEC-pycpu, FastDEC-knncuda, FastDEC-faissgpu, and SymWarp-FastDEC implementations on datasets of varying sizes and dimensionalities. FastDEC-pycpu, the original implementation, was evaluated only on relatively small datasets, as its runtime becomes prohibitive on medium and large datasets.
4.4 Performance Evaluation
We now present the empirical results obtained using the aforementioned algorithms across four real-world domains and one synthetic domain, comparing them against relevant baselines. Performance is evaluated using several metrics, including execution time, speedup, and scalability (with respect to size and dimensionality).
We first present the results of our DC Reduction acceleration algorithm on different datasets. Next, we compare our algorithm against the FastDEC variants described above - implemented using the FAISS and KnnCuda libraries - in terms of execution time across various real-world and synthetic datasets. Finally, we examine the impact of different values of k and c on these FastDEC variants. To ensure a fair comparison,
Table 1: Runtime of SymWarp-FastDEC and time spent in Dominance Component (DC) reduction across large-scale datasets (all with at least 1M instances), ordered by number of points. DC reduction (%) denotes the proportion of total runtime consumed by the DC reduction step.
| Dataset | syn_1m_1536d | glove_1.2m_300d | deep_2m_96d | mnist_2m_784d | syn_2m_1536d | deep_5m_96d | mnist_8m_784d | syn_10m_64d | syn_10m_512d |
|---|---|---|---|---|---|---|---|---|---|
| Runtime (s) | 66.66 | 30.82 | 41.57 | 128.79 | 240.78 | 236.77 | 2121.55 | 814.36 | 2278.88 |
| DC reduction (s) | 0.11 | 0.04 | 0.20 | 3.18 | 0.31 | 0.66 | 156.14 | 1.55 | 2.84 |
| DC reduction (%) | 0.17 | 0.13 | 0.48 | 2.47 | 0.13 | 0.28 | 7.36 | 0.19 | 0.12 |
all data used were generated under the same experimental configuration; that is, all algorithms within a given experiment use identical values of k and c, the same DC reduction algorithm, and the same L2 (Euclidean) distance metric.
4.4.1 Effectiveness of DC Reduction
Results are presented in this section to evaluate the effectiveness and efficiency of the proposed Dominance Component (DC) reduction algorithm (i.e., DC inter-dominance estimation). Table 1 reports the runtime of the DC reduction step and its proportion of the total runtime for the SymWarp-FastDEC implementation—shown in later experiments to be the fastest variant—across nine large-scale datasets exceeding one million instances. Table 2 reports the corresponding results on six smaller datasets spanning a broad range of dimensionalities, from 64 to 16,384, allowing the algorithm’s sensitivity to dimensionality to be assessed independently of dataset size. Across both tables, the DC reduction step consistently accounts for only a small fraction of the total runtime, ranging from 0.12% to 7.36% on the large-scale datasets and from 0.23% to 1.68% on the smaller, higher-dimensional datasets. The two large MNIST-derived datasets exhibit the highest shares, 2.47% on mnist_2m_784d and 7.36% on mnist_8m_784d, the largest overhead among all tested datasets; even in this case, however, the DC reduction step remains a minor component of the overall runtime.
Figures 2 and 3 visualize these results for the large-scale and smaller datasets, respectively, plotting the DC reduction share (line, left axis) alongside the total runtime (bar, right axis, log scale) for each dataset. In both figures, the DC reduction share stays close to the bottom of the axis even as the runtime bars span roughly

Fig. 2: DC reduction time as a fraction of the total SymWarp-FastDEC runtime on large-scale datasets, each containing more than one million instances. The line (left axis) shows the percentage of total runtime spent on DC reduction, while the bars (right axis, logarithmic scale) show the corresponding total runtimes.

Fig. 3: DC reduction time as a fraction of the total SymWarp-FastDEC runtime on datasets with fewer instances and spanning a wide range of dimensionalities (64–16,384). The line (left axis) shows the percentage of total runtime spent on DC reduction, while the bars (right axis, logarithmic scale) show the corresponding total runtimes.
Table 2: Runtime of SymWarp-FastDEC and time spent in Dominance Component (DC) reduction across smaller datasets of varying dimensionality, ordered by number of points and then by dimensionality. DC reduction (%) denotes the proportion of total runtime consumed by the DC reduction step.
| Dataset | syn_50k_16384d | img_200k_32x32 | syn_500k_64d | deep_500k_96d | mnist_500k_784d | syn_500k_4096d |
|---|---|---|---|---|---|---|
| Runtime (s) | 2.38 | 2.37 | 2.95 | 3.66 | 9.42 | 42.75 |
| DC reduction (s) | 0.04 | 0.02 | 0.01 | 0.02 | 0.10 | 0.10 |
| DC reduction (%) | 1.68 | 0.84 | 0.34 | 0.55 | 1.06 | 0.23 |
three orders of magnitude across the two figures (2.37 s to 2,278.88 s), visually reinforcing that DC reduction is not a runtime bottleneck regardless of dataset size or dimensionality.
To further demonstrate the effectiveness of the proposed GPU-accelerated DC reduction algorithm, WP-DC (labelled wp-dc in the table and figure), Table 3 compares its runtime proportion against that of the original CPU-based DC reduction (py-dc) across six datasets spanning both low (2–8) and high (512–784) dimensionality. For each dataset, the proportion of total runtime consumed by DC reduction is reported for the corresponding FastDEC implementation — SymWarp-FastDEC (GPU-accelerated) and FastDEC-pycpu (CPU-based).
The results show that WP-DC consistently accounts for a small share of the total SymWarp-FastDEC runtime, ranging from 1.90% to 6.25%, regardless of dimensionality. These shares are somewhat higher than on the larger datasets above because SymWarp-FastDEC completes each of these datasets in only 0.12–0.33 s, so that even a WP-DC time of 3–10 ms registers as a few percent; in absolute terms, WP-DC is roughly three orders of magnitude faster than py-dc on every dataset (e.g., 0.010 s versus 14.84 s on mnist_70k_2d). In contrast, py-dc constitutes a substantially larger share of the FastDEC-pycpu runtime on low-dimensional datasets, reaching as high as 95.68% on mnist_70k_2d, indicating that DC reduction is the dominant computational bottleneck in the CPU-based implementation at low dimensionality. On the two high-dimensional datasets (syn_50k_512d and mnist_70k_784d), this proportion drops sharply to 0.11% and 0.29%, respectively; however, this decrease reflects a shift in bottleneck rather than an improvement in DC reduction efficiency, consistent with the earlier observation that the exact, k-d-tree-based density estimation step becomes prohibitively expensive beyond roughly 10–20 dimensions, causing the total pycpu runtime (2,098 and 5,125 seconds, respectively) to be dominated by density estimation rather than DC reduction. Taken together, these results confirm that the proposed WP-DC algorithm effectively eliminates DC reduction as a runtime bottleneck across all tested dimensionalities, whereas the original CPU-based approach remains bottlenecked by DC reduction whenever density estimation itself remains tractable. Figure 4 visualizes these results, plotting each implementation's DC reduction share (lines, left axis) alongside its total runtime (bars, right axis, log scale). The figure makes the contrast concrete: wp-dc's share stays low (at most 6.25%) regardless of dimensionality, while py-dc's share is high precisely on the four low-dimensional datasets where pycpu's total runtime is small, and collapses only on the two high-dimensional datasets where the total runtime instead balloons by orders of magnitude.
Table 3: Contribution of Dominance Component (DC) reduction to total runtime in the GPU-accelerated (wp-dc, within SymWarp-FastDEC) and CPU-based (py-dc, within FastDEC-pycpu) implementations. Runtime and the proportion of total runtime consumed by DC reduction are reported, with datasets ordered by number of points and then by dimensionality.
| Dataset | syn.50k_2d | syn.50k_4d | syn.50k_8d | syn.50k_512d | mnist.70k_2d | mnist.70k_784d |
|---|---|---|---|---|---|---|
| symwarp runtime (s) | 0.12 | 0.12 | 0.12 | 0.21 | 0.16 | 0.33 |
| wp-dc runtime (s) | 0.005 | 0.003 | 0.003 | 0.004 | 0.010 | 0.010 |
| wp-dc proportion (%) | 4.17 | 2.50 | 2.50 | 1.90 | 6.25 | 3.03 |
| pycpu runtime (s) | 7.69 | 6.67 | 9.10 | 2098.24 | 15.51 | 5125.48 |
| py-dc runtime (s) | 7.18 | 5.59 | 2.88 | 2.29 | 14.84 | 14.91 |
| py-dc proportion (%) | 93.37 | 83.81 | 31.65 | 0.11 | 95.68 | 0.29 |

Fig. 4: DC reduction overhead and total runtime for the GPU-accelerated implementation (wp-dc, in SymWarp-FastDEC) and the CPU-based implementation (py-dc, in FastDEC-pycpu) across six datasets with varying dimensionalities. The lines (left axis) show the percentage of total runtime spent on DC reduction, while the bars (right axis, logarithmic scale) show the corresponding total runtimes.
These results demonstrate that the proposed GPU-accelerated DC reduction algorithm performs consistently and efficiently across datasets of varying size and dimensionality. Accordingly, the same DC reduction algorithm is adopted across all GPU-accelerated FastDEC implementations in the experiments that follow, enabling a fair comparison of these variants with respect to density estimation performance.
Table 4: Runtime (, in seconds) comparison across MNIST subsets. Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime for each dataset is shown in bold.
| Algorithm | 70k_2d | 70k_784d | 100k_784d | 500k_784d | 1m_784d | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 0.51 | 1.00× | 4.50 | 1.00× | 8.87 | 1.00× | 220.66 | 1.00× | 889.33 | 1.00× |
| faissgpu | 0.37 | 1.38× | 1.05 | 4.29× | 1.66 | 5.34× | 25.67 | 8.60× | 96.38 | 9.23× |
| symwarp | 0.16 | 3.19× | 0.33 | 13.64× | 0.56 | 15.84× | 9.42 | 23.42× | 35.34 | 25.16× |
4.4.2 Evaluation on MNIST Subsets
We additionally evaluate five MNIST-derived datasets ranging from 70k to 1m instances: MNIST2D Ma et al. (2024), a UMAP-based 2-dimensional projection of the original MNIST dataset, and four native 784-dimensional datasets of increasing size. Table 4 and Figure 5 show that symwarp achieves the lowest runtime across all datasets. Relative to the knncuda baseline, its speedup increases monotonically from 3.19× on 70k_2d to 25.16× on 1m_784d, demonstrating increasingly favorable scaling behavior across the evaluated datasets. faissgpu is also faster than knncuda on every dataset, but by a smaller margin, from 1.38× on 70k_2d to 9.23× on 1m_784d. Relative to faissgpu, symwarp is 2.31–3.18× faster; at a fixed 70k instances, moving from 2d to 784d widens this margin from 2.31× to 3.18×, whereas on the two largest datasets it settles at 2.73×. These results suggest that the advantage of symwarp over knncuda grows with both dataset size and dimensionality, while its margin over faissgpu remains comparatively stable across the evaluated sizes.
4.4.3 Evaluation on GloVe Datasets
Across four GloVe dimensionalities at a fixed dataset size of approximately 1.2M vectors (Table 5, Figure 6), symwarp achieves the lowest runtime at every dimensionality, with its runtime increasing from 16.49 s to 30.82 s (1.9×) as dimensionality grows from 50d to 300d. Over the same range, the runtimes of knncuda and faissgpu increase slightly more, from 340.68 s to 702.07 s (2.1×) and from 35.76 s to 78.24 s (2.2×),

Fig. 5: Runtime comparison of knncuda, faissgpu, and symwarp on MNIST datasets of increasing size (c = 10, k = 25). Runtime is shown on a logarithmic scale.

Fig. 6: Runtime comparison of knncuda, faissgpu, and symwarp across GloVe datasets of increasing embedding dimensionality (c = 20, k = 45). Runtime is shown on a logarithmic scale.
Table 5: Runtime (, in seconds) comparison across GloVe datasets. Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime for each dataset is shown in bold.
| Algorithm | 50d | 100d | 200d | 300d | ||||
|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 340.68 | 1.00× | 405.68 | 1.00× | 539.57 | 1.00× | 702.07 | 1.00× |
| faissgpu | 35.76 | 9.53× | 40.63 | 9.98× | 58.59 | 9.21× | 78.24 | 8.97× |
| symwarp | 16.49 | 20.66× | 18.72 | 21.67× | 24.14 | 22.35× | 30.82 | 22.78× |
respectively. Consequently, symwarp's speedup over knncuda rises only slightly, from at 50d to at 300d, while its advantage over faissgpu increases from to . Within this comparatively narrow range of dimensionality, the effect of dimensionality on the relative performance of the three methods is therefore modest; the image-patch and synthetic experiments below examine much wider dimensionality ranges.
4.4.4 Evaluation on Deep1B Subsets
On the Deep1B subsets, which maintain a fixed dimensionality of 96 while varying in size from 200k to 2m instances (Table 6, Figure 7), symwarp consistently achieves the lowest runtime. As dataset size increases, the runtime of symwarp grows from 0.94s to 41.57s, compared with increases from 6.25s to 799.65s for knncuda and from 1.60s to 88.03s for faissgpu. Consequently, symwarp's speedup over knncuda increases
Table 6: Runtime (, in seconds) comparison across Deep1B subsets. Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime for each dataset is shown in bold.
| Algorithm | 200k_96d | 500k_96d | 1m_96d | 2m_96d | ||||
|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 6.25 | 1.00× | 33.94 | 1.00× | 151.31 | 1.00× | 799.65 | 1.00× |
| faissgpu | 1.60 | 3.91× | 6.87 | 4.94× | 23.98 | 6.31× | 88.03 | 9.08× |
| symwarp | 0.94 | 6.65× | 3.66 | 9.27× | 11.72 | 12.91× | 41.57 | 19.24× |

Fig. 7: Runtime comparison of knncuda, faissgpu, and symwarp on Deep1B subsets of increasing size (). Runtime is shown on a logarithmic scale.

Fig. 8: Runtime comparison of knncuda, faissgpu, and symwarp across image-patch datasets of increasing dimensionality (). Runtime is shown on a logarithmic scale.
from at 200k_96d to at 2m_96d, while its advantage over faissgpu grows steadily from to . These results provide further evidence that the scale-driven trend observed previously persists at fixed dimensionality, with the relative performance advantages of symwarp becoming increasingly pronounced as dataset size increases.
4.4.5 Evaluation on Image-Patch Datasets
On seven image-patch datasets with a fixed 200k instances but increasing patch size (and therefore dimensionality) from (64d) to (4096d) (Table 7, Figure 8), symwarp consistently achieves the lowest runtime. As dimensionality increases, its runtime grows from 0.71s to 7.02s (), compared with increases from 5.27s to 183.62s () for knncuda and from 1.62s to 26.29s () for faissgpu. Consequently,
Table 7: Runtime (, in seconds) comparison across image-patch datasets. Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime for each dataset is shown in bold.
| Algorithm | 8x8 | 8x16 | 16x16 | 16x32 | 32x32 | 32x64 | 64x64 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 5.27 | 1.00× | 7.99 | 1.00× | 13.50 | 1.00× | 24.73 | 1.00× | 47.35 | 1.00× | 92.74 | 1.00× | 183.62 | 1.00× |
| faissgpu | 1.62 | 3.25× | 1.84 | 4.34× | 2.54 | 5.31× | 3.92 | 6.31× | 6.58 | 7.20× | 13.45 | 6.90× | 26.29 | 6.98× |
| symwarp | 0.71 | 7.42× | 0.81 | 9.86× | 1.00 | 13.50× | 1.45 | 17.06× | 2.37 | 19.98× | 4.10 | 22.62× | 7.02 | 26.16× |
symwarp's speedup over knncuda increases from at 64d to at 4096d, while its advantage over faissgpu grows from to . These results demonstrate substantially more favorable scaling of symwarp with feature dimensionality at fixed dataset cardinality.
4.4.6 Evaluation on Synthetic Datasets
On seven synthetic datasets spanning 5K–5M points and 64–784 dimensions (Table 8, Figure 9), symwarp achieves the lowest runtime on every dataset. On the smallest dataset (syn_5k_64d), all three methods complete in well under a second (0.01s for symwarp, 0.20s for faissgpu, and 0.21s for knncuda); at this scale, runtimes are likely dominated by fixed overheads rather than by computation, so the resulting ratios ( over knncuda and over faissgpu) are not representative of relative computational efficiency and are excluded from the summary ranges reported in this paper. On the remaining datasets, symwarp's speedup over knncuda ranges from on syn_500k_64d to on the largest dataset evaluated, syn_5m_64d. Across the three 64-dimensional datasets, this speedup grows with dataset size (, , and at 500k, 1m, and 5m instances), suggesting that the advantage of symwarp over knncuda reflects favorable scaling behavior rather than merely a constant-factor improvement. The margin over faissgpu varies considerably less, from to . Across the three 64-dimensional datasets (500k–5m instances), it increases only slightly, from to , despite a tenfold increase in dataset size. In comparison, at a fixed 200k instances, increasing dimensionality from 512d to
Table 8: Runtime (, in seconds) comparison on synthetic datasets. Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime for each dataset is shown in bold.
| Algorithm | syn_5k_64d | syn_200k_512d | syn_200k_784d | syn_500k_64d | syn_500k_784d | syn_1m_64d | syn_5m_64d | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 0.21 | 25.37 | 37.38 | 32.92 | 232.48 | 157.51 | 8632.29 | |||||||
| faissgpu | 0.20 | 3.63 | 5.32 | 6.15 | 27.62 | 21.48 | 494.69 | |||||||
| symwarp | 0.01 | 1.44 | 1.90 | 2.95 | 9.96 | 9.86 | 209.29 | |||||||

Fig. 9: Runtime comparison of knncuda, faissgpu, and symwarp across synthetic datasets ranging from 5K to 5M instances and spanning multiple dimensionalities (). Runtime is shown on a logarithmic scale.

Fig. 10: Runtime comparison of knncuda, faissgpu, and symwarp across large datasets ranging from 1M to 10M instances and spanning multiple dimensionalities (MNIST: ; Deep1B: ; Synthetic: ). Runtime is reported on a logarithmic scale.
784d widens the margin from to , and at a fixed 500k instances, increasing dimensionality from 64d to 784d widens it from to . This pattern suggests that dimensionality has a somewhat stronger influence than instance count on symwarp's relative advantage over faissgpu, although the differences within the evaluated range are modest.
4.4.7 Performance on Large-Scale Datasets
We evaluate seven large-scale datasets (Table 9), including three derived from real-world data (deep_5m_96d, mnist_2m_784d, and mnist_8m_784d) and four synthetic datasets (syn_1m_1536d, syn_2m_1536d, syn_10m_64d, and syn_10m_512d). These datasets span 1M–10M instances, 64–1536 dimensions, and storage sizes from 1.92 GB to 25.09 GB.
Table 9: Dataset statistics and storage size.
| Dataset | Instances | Dimensions | Size (GB) |
|---|---|---|---|
| deep_5m_96d | 5m | 96 | 1.92 |
| syn_10m_64d | 10m | 64 | 2.56 |
| syn_1m_1536d | 1m | 1536 | 6.14 |
| mnist_2m_784d | 2m | 784 | 6.27 |
| syn_2m_1536d | 2m | 1536 | 12.29 |
| syn_10m_512d | 10m | 512 | 20.48 |
| mnist_8m_784d | 8m | 784 | 25.09 |
Table 10: Runtime (, in seconds) comparison on large-scale datasets. Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime for each dataset is shown in bold.
| Algorithm | deep_5m_96d | syn_10m_64d | syn_1m_1536d | mnist_2m_784d | syn_2m_1536d | syn_10m_512d | mnist_8m_784d | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 6925.58 | 1.00× | 39260.30 | 1.00× | 1776.60 | 1.00× | 3676.36 | 1.00× | 7355.30 | 1.00× | 97236.40 | 1.00× | 74407.90 | 1.00× |
| faissgpu | 525.83 | 13.17× | 1886.65 | 20.81× | 191.62 | 9.27× | 368.77 | 9.97× | 745.33 | 9.87× | 6594.34 | 14.75× | 5985.10 | 12.43× |
| symwarp | 236.77 | 29.25× | 814.36 | 48.21× | 66.66 | 26.65× | 128.79 | 28.55× | 240.78 | 30.55× | 2278.88 | 42.67× | 2121.55 | 35.07× |
As shown in Table 10 and Figure 10, symwarp achieves the lowest runtime on all seven datasets. Relative to knncuda, its speedup ranges from 26.65× on syn_1m_1536d to 48.21× on syn_10m_64d. Although faissgpu consistently outperforms knncuda, it remains slower than symwarp on every dataset, with the performance gap varying from approximately 2.2× (deep_5m_96d) to 3.1× (syn_2m_1536d).
The pair of 10M-instance synthetic datasets provides a controlled comparison of dimensionality at the largest scale evaluated. While syn_10m_64d and syn_10m_512d contain the same number of instances, increasing dimensionality from 64d to 512d widens symwarp's advantage over faissgpu from 2.32× to 2.89×. This trend is consistent with the behavior observed on the smaller synthetic datasets (Table 8), where the gap between the two methods remains between 2.08× and 2.36× across the 64-dimensional datasets from 500K to 5M instances. The gap on syn_10m_64d (2.32×) falls within this range, even though the large-scale synthetic runs use different parameters ( rather than ). Together, these results suggest that dimensionality has a somewhat stronger influence than instance count on symwarp's relative advantage over faissgpu within the evaluated range.
Table 11: Runtime (, in seconds) comparison on synthetic datasets with 500k instances. Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime for each dimensionality is shown in bold.
| Algorithm | 16d | 32d | 64d | 128d | 256d | 512d | 1024d | 2048d | 4096d | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 20.03 | 1.00× | 23.71 | 1.00× | 32.46 | 1.00× | 49.87 | 1.00× | 84.85 | 1.00× | 157.00 | 1.00× | 300.80 | 1.00× | 587.10 | 1.00× | 1159.20 | 1.00× |
| faissgpu | 4.72 | 4.24× | 5.01 | 4.73× | 5.25 | 6.18× | 7.04 | 7.08× | 10.97 | 7.73× | 18.54 | 8.47× | 34.34 | 8.76× | 65.54 | 8.96× | 129.40 | 8.96× |
| symwarp | 2.65 | 7.56× | 2.89 | 8.20× | 3.01 | 10.78× | 3.60 | 13.85× | 4.70 | 18.05× | 7.24 | 21.69× | 12.32 | 24.42× | 22.48 | 26.12× | 42.75 | 27.12× |

Fig. 11: Runtime comparison of knncuda, faissgpu, and symwarp on synthetic datasets with 500K instances and increasing dimensionality (). Runtime is reported on a logarithmic scale.

Fig. 12: Runtime comparison of pycpu, knncuda, faissgpu, and symwarp on synthetic datasets with 50K instances and increasing dimensionality (). Runtime is reported on a logarithmic scale.
4.4.8 Evaluation on the Impact of Dimensionality
On synthetic datasets with a fixed 500,000 instances but dimensionality ranging from 16d to 4096d (Table 11, Figure 11), symwarp consistently achieves the lowest runtime. As dimensionality increases, its runtime grows from 2.65s to 42.75s (), compared with increases from 20.03s to 1159.20s () for knncuda and from 4.72s to 129.40s () for faissgpu. Consequently, symwarp's speedup over knncuda increases from at 16d to at 4096d, although the increase slows at the highest dimensionalities ( at 1024d). In addition, its advantage over faissgpu widens from to ; the margin remains nearly constant () from 16d to 64d, and almost all of the widening occurs at 128d and above. These results demonstrate more favorable scaling of symwarp with feature dimensionality at fixed dataset cardinality, particularly once dimensionality exceeds roughly 100.
Table 12: Runtime (, in seconds) comparison on synthetic datasets with 50k instances. Speedup (SUP) is computed relative to the pycpu baseline. At 32768d, speedup is computed relative to knncuda because pycpu did not complete. The fastest runtime for each dataset is shown in bold.
| Algorithm | 2d | 32d | 256d | 1024d | 2048d | 4096d | 8192d | 16384d | 32768d | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP |
| pycpu | 7.69 | 1.00× | 123.66 | 1.00× | 1174.51 | 1.00× | 3933.25 | 1.00× | 7562.34 | 1.00× | 14834.52 | 1.00× | 29426.31 | 1.00× | 58314.25 | 1.00× | |||
| knncuda | 0.43 | 17.88× | 0.47 | 263.11× | 1.08 | 1087.51× | 3.20 | 1229.14× | 5.98 | 1264.61× | 11.55 | 1284.37× | 22.69 | 1296.88× | 45.28 | 1287.86× | 91.64 | 1.00× | |
| faissgpu | 0.31 | 24.81× | 0.32 | 386.44× | 0.44 | 2669.34× | 0.88 | 4469.60× | 1.44 | 5251.63× | 2.73 | 5433.89× | 6.08 | 4839.85× | 10.77 | 5414.51× | 21.29 | 4.30× | |
| symwarp | 0.12 | 64.08× | 0.12 | 1030.50× | 0.15 | 7830.07× | 0.26 | 15127.88× | 0.39 | 19390.62× | 0.69 | 21499.30× | 1.24 | 23730.90× | 2.38 | 24501.79× | 4.65 | 19.71× | |
4.4.9 Comparison with the Original FastDEC Implementation
To facilitate comparison with the original CPU-based pycpu implementation of FastDEC, we evaluate several comparatively small datasets derived from synthetic and real-world data.
Table 12 and Figure 12 show that SymWarp-FastDEC consistently achieves the lowest runtime on synthetic datasets containing 50,000 instances and dimensionalities ranging from 2d to 32,768d. The runtime of pycpu increases substantially, from 7.69 s at 2d to 58,314.25 s at 16,384d, and it fails to complete at 32,768d. In contrast, SymWarp-FastDEC increases only from 0.12 s to 2.38 s across the same range, reaching 4.65 s at 32,768d. Consequently, its speedup over pycpu grows from 64.08× to 24,501.79×, while achieving a speedup of 19.71× over knncuda at 32,768d where pycpu is unavailable.
For assessing the relative efficiency of GPU implementations, a more relevant comparison is against the GPU baselines. SymWarp-FastDEC's margin over faissgpu widens from 2.58× at 2d to a peak of 4.90× at 8,192d, and remains at approximately 4.5× at 16,384d and 32,768d (4.53× and 4.58×, respectively). This peak is the largest gap observed between the two methods across all experiments in this study, excluding the sub-second syn_5k_64d case discussed above. These results demonstrate favorable scaling of SymWarp-FastDEC with increasing dimensionality, although its margin over faissgpu plateaus beyond approximately 8,192d.
As summarized in Table 13 and illustrated in Figure 13, SymWarp-FastDEC achieves the lowest runtime across four heterogeneous benchmarks, including two
Table 13: Runtime (, in seconds) comparison on Deep1B and MNIST datasets. Speedup (SUP) is computed relative to the pycpu baseline. The fastest runtime for each dataset is shown in bold.
| Algorithm | deep_200k_96d | deep_500k_96d | mnist_70k_2d | mnist_70k_784d | ||||
|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | |
| pycpu | 9543.81 | 58307.94 | 15.51 | 5125.48 | ||||
| knncuda | 6.25 | 33.94 | 0.51 | 4.50 | ||||
| faissgpu | 1.60 | 6.87 | 0.37 | 1.05 | ||||
| symwarp | 0.94 | 3.66 | 0.16 | 0.33 | ||||

Fig. 13: Runtime comparison of pycpu, knncuda, faissgpu, and symwarp on Deep1B and MNIST datasets spanning a range of dataset sizes and dimensionalities (Deep1B: , ; MNIST: , ). Runtime is reported on a logarithmic scale.

Fig. 14: Impact of the number of nearest neighbors on the runtime of knncuda, faissgpu, and symwarp on the GloVe dataset (1.2M instances, 200 dimensions) with the number of clusters fixed at . Runtime is reported on a logarithmic scale.
Deep1B subsets and two MNIST datasets spanning different scales and dimensionalities, with speedups over pycpu ranging from to . For assessing the relative efficiency of GPU implementations, a more relevant comparison is against the GPU FastDEC variants. SymWarp-FastDEC outperforms both knncuda and faissgpu on all four datasets, with its margin over faissgpu ranging from on deep_200k_96d to on mnist_70k_784d. These results provide further evidence of a practical and consistent efficiency advantage over alternative GPU realizations across varied scales and dimensionalities.
4.4.10 Evaluation on the Impact of the Number of Nearest Neighbors
We used the same four benchmark datasets: GloVe, MNIST, image-patch, and synthetic (Tables 14–17, Figures 14–17). On each dataset we fixed the number of clusters c and varied the number of nearest neighbors k from single digits up to 512–640. Unlike c, the value of k directly sets the size of the k-NN graph and the cost of top-k selection, so runtime generally increases with k, particularly at larger neighborhood sizes. Even so, symwarp is the fastest method for every value of k on every dataset. Its speedup over knncuda ranges from to , and it is faster than faissgpu. Because faissgpu is the strongest baseline, the margin over it is the more informative measure of how efficiently symwarp handles larger neighborhoods. On three of the four datasets (GloVe, image-patch, and synthetic), this margin narrows moderately as k increases, consistent with top-k maintenance accounting for a growing share of symwarp's runtime at large k; on MNIST it remains essentially constant.
On GloVe (c = 25), the speedup over knncuda grows steadily with k, from at k = 5 to at k = 600. Over this range, the runtime of knncuda increases about , while that of symwarp increases only about . The margin over faissgpu narrows gradually, from at k = 5 to about for .
On MNIST (c = 10), the runtime of symwarp is lowest and nearly flat for (9.31–10.48s), and remains below 14s even at k = 512. It is faster than knncuda and keeps a consistent margin of over faissgpu across all values of k.
On the image-patch dataset (c = 64), the trend runs the other way. The speedup over knncuda falls from at k = 5 to at k = 600, and the margin over faissgpu narrows from to . The runtimes of both baselines rise only modestly with k (about for knncuda and for faissgpu), which is consistent with distance computation accounting for most of their cost on this high-dimensional dataset
Table 14: Runtime (, in seconds) Comparison on the GloVe Dataset (1.2M instances, 200 dimensions) with Number of Clusters Fixed at , Varying Number of Nearest Neighbors . Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime per column is shown in bold.
| Algorithm | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 394.25 | 441.31 | 472.63 | 619.69 | 1007.56 | 1471.92 | 1991.05 | 2569.18 | 3175.71 | |||||||||
| faissgpu | 52.15 | 52.54 | 53.92 | 56.46 | 65.12 | 76.12 | 84.65 | 92.33 | 111.77 | |||||||||
| symwarp | 22.52 | 23.46 | 24.76 | 26.41 | 30.34 | 35.11 | 41.48 | 47.22 | 56.08 | |||||||||
Table 15: Runtime (, in seconds) Comparison on the MNIST Dataset (500K instances, 784 dimensions) with Number of Clusters Fixed at , Varying Number of Nearest Neighbors . Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime per column is shown in bold.
| Algorithm | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 212.62 | 211.32 | 213.04 | 222.35 | 221.19 | 236.52 | 273.19 | 359.40 | ||||||||
| faissgpu | 27.52 | 25.74 | 25.28 | 25.52 | 26.14 | 27.60 | 30.10 | 37.12 | ||||||||
| symwarp | 11.76 | 9.86 | 9.31 | 9.48 | 10.04 | 10.48 | 11.74 | 13.56 | ||||||||
(1024 dimensions, 200K instances). The runtime of symwarp increases about , but from a much smaller base, and stays below 6s at .
On the synthetic dataset (), symwarp and faissgpu scale similarly with , although the runtime of symwarp grows somewhat faster: from to , their runtimes increase by and , respectively. As a result, the margin of symwarp over faissgpu narrows slightly, from at to for . The runtime of knncuda grows only moderately up to but rises sharply at and , so the speedup of symwarp over it increases from to .
Overall, the robustness study of Yang et al. (2022) showed that FastDEC maintains clustering quality superior to the competing methods evaluated for ranging from 10 to 200. Smaller values of within this range are therefore preferable in practice, as they make SymWarp-FastDEC substantially faster.
4.4.11 Evaluation on the Impact of the Number of Clusters
Across four benchmark datasets—GloVe, MNIST, image-patch, and synthetic (Tables 18–21, Figures 18–21)—varying the target number of clusters over a wide

Fig. 15: Impact of the number of nearest neighbors on the runtime of knncuda, faissgpu, and symwarp on the MNIST dataset (500K instances, 784 dimensions) with the number of clusters fixed at . Runtime is reported on a logarithmic scale.

Fig. 16: Impact of the number of nearest neighbors on the runtime of knncuda, faissgpu, and symwarp on the image-patch dataset (200K instances, 1024 dimensions) with the number of clusters fixed at . Runtime is reported on a logarithmic scale.
Table 16: Runtime (, in seconds) comparison on the image-patch dataset with 200k instances and dimensions. The number of clusters is fixed at , while the number of nearest neighbors is varied. Speedups (SUP) are computed relative to knncuda. The fastest runtime per column is shown in bold.
| Algorithm | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 46.19 | 1.00× | 46.51 | 1.00× | 46.65 | 1.00× | 47.48 | 1.00× | 49.50 | 1.00× | 52.06 | 1.00× | 54.40 | 1.00× | 57.36 | 1.00× | 60.06 | 1.00× |
| faissgpu | 6.72 | 6.87× | 6.96 | 6.68× | 7.15 | 6.52× | 7.48 | 6.35× | 8.25 | 6.00× | 8.94 | 5.82× | 9.65 | 5.64× | 10.27 | 5.59× | 11.13 | 5.40× |
| symwarp | 2.17 | 21.29× | 2.37 | 19.62× | 2.56 | 18.22× | 2.86 | 16.60× | 3.40 | 14.56× | 4.13 | 12.61× | 4.78 | 11.38× | 5.27 | 10.88× | 5.96 | 10.08× |
Table 17: Runtime (, in seconds) Comparison on Synthetic Dataset (500K instances, 128 dimensions) with Number of Clusters Fixed at , Varying Number of Nearest Neighbors . Speedup (SUP) is computed relative to the knncuda baseline. The fastest runtime per column is shown in bold.
| Algorithm | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 38.55 | 1.00× | 41.87 | 1.00× | 54.69 | 1.00× | 52.37 | 1.00× | 72.14 | 1.00× | 124.11 | 1.00× | 236.21 | 1.00× |
| faissgpu | 6.87 | 5.61× | 7.08 | 5.91× | 7.27 | 7.52× | 8.01 | 6.54× | 9.42 | 7.66× | 13.42 | 9.25× | 23.04 | 10.25× |
| symwarp | 3.21 | 12.01× | 3.36 | 12.46× | 3.59 | 15.23× | 4.21 | 12.44× | 4.83 | 14.94× | 7.38 | 16.82× | 12.45 | 18.97× |
range (up to 512–3200, depending on the dataset) has minimal impact on runtime for any evaluated method. symwarp remains fastest throughout, with its speedup over knncuda staying within a narrow band (roughly 17–19× on GloVe, 23–24× on MNIST, 18–20× on image-patch datasets, and 12–13× on synthetic datasets) and a similarly stable 2.1–2.9× margin over faissgpu across all cluster settings. This near-flat runtime profile is consistent with the algorithm design, which reuses the -NN

Fig. 17: Impact of the number of nearest neighbors on the runtime of knncuda, faissgpu, and symwarp on the synthetic dataset (500K instances, 128 dimensions) with the number of clusters fixed at . Runtime is reported on a logarithmic scale.

Fig. 18: Impact of the number of clusters on the runtime of knncuda, faissgpu, and symwarp on the GloVe dataset (1.2M instances, 200 dimensions) with the number of nearest neighbors fixed at . Runtime is reported on a logarithmic scale.
Table 18: Runtime (, in seconds) comparison on the GloVe 1.2M × 200d dataset with for varying numbers of clusters (). Speedup (SUP) is reported relative to the knncuda baseline. The best runtime for each value of is shown in bold.
| Algorithm | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 427.90 | 1.00× | 429.05 | 1.00× | 429.33 | 1.00× | 428.75 | 1.00× | 428.75 | 1.00× | 428.91 | 1.00× | 429.16 | 1.00× | 429.06 | 1.00× | 430.02 | 1.00× |
| faissgpu | 54.40 | 7.87× | 54.63 | 7.85× | 54.24 | 7.92× | 54.25 | 7.90× | 54.38 | 7.88× | 54.63 | 7.85× | 55.08 | 7.79× | 54.98 | 7.80× | 56.03 | 7.67× |
| symwarp | 23.20 | 18.44× | 23.19 | 18.50× | 23.21 | 18.50× | 23.21 | 18.47× | 23.19 | 18.49× | 23.46 | 18.28× | 23.83 | 18.01× | 23.83 | 18.01× | 24.89 | 17.28× |
Table 19: Runtime (, in seconds) comparison on the MNIST 500k × 784d dataset with for varying numbers of clusters (). Speedup (SUP) is reported relative to the knncuda baseline. The best runtime for each value of is shown in bold.
| Algorithm | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 225.11 | 1.00× | 225.04 | 1.00× | 225.19 | 1.00× | 225.01 | 1.00× | 225.02 | 1.00× | 224.94 | 1.00× | 225.21 | 1.00× | 225.21 | 1.00× | 225.23 | 1.00× |
| faissgpu | 25.82 | 8.72× | 25.79 | 8.73× | 25.15 | 8.95× | 26.14 | 8.61× | 26.09 | 8.62× | 26.13 | 8.61× | 26.03 | 8.65× | 26.36 | 8.54× | 26.34 | 8.55× |
| symwarp | 9.51 | 23.67× | 9.52 | 23.64× | 9.49 | 23.73× | 9.46 | 23.79× | 9.58 | 23.49× | 9.52 | 23.63× | 9.52 | 23.66× | 9.76 | 23.07× | 9.78 | 23.03× |
graph constructed during the initial density estimation pass when additional DCs are required at larger values of , so increasing the requested clustering resolution adds little computational cost.
4.5 Output Equivalence Validation
Section 3.1.3 established that the top- tie-break in SymTri-kNN is resolved deterministically and quantified the prevalence of exact-distance ties in practice. However, that analysis considered only the -NN layer in isolation. This section evaluates the

Fig. 19: Impact of the number of clusters c on the runtime of knncuda, faissgpu, and symwarp on the MNIST dataset (500K instances, 784 dimensions) with the number of nearest neighbors fixed at k = 32. Runtime is reported on a logarithmic scale.

Fig. 20: Impact of the number of clusters c on the runtime of knncuda, faissgpu, and symwarp on the 32×32 image-patch dataset (200K instances, 1024 dimensions) with the number of nearest neighbors fixed at k = 45. Runtime is reported on a logarithmic scale.
Table 20: Runtime (T, in seconds) comparison on the 32 × 32 image-patch dataset (200k instances, 1024 dimensions) with k = 45 for varying numbers of clusters (c). Speedup (SUP) is reported relative to the knncuda baseline. The best runtime for each value of c is shown in bold.
| Algorithm | c=4 | c=8 | c=16 | c=32 | c=64 | c=128 | c=256 | c=512 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 46.95 | 1.00× | 47.07 | 1.00× | 48.02 | 1.00× | 48.00 | 1.00× | 47.98 | 1.00× | 47.99 | 1.00× | 48.01 | 1.00× | 48.03 | 1.00× |
| faissgpu | 6.92 | 6.78× | 6.96 | 6.76× | 6.97 | 6.89× | 6.97 | 6.89× | 7.05 | 6.81× | 7.06 | 6.80× | 7.10 | 6.76× | 7.09 | 6.77× |
| symwarp | 2.36 | 19.89× | 2.42 | 19.45× | 2.46 | 19.52× | 2.51 | 19.12× | 2.54 | 18.89× | 2.53 | 18.97× | 2.60 | 18.47× | 2.60 | 18.47× |
Table 21: Runtime (T, in seconds) comparison on the synthetic 500k × 128d dataset with k = 18 for varying numbers of clusters (c). Speedup (SUP) is reported relative to the knncuda baseline. The best runtime for each value of c is shown in bold.
| Algorithm | c=4 | c=8 | c=16 | c=32 | c=64 | c=128 | c=256 | c=512 | c=1024 | c=2048 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | T | SUP | |
| knncuda | 42.65 | 1.00× | 42.61 | 1.00× | 42.57 | 1.00× | 42.61 | 1.00× | 42.61 | 1.00× | 42.59 | 1.00× | 42.56 | 1.00× | 42.58 | 1.00× | 42.62 | 1.00× | 42.63 | 1.00× |
| faissgpu | 7.02 | 6.08× | 7.00 | 6.09× | 6.99 | 6.09× | 7.00 | 6.09× | 7.01 | 6.08× | 6.99 | 6.09× | 7.00 | 6.08× | 7.01 | 6.07× | 7.14 | 5.97× | 7.13 | 5.98× |
| symwarp | 3.33 | 12.81× | 3.32 | 12.83× | 3.32 | 12.82× | 3.32 | 12.83× | 3.31 | 12.87× | 3.31 | 12.87× | 3.31 | 12.86× | 3.31 | 12.86× | 3.44 | 12.39× | 3.45 | 12.36× |
extent to which SymWarp-FastDEC reproduces the outputs of the original CPU reference implementation, FastDEC-pycpu (Yang et al. 2022). Specifically, we evaluate agreement between the two pipelines at every stage of the clustering process, including neighbor-set construction, DC detection, cluster-center selection, and final cluster assignment.
Both pipelines were exercised through their own implementations, with the two corrections described at the end of this section applied to both beforehand, on seven
Runtime Comparison on Synthetic 500k x 128d (varying c, k=18)

Fig. 21: Impact of the number of clusters c on the runtime of knncuda, faissgpu, and symwarp on the synthetic dataset (500K instances, 128 dimensions) with the number of nearest neighbors fixed at k = 18. Runtime is reported on a logarithmic scale.
datasets (nine dataset/configuration combinations) spanning 240–20,000 points and 2–784 dimensions. The evaluation includes three configurations of a real, quantized-coordinate dataset (MNIST), two of them at k = 256, chosen to exercise the exact-tie risk identified in Section 3.1.3. For each configuration, four artifacts were compared: the raw self-k-NN neighbor sets, the detected DC sets, the selected cluster-center point indices, and the final per-point cluster assignments. k-NN agreement is the percentage of points whose unordered top-k neighbor set is identical in both pipelines; a single differing neighbor counts as a disagreement, making this measure stricter than mean set overlap. DC and center agreement are counts of exactly matched point indices, and partition agreement is measured by the Adjusted Rand Index (ARI) (Hubert and Arabie 1985). Because FastDEC-pycpu becomes prohibitively expensive at larger scales, the equivalence study is restricted to smaller datasets than those used in the throughput evaluation.
All nine configurations yielded identical final clustering partitions between SymWarp-FastDEC and FastDEC-pycpu (ARI = 1 exactly), despite small differences in individual neighbor sets. k-NN agreement is no lower than 99.30% on any configuration, and DC and center indices agree exactly everywhere except on S2. There, one DC is replaced by a neighboring point, which also changes one center, because
Table 22: Output agreement between SymWarp-FastDEC and FastDEC-pycpu across nine dataset configurations. denotes the number of data points, the number of nearest neighbors per point, and the requested number of clusters. All ARI values are exactly 1 (identical partitions). The number of DCs equals , so every DC becomes a center and the significance ranking is not exercised.
| Dataset | kNN agreement (%) | DCs matched | Centers matched | ARI | |||
|---|---|---|---|---|---|---|---|
| Spiral | 312 | 7 | 3 | 100.00 | 7/7 | 3/3 | 1 |
| Flame | 240 | 5 | 2 | 99.58 | 20/20 | 2/2 | 1 |
| banana-ball | 2,000 | 11 | 3 | 99.95 | 73/73 | 3/3 | 1 |
| R15 | 600 | 33 | 15 | 100.00 | 15/15 | 15/15 | 1 |
| S2 | 5,000 | 31 | 15 | 99.30 | 17/18 | 14/15 | 1 |
| MFCCs | 7,195 | 25 | 10 | 99.68 | 46/46 | 10/10 | 1 |
| MNIST (5,000-row subset) | 5,000 | 32 | 10 | 99.98 | 13/13 | 10/10 | 1 |
| MNIST (5,000-row subset) | 5,000 | 256 | 2 | 100.00 | 2/2 | 2/2 | 1 |
| MNIST (20,000-row subset) | 20,000 | 256 | 9 | 99.94 | 9/9 | 9/9 | 1 |
a near-degenerate density comparison is ordered differently under FP32 and FP64 arithmetic rather than because of an exact-distance tie. The two candidate points lie on the same local density peak, and the discrepancy does not propagate to the final clustering result.
The equivalence study also uncovered two implementation defects shared by both FastDEC-pycpu and SymWarp-FastDEC, neither of which is related to tie breaking. First, the significance-score normalization used to rank DCs can degenerate. When too few DCs exist for the sentinel fill-in convention (Section 2.4.3) to produce a distinct value, min-max normalization divides by a zero range, propagating NaN into the score and making center selection effectively arbitrary. In rare cases, this behavior can exclude the true global density maximum from the selected centers.
Second, a point with no CDH point in the dataset (i.e., the global density maximum) but not selected as a center leaves , which a naive implementation may incorrectly dereference during label propagation. Both implementations now treat a zero-range normalization factor as neutral rather than undefined and explicitly guard the case during cluster assignment (Algorithm 12). Both fixes were applied symmetrically to the CPU and GPU implementations. Neither fix's code path is reached, on either side, in any configuration of Table 22 or in any other experiment reported here, so the unpatched original implementation produces the same outputs.
4.6 Reduced-Precision (TF32) Option
All other results in this paper use strict FP32 arithmetic (Section 4.1). Because the dominant -dependent work in both SymTri-NN and WP-DC is performed by cuBLAS SGEMM, SymWarp-FastDEC can optionally enable TF32 tensor-core math for these calls. TF32 rounds GEMM inputs to 10 explicit fraction bits while accumulating in FP32; data storage, squared norms, and distance outputs remain FP32, and the search remains exhaustive. TF32 therefore changes the arithmetic used to rank candidates, not the set of candidate pairs examined. Because the norm-expansion form of the squared Euclidean distance is prone to cancellation in low dimensions, the implementation keeps FP32 when ; this guard is a safeguard rather than an accuracy guarantee for larger .
Table 23 reports the fit-time speedup of TF32 over FP32, measured with the protocol of Section 4.1. It also reports the adjusted Rand index (ARI) between the complete FP32 and TF32 label vectors, obtained from separate label-export runs that reproduced the DC counts and ordered center lists of the timed runs. As expected, the benefit grows with the share of time spent in GEMM. On the fixed-size synthetic sweep, the speedup rises from at 16d to at 4096d, and the 64x64 patches and syn_2m_1536d reach and , respectively. In contrast, deep_2m_96d and syn_10m_64d gain only and , showing that a large alone does not imply a large TF32 benefit. On mnist_70k_2d, the dimensionality guard applies, so both builds execute the same FP32 path and produce identical partitions.
TF32 does not preserve the FP32 output. Reduced-precision inner products perturb near-equidistant neighbor orderings and density comparisons, and these perturbations propagate to DC detection and label assignment. On the real-world
Table 23: TF32 versus FP32 SymWarp-FastDEC: fit-time speedup and ARI between the full FP32 and TF32 partitions. ARI compares the two precisions with each other, not with ground-truth labels. Only syn_500k_16d yields an identical partition.
| Dataset | (k, c) | ARI | |
|---|---|---|---|
| mnist_70k_784d | (25, 10) | 1.36× | 0.999975 |
| mnist_500k_784d | (25, 10) | 1.79× | 0.986866 |
| deep_2m_96d | (50, 80) | 1.16× | 0.996665 |
| GloVe 200d | (45, 20) | 1.37× | 0.995019 |
| 64x64 patches | (25, 64) | 1.89× | 0.999719 |
| syn_10m_64d | (32, 25) | 1.13× | 0.728461 |
| syn_2m_1536d | (32, 25) | 1.96× | 0.971013 |
| syn_500k_16d | (32, 20) | 1.00× | 1 |
| syn_500k_128d | (32, 20) | 1.22× | 0.914592 |
| syn_500k_512d | (32, 20) | 1.63× | 0.954741 |
| syn_500k_4096d | (32, 20) | 2.23× | 0.949034 |
datasets, agreement remains high (ARI 0.987–0.99998), but no partition is identical, even where the selected centers coincide (mnist_70k_784d, 64x64 patches). The synthetic datasets are considerably more sensitive, with ARI as low as 0.73 on syn_10m_64d despite all 25 centers being retained. This is consistent with their uniform distribution (Section 4.2): without natural cluster structure, partition boundaries are determined by small density differences. Agreement also does not increase monotonically with dimensionality. Across the 116 benchmark configurations timed in both precisions, only 70 select the same set of centers.
We therefore keep FP32 as the default configuration, under which the equivalence results of Section 4.5 hold. TF32 is a separate, opt-in throughput mode that is most useful for high-dimensional workloads; when it is used, partition stability and clustering quality should be validated for the target data, and FP32 quality results should not be assumed to carry over.
5 Conclusions and Future Work
In this paper, we presented SymWarp-FastDEC², a GPU-accelerated re-architecture of FastDEC that accelerates its two dominant stages: exact self-k-NN-based density estimation and dominance-component (DC) reduction. The key enablers are (i) SymTri-kNN, an index-free exact GPU self-k-NN algorithm that exploits the symmetry of the self-query setting via upper-triangular traversal and warp-cooperative top-k maintenance, and (ii) WP-DC, a warp-parallel DC reduction kernel that decouples DC reduction from any auxiliary index or graph structure. Across diverse real-world and synthetic benchmarks, SymWarp-FastDEC achieves approximately 1.7×–4.9× end-to-end speedup over a FastDEC implementation employing FAISS GpuIndexFlatL2 for exact k-NN search. Under the FP32 configuration and equivalence protocol used in this study, it produces clustering outcomes identical to the original FastDEC (ARI = 1 exactly on all equivalence benchmarks). Consequently, it can serve as a drop-in replacement (same interface and parameters) for the original FastDEC in that setting. This end-to-end advantage over the pipeline built on the heavily optimized and widely deployed exact GPU k-NN baseline FAISS GpuIndexFlatL2 holds across all evaluated benchmarks and generally grows with dimensionality. All experiments were conducted on a single NVIDIA RTX A6000; while the design principles are architecture-independent, the relative performance against FAISS may vary across GPU generations.
Beyond performance, the proposed design strengthens FastDEC's practicality on modern high-dimensional embeddings by preserving full-dimensional vectors and avoiding lossy dimensionality reduction. Furthermore, because SymTri-kNN is index-free, its performance is largely unaffected by the degradation that many search indexes experience in high-dimensional spaces while still providing exact results. The resulting pipeline provides an efficient, exact, and scalable baseline for large-scale density-peak
²SymWarp-FastDEC is released at https://github.com/cyberbull66/symwarp-fastdec.
clustering, extending the practical applicability of exact density-peak methods to substantially larger datasets in domains such as representation learning, semantic search, image analysis, anomaly detection, and data mining.
Future work includes: (1) extending the single-GPU design to multi-GPU execution for the density-estimation stage, including overlap of computation and communication via CUDA streams; (2) reducing GPU-memory pressure through more compact neighbor and metadata layouts, as well as out-of-core or chunked execution for very large ; (3) broadening support for additional distance and similarity measures and reduced-precision modes, building on the TF32 option of Section 4.6 with workload-specific validation of partition stability, while preserving FastDEC's exactness guarantees where required; (4) enhancing the pipeline to better support streaming or continually growing datasets, including incremental updates to neighborhood structures and cluster assignments under bounded memory; (5) leveraging SymTri-kNN and WP-DC as reusable building blocks for accelerating other self-similarity and density-based analytics pipelines that share the same computational structure; and (6) evaluating SymWarp-FastDEC across additional GPU architectures and generations.
Declarations
Funding. This research was supported by the University of Waikato.
Competing interests. The authors have no relevant financial or non-financial interests to disclose.
Data availability. The MNIST, MNIST8M, GloVe, and Deep1B datasets analyzed in this study are publicly available from the sources cited in Section 4.2; the subsets used in our experiments were sampled from these datasets. The image-patch datasets and the synthetic datasets were generated as described in Section 4.2. The generated datasets, the sampled subsets, and the raw runtime measurements supporting the results of this study are available from the corresponding author on reasonable request.
The source images from which the image patches were extracted are publicly available from the Open Images Dataset (Kuznetsova et al. 2020).
Code availability. The source code of SymWarp-FastDEC, together with the FastDEC-knncuda and FastDEC-faissgpu baseline implementations used in our experiments, is publicly available at https://github.com/cyberbull66/symwarp-fastdec.
References
Amagata D, Hara T (2021) Fast density-peaks clustering: multicore-based parallelization approach. In: Proceedings of the 2021 International Conference on Management of Data, pp 49–61
Andrade G, Ramos G, Madeira D, et al (2013) G-dbscan: A gpu accelerated algorithm for density-based clustering. Procedia Computer Science 18:369–378
Babenko A, Lempitsky V (2016) Efficient indexing of billion-scale datasets of deep descriptors. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp 2055–2063, https://doi.org/10.1109/CVPR.2016.226
Bhattacharjee P, Mitra P (2021) A survey of density based clustering algorithms. Frontiers of Computer Science 15(1):151308
Carlson R, Bauer J, Manning CD (2025) A new pair of gloves. arXiv preprint arXiv:250718103
Chen B, Zhou K (2021) An improved density peaks clustering algorithm based on cure. Academic Journal of Computing & Information Science 4(2):1–6
Chen Y, Hu X, Fan W, et al (2020) Fast density peak clustering for large scale data based on knn. Knowledge-Based Systems 187:104824
Coates A, Ng AY (2012) Learning feature representations with k-means. In: Neural Networks: Tricks of the Trade. Springer, p 561–580
Fahad A, Alshatri N, Tari Z, et al (2014) A survey of clustering algorithms for big data: Taxonomy and empirical analysis. IEEE Transactions on Emerging Topics in Computing 2(3):267–279
Fang W, Lau KK, Lu M, et al (2008) Parallel data mining on graphics processors. Tech. Rep. HKUST-CS08-07, Hong Kong Univ. Sci. and Technology, Hong Kong, China
Garcia V, Debreuve E, Barlaud M (2008) Fast k nearest neighbor search using GPU. In: 2008 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops. IEEE, pp 1–6
Garcia V, Debreuve E, Nielsen F, et al (2010) K-nearest neighbor search: Fast GPU-based implementations and application to high-dimensional feature matching. In: 2010 IEEE International Conference on Image Processing. IEEE, pp 3757–3760
Ge Ks, Su Hy, Li Ds, et al (2017) Efficient parallel implementation of a density peaks clustering algorithm on graphics processing unit. Frontiers of Information Technology & Electronic Engineering 18(7):915–927
Guan J, Li S, He X, et al (2021) Peak-graph-based fast density peak clustering for image segmentation. IEEE Signal Processing Letters 28:897–901
Hubert L, Arabie P (1985) Comparing partitions. Journal of Classification 2(1):193–218
Jia H, Wu Y, Mao Q, et al (2024) Adaptive density subgraph clustering. IEEE Transactions on Computational Social Systems 11(4):5468–5482
Johnson J, Douze M, Jégou H (2019) Billion-scale similarity search with GPUs. IEEE Transactions on Big Data 7(3):535–547. https://doi.org/10.1109/TBDATA.2019.2921572
Kamel V, Yan H, Chester S (2025) CLOVER: A GPU-native, spatio-graph-based approach to exact kNN. In: Proceedings of the 39th ACM International Conference on Supercomputing, pp 236–249
Kuznetsova A, Rom H, Alldrin N, et al (2020) The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. International Journal of Computer Vision 128(7):1956–1981. https://doi.org/10.1007/s11263-020-01316-z
Langdon WB (2013) Large-scale bioinformatics data mining with parallel genetic programming on graphics processing units. In: Massively Parallel Evolutionary Computation on GPGPUs. Springer, p 311–347
LeCun Y, Bottou L, Bengio Y, et al (1998) Gradient-based learning applied to document recognition. Proceedings of the IEEE 86(11):2278–2324. https://doi.org/10.1109/5.726791
Li M, Huang J, Wang J (2016) Paralleled fast search and find of density peaks clustering algorithm on gpus with cuda. International Journal of Networked and Distributed Computing 4(3):173–181
Li M, Frank E, Pfahringer B (2023) Large scale K-means clustering using GPUs. Data Mining and Knowledge Discovery 37(1):67–109
Li Y, Sun L, Tang Y, et al (2022) A review of related density peaks clustering approaches. In: 2022 14th International Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC), IEEE, pp 145–149
Liu R, Wang H, Yu X (2018) Shared-nearest-neighbor-based clustering by fast search and find of density peaks. Information Sciences 450:200–226
Loosli G, Canu S, Bottou L (2007) Training invariant support vector machines using selective sampling. In: Bottou L, Chapelle O, DeCoste D, et al (eds) Large Scale Kernel Machines. MIT Press, Cambridge, MA, pp 301–320
Ma L, Yang G, Chen X, et al (2023) Ultra-dpc: ultra-scalable and index-free density peak clustering. In: Asia-Pacific Web (APWeb) and Web-Age Information Management (WAIM) Joint International Conference on Web and Big Data, Springer, pp 139–154
Ma L, Yang G, Yang Y, et al (2024) Up-dpc: Ultra-scalable parallel density peak clustering. Information Sciences 660:120114
Meta AI Research (2024) Faiss: A library for efficient similarity search and clustering of dense vectors. https://github.com/facebookresearch/faiss, accessed: 2026-08-05
NVIDIA (2026) CUDA C programming guide. https://docs.nvidia.com/cuda/cuda-c-programming-guide/
Owens JD, Houston M, Luebke D, et al (2008) GPU computing. Proceedings of the IEEE 96(5):879–899
Pennington J, Socher R, Manning CD (2014) Glove: Global vectors for word representation. In: Conference on Empirical Methods in Natural Language Processing. The Association for Computational Linguistics, pp 1532–1543
Rasool Z, Zhou R, Chen L, et al (2020) Index-based solutions for efficient density peak clustering. IEEE Transactions on Knowledge and Data Engineering 34(5):2212–2226
Ren C, Wang C, Yu Y, et al (2025) Network intrusion detection based on relative mutual k-nearest neighbor density peak clustering. Frontiers in Physics 13:1623161
Rodriguez A, Laio A (2014) Clustering by fast search and find of density peaks. Science 344(6191):1492–1496
Sajana T, Rani CS, Narayana K (2016) A survey on clustering techniques for big data mining. Indian Journal of Science and Technology 9(3):1–12
Shirkhorshidi AS, Aghabozorgi S, Wah TY, et al (2014) Big data clustering: a review. In: International Conference on Computational Science and Its Applications. Springer, pp 707–720
Su Y, Zhang Y, Wan C, et al (2020) Gdpc: A gpu-accelerated density peaks clustering algorithm. In: International Conference on Database Systems for Advanced Applications, Springer, pp 305–313
Upadhyaya SR (2013) Parallel approaches to machine learning — a comprehensive survey. Journal of Parallel and Distributed Computing 73(3):284–292
Wang H, Zhang J, Shen Y, et al (2025) Improved density peak clustering with a flexible manifold distance and natural nearest neighbors for network intrusion detection. Scientific Reports 15(1):8510
Wang Y, Qian J, Hassan M, et al (2024) Density peak clustering algorithms: A review on the decade 2014–2023. Expert Systems with Applications 238:121860
Weber R, Schek HJ, Blott S (1998) A quantitative analysis and performance study for similarity-search methods in high-dimensional spaces. In: Proceedings of the 24th International Conference on Very Large Data Bases (VLDB '98). Morgan Kaufmann, pp 194–205
Wei X, Peng M, Huang H, et al (2023) An overview on density peaks clustering. Neurocomputing 554:126633
Xu J, Xiao T, Yang J, et al (2024) Faithful density-peaks clustering via matrix computations on mpi parallelization system. arXiv preprint arXiv:240612297
Yang G, Lv H, Yang Y, et al (2022) Fastdec: clustering by fast dominance estimation. In: Joint European Conference on Machine Learning and Knowledge Discovery in Databases, Springer, pp 138–156
Yin H, Aryani A, Petrie S, et al (2026) A rapid review of clustering algorithms. Array p 100904
Zheng X, Ren C, Yang Y, et al (2021) Quickdsc: clustering by quick density subgraph estimation. Information Sciences 581:403–427