Skip to content

Sequential and parallel k-means clustering with CUDA

License

Notifications You must be signed in to change notification settings

lorenzo-27/kmeans-cuda

Repository files navigation

Accelerating K-means Clustering Through CUDA Parallel Computing

This repository provides a high-performance implementation of the K-Means clustering algorithm, optimized for execution on NVIDIA GPUs using CUDA. The project focuses on leveraging shared memory and parallel reduction techniques to achieve significant performance improvements over traditional CPU-based approaches.

Prerequisites

The project requires the following components:

  • NVIDIA GPU with Compute Capability 6.0 or higher
  • CUDA Toolkit (minimum version 11.0)
  • C++ compiler supporting CUDA (such as nvcc from the CUDA Toolkit)

Setup and Usage

  1. Clone the repository:
git clone lorenzo-27/kmeans-cuda
cd kmeans-cuda
  1. Configure the algorithm parameters:
    • Open kmeans_config.py
    • Adjust the clustering parameters according to your requirements
  2. Compile the project:
    • If using CLion with CUDA support, the build process is automatically handled.
    • For manual compilation, ensure you create a cmake-build-release directory or update the executable path in kmeans.py
  3. Run the program:
  • Use the Python script kmeans.py to execute the compiled binary and manage datasets and results.

Note

Upon execution, the program automatically creates two directories:

  • data/: Contains generated datasets
  • results/: Stores performance plots and analysis tables

Documentation

For a comprehensive understanding of the implementation and performance analysis, please refer to our detailed technical report available here. The report includes:

  • Implementation details
  • Performance benchmarks
  • Experimental results and analysis

License

This project is licensed under the MIT License.

About

Sequential and parallel k-means clustering with CUDA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published