CPU- and GPU-based Distributed Sampling in Dirichlet Process Mixtures for Large-scale Analysis

Or Dinari, Raz Zamir, John W. Fisher Iii, Oren FreifeldarXiv 2022 · DOI

Abstract

Dirichlet Process Mixture Models (DPMMs) offer a flexible approach to clustering by automatically inferring the number of clusters from data. However, their reliance on serial Markov Chain Monte Carlo (MCMC) sampling has historically limited their scalability. This paper presents a high-performance software suite that leverages distributed CPU clusters and multi-stream GPU architectures to enable large-scale DPMM inference. By implementing a parallel split/merge framework, the proposed system achieves significant speedups—up to 35x over standard libraries—while maintaining high accuracy on datasets with millions of points and high dimensionality.

Introduction

Clustering is a fundamental task in unsupervised learning, yet most traditional algorithms require the user to pre-specify the number of clusters ($K$). Bayesian nonparametric models, specifically Dirichlet Process Mixture Models (DPMMs), circumvent this requirement by treating $K$ as a latent variable. Despite their theoretical appeal, DPMMs have seen limited practical adoption due to the computational intensity of MCMC sampling, which often scales poorly with dataset size and dimensionality.

Recent work by Dinari et al. addresses these challenges by introducing an open-source software package designed for modern high-performance computing environments. Their implementation brings DPMMs into the realm of "Big Data" by utilizing both distributed CPU resources and GPU acceleration.

System Architecture and Implementation

The software suite is designed with a modular architecture to accommodate different hardware environments. It provides two primary backends: a Julia-based implementation for distributed CPU computing and a CUDA/C++ implementation for GPU acceleration.

Summary of the software packages, target processors, and key features.

The Julia implementation utilizes a distributed memory model, allowing it to scale across multiple multi-core machines. In contrast, the CUDA/C++ implementation focuses on maximizing throughput on a single machine by leveraging Nvidia’s asynchronous memory allocation and multiple GPU streams. This allows for the parallel processing of clusters, aiming for near-constant time complexity relative to the number of clusters. A Python wrapper provides a high-level interface, making these high-performance backends accessible to a wider audience.

Methodology: Parallel Split/Merge Framework

The core algorithmic contribution is the parallelization of the split/merge framework. Unlike standard Gibbs samplers that update labels for individual data points—a process that is inherently serial and prone to getting stuck in local optima—the split/merge framework proposes global moves. By splitting a single cluster into two or merging two existing clusters, the sampler can explore the posterior distribution more efficiently.

The authors' implementation supports complex cluster geometries beyond simple isotropic Gaussians, including full covariance matrices and multinomial distributions. This flexibility is crucial for modeling real-world data such as text and high-dimensional images.

Experimental Evaluation

The researchers evaluated the performance and accuracy of their system using a variety of benchmarks, ranging from synthetic datasets with 1,000,000 points to real-world datasets like ImageNet-100 and 20newsgroups.

Performance Benchmarks

On a single machine, the CUDA/C++ implementation demonstrated a 2.5x speedup over the Julia version and a 35x speedup over the standard sklearn Bayesian Gaussian Mixture implementation. The GPU's advantage became even more pronounced in high-dimensional settings; for the 20newsgroups dataset ($d=20,000$), the CUDA backend was 188 times faster than the Julia version.

Accuracy and Convergence

In tests on ImageNet-100, the proposed DPMM implementation automatically converged to an average of 96.8 clusters, remarkably close to the ground truth of $K=100$. In comparison, standard libraries often require manual tuning of $K$ and can fail to converge to the correct cluster count, resulting in lower Normalized Mutual Information (NMI) scores.

Conclusion

The software suite introduced by Dinari et al. represents a significant step forward in making Bayesian nonparametric clustering practical for large-scale applications. By providing optimized backends for both distributed CPUs and GPUs, the package allows researchers to choose the best hardware for their specific data constraints. Future developments aim to extend multi-machine support to the CUDA/C++ backend and broaden the range of supported probability distributions.

Code Availability: The implementation is available on GitHub at https://github.com/BGU-CS-VIL/DPMMSubClusters_GPU.

Summary updated

BibTeX
@misc{dinari2022cpu,
  author = {Or Dinari and Raz Zamir and John W. Fisher III and Oren Freifeld},
  title = {{CPU- and GPU-based Distributed Sampling in Dirichlet Process Mixtures for Large-scale Analysis}},
  year = {2022},
  eprint = {2204.08988},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.08988},
}
Figure