Skip to main content
QUICK REVIEW

[Paper Review] Design and optimization of DBSCAN Algorithm based on CUDA

Bingchen Wang, Chenglong Zhang|arXiv (Cornell University)|Jun 7, 2015
Data Management and AlgorithmsComputer Science5 references4 citations
TL;DR

This paper proposes a CUDA-accelerated DBSCAN algorithm that optimizes distance computation and primitive cluster construction using shared memory and kernel fusion, achieving a 97.89x speedup over the serial version on large datasets by minimizing global memory access and improving memory coalescing and thread divergence.

ABSTRACT

DBSCAN is a very classic algorithm for data clus- tering, which is widely used in many fields. However, with the data scale growing much more bigger than before, the traditional serial algorithm can not meet the performance requirement. Recently, parallel computing based on CUDA has developed very fast and has great advantage on big data. This paper summarizes the algorithms proposed before and improves the performance of the old DBSCAN algorithm by using CUDA and parallel computing. The algorithm uses shared memory as much as possible compared with other algorithms and it has very good scalability. A data set is tested on the new version of DBSCAN. Finally, we analyze the results and give a conclusion that our algorithm is approximately 97 times faster than the serial version.

Motivation & Objective

  • Address the performance bottleneck in serial DBSCAN caused by high computational cost in distance calculation and cluster construction.
  • Overcome the limitations of existing GPU-based DBSCAN methods that suffer from low parallelism and excessive global memory access due to complex tree-based or block-coordination mechanisms.
  • Optimize the DBSCAN pipeline for GPU architecture by maximizing shared memory usage and minimizing kernel launch overhead.
  • Improve scalability and performance on large-scale datasets by restructuring the algorithm into three fully parallelizable steps: distance matrix computation, primitive cluster formation, and cluster merging.

Proposed method

  • Divides DBSCAN into three parallelizable stages: (1) compute pairwise distances using CUDA kernels, (2) identify core points and form primitive clusters using shared memory, and (3) merge clusters via iterative propagation.
  • Uses shared memory to store distance matrices and cluster data, reducing global memory access and improving memory coalescing and bandwidth efficiency.
  • Fuses distance calculation and primitive cluster construction into a single kernel launch to reduce kernel launch overhead and improve data locality.
  • Applies loop unrolling and code restructuring to reduce instruction count and improve compiler optimization, enhancing single-thread performance.
  • Minimizes branch divergence and bank conflicts in shared memory by reorganizing data access patterns and controlling memory access operations.
  • Employs a modified approach to cluster merging that avoids expensive transitive closure computation, instead using iterative merging with reduced kernel launches.

Experimental results

Research questions

  • RQ1How can the DBSCAN algorithm be restructured to maximize parallelism and minimize memory access overhead on GPU architectures?
  • RQ2What are the performance bottlenecks in the serial DBSCAN implementation, and how can they be effectively targeted using GPU acceleration?
  • RQ3To what extent can shared memory and kernel fusion improve the performance of DBSCAN on large-scale datasets compared to existing GPU-based approaches?
  • RQ4Can algorithmic optimizations such as loop unrolling and memory access restructuring significantly enhance single-thread performance in a GPU-accelerated DBSCAN?
  • RQ5Why does the transitive closure-based merging strategy fail in practice despite high theoretical parallelism, and what alternative merging strategy offers better performance?

Key findings

  • Distance calculation accounts for 66.27% of total execution time in the serial DBSCAN algorithm, making it the primary performance bottleneck.
  • The proposed CUDA-optimized algorithm reduces the combined time for distance calculation and primitive cluster construction from 1.79 seconds (CPU) to 9.91 milliseconds (GPU), achieving a 180.67x speedup on a 23,040-point dataset.
  • By fusing distance computation and cluster construction into a single kernel, execution time is reduced from 50.151ms to 25.336ms, demonstrating a 2x improvement and confirming that global memory access is a major performance drain.
  • Loop unrolling and code restructuring reduce the number of instructions compiled by the nvcc compiler from 442 to 342, leading to more compact and efficient kernel code.
  • The overall algorithm achieves a 97.89x speedup over the serial version on a 60,032-point dataset, with total execution time dropping from 12,210ms (CPU) to 124.73ms (GPU), including data transfer overhead.
  • Cluster merging remains a performance challenge, consuming nearly as much time as the serial version due to high data transfer and synchronization costs, indicating a need for further optimization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.