Parallel K-means Clustering. Ajay Padoor Chandramohan Fall 2012 CSE 633

Similar documents
Parallel Algorithms K means Clustering

COMPUTING OVERLAPPING LINE SEGMENTS. - A parallel approach by Vinoth Selvaraju

Parallel K-Means Clustering with Triangle Inequality

PARALLELIZED IMPLEMENTATION OF LOGISTIC REGRESSION USING MPI

Parallel Convex Hull using MPI. CSE633 Fall 2012 Alex Vertlieb

Determining Line Segment Visibility with MPI

Master-Worker pattern

Clustering. RNA-seq: What is it good for? Finding Similarly Expressed Genes. Data... And Lots of It!

Parallel K-Means Algorithm for Shared Memory Multiprocessors

Master-Worker pattern

Unsupervised Learning

CSE 494 Project C. Garrett Wolf

Introduction to Artificial Intelligence

Outline. Motivation Parallel k-means Clustering Intel Computing Architectures Baseline Performance Performance Optimizations Future Trends

Array Packing Implementation A Parallel approach. By, Abhishek Cumbakonam Desikan Rajesh Balasubramanian Ramalingam Sankaran Aswin Gokulachandran

Unsupervised Learning

Expectation Maximization!

Cluster Analysis: Agglomerate Hierarchical Clustering

Towards Approximate Computing: Programming with Relaxed Synchronization

CLUSTERING. CSE 634 Data Mining Prof. Anita Wasilewska TEAM 16

Based on Raymond J. Mooney s slides

Unsupervised Data Mining: Clustering. Izabela Moise, Evangelos Pournaras, Dirk Helbing

Clustering. Partition unlabeled examples into disjoint subsets of clusters, such that:

Designing Parallel Programs. This review was developed from Introduction to Parallel Computing

COMP6237 Data Mining Data Mining & Machine Learning with Big Data. Jonathon Hare

Enhancing K-means Clustering Algorithm with Improved Initial Center

Clustering. Chapter 10 in Introduction to statistical learning

CSE494 Information Retrieval Project C Report

Administrative. Machine learning code. Supervised learning (e.g. classification) Machine learning: Unsupervised learning" BANANAS APPLES

Exploiting Parallelism to Support Scalable Hierarchical Clustering

What to come. There will be a few more topics we will cover on supervised learning

Cluster Evaluation and Expectation Maximization! adapted from: Doug Downey and Bryan Pardo, Northwestern University

A Comparative study of Clustering Algorithms using MapReduce in Hadoop

Artificial Bee Colony Algorithm using MPI

Clustering Billions of Images with Large Scale Nearest Neighbor Search

PARALLEL ID3. Jeremy Dominijanni CSE633, Dr. Russ Miller

Unsupervised Learning and Clustering

Parallel Implementation of K-Means on Multi-Core Processors

Parallel Merge Sort Using MPI

A Lightweight OpenMP Runtime

Clustering. CE-717: Machine Learning Sharif University of Technology Spring Soleymani

CSE 5243 INTRO. TO DATA MINING

Chapter 3 Parallel Software

CHAPTER 6 MODIFIED FUZZY TECHNIQUES BASED IMAGE SEGMENTATION

Unsupervised Learning : Clustering

Semi-supervised Clustering

Clustering and Dimensionality Reduction. Stony Brook University CSE545, Fall 2017

Hard clustering. Each object is assigned to one and only one cluster. Hierarchical clustering is usually hard. Soft (fuzzy) clustering

Clustering & Classification (chapter 15)

APPLICATION OF MULTIPLE RANDOM CENTROID (MRC) BASED K-MEANS CLUSTERING ALGORITHM IN INSURANCE A REVIEW ARTICLE

Clustering Results. Result List Example. Clustering Results. Information Retrieval

Performance impact of dynamic parallelism on different clustering algorithms


k-means Clustering David S. Rosenberg April 24, 2018 New York University

Network Traffic Measurements and Analysis

Data Clustering. Algorithmic Thinking Luay Nakhleh Department of Computer Science Rice University

PARALLEL IMPLEMENTATION OF DIJKSTRA'S ALGORITHM USING MPI LIBRARY ON A CLUSTER.

Computational Statistics The basics of maximum likelihood estimation, Bayesian estimation, object recognitions

PLB-HeC: A Profile-based Load-Balancing Algorithm for Heterogeneous CPU-GPU Clusters

Iteration Reduction K Means Clustering Algorithm

Analytical Modeling of Parallel Programs

Introduction to parallel Computing

Application of Spectral Clustering Algorithm

Olmo S. Zavala Romero. Clustering Hierarchical Distance Group Dist. K-means. Center of Atmospheric Sciences, UNAM.

CLUSTERING. JELENA JOVANOVIĆ Web:

Unsupervised Learning and Clustering

Analyzing Outlier Detection Techniques with Hybrid Method

Data Mining Chapter 9: Descriptive Modeling Fall 2011 Ming Li Department of Computer Science and Technology Nanjing University

Clustering Part 4 DBSCAN

ADVANCED MACHINE LEARNING MACHINE LEARNING. Kernel for Clustering kernel K-Means

INF4820, Algorithms for AI and NLP: Evaluating Classifiers Clustering

UNSUPERVISED STATIC DISCRETIZATION METHODS IN DATA MINING. Daniela Joiţa Titu Maiorescu University, Bucharest, Romania

Information Retrieval and Organisation

CHAPTER 4 K-MEANS AND UCAM CLUSTERING ALGORITHM

Accelerated Machine Learning Algorithms in Python

Dr. Chatti Subba Lakshmi

Exploratory Analysis: Clustering

Clustering algorithms

Distributed Computing with MPI

Clustering. Robert M. Haralick. Computer Science, Graduate Center City University of New York

10/14/2017. Dejan Sarka. Anomaly Detection. Sponsors

Introduction to parallel computers and parallel programming. Introduction to parallel computersand parallel programming p. 1

Introduction to Mobile Robotics

Unsupervised Learning. Presenter: Anil Sharma, PhD Scholar, IIIT-Delhi

Parallel Algorithm Design. CS595, Fall 2010

MATH 829: Introduction to Data Mining and Analysis Clustering I

Accelerating K-Means Clustering with Parallel Implementations and GPU computing

Document Clustering: Comparison of Similarity Measures

MPI Optimisation. Advanced Parallel Programming. David Henty, Iain Bethune, Dan Holmes EPCC, University of Edinburgh

DS504/CS586: Big Data Analytics Big Data Clustering Prof. Yanhua Li

Clust Clus e t ring 2 Nov

New Approach for K-mean and K-medoids Algorithm

INF4820. Clustering. Erik Velldal. Nov. 17, University of Oslo. Erik Velldal INF / 22

Improved MapReduce k-means Clustering Algorithm with Combiner

Data Mining. Dr. Raed Ibraheem Hamed. University of Human Development, College of Science and Technology Department of Computer Science

Data Science and Statistics in Research: unlocking the power of your data Session 3.4: Clustering

PuLP. Complex Objective Partitioning of Small-World Networks Using Label Propagation. George M. Slota 1,2 Kamesh Madduri 2 Sivasankaran Rajamanickam 1

COSC6376 Cloud Computing Homework 1 Tutorial

Parallel Implementation of Deep Learning Using MPI

Clustering. Mihaela van der Schaar. January 27, Department of Engineering Science University of Oxford

Transcription:

Parallel K-means Clustering Ajay Padoor Chandramohan Fall 2012 CSE 633

Outline Problem description Implementation MPI Implementation OpenMP Test Results Conclusions Future work

Problem Description Clustering is the task of assigning a set of objects into groups (called clusters) so that the objects in the same cluster are more similar (in some sense or another) to each other than to those in other clusters. As a naïve example: animals can be clustered as land animals, water animals and amphibians. k-means clustering is a method of clustering which aims to partition n data points into k clusters (n >> k) in which each observation belongs to the cluster with the nearest mean. The nearness is calculated by distance function which is mostly Euclidian distance or Manhattan distance. One important assumption to be made is the data points are independent of each other. In other words there exists no dependency between any data points.

Problem Description Sequential Algorithm Given an initial set of k means m 1 (1),,m k (1) (initially k random data points are assigned as K means) where m i is the means of the cluster i. Assignment step: Assign each observation to the cluster with the closest mean Update step: Calculate the new means to be the centroid of the observations in the cluster. Repeat Assignment step and Update step until convergence

Problem Description - Example K points are randomly chosen and taken as means of K sets K clusters are created by associating each point to the set with nearest mean The centroid of each of the k clusters becomes the new mean Repeat until convergence

Problem Description K-means clustering convergence When to stop? A maximum number of iterations has been performed. Fewer than a threshold percentage of data points are reassigned during an iteration. All means migrate less than a threshold distance during an update cycle.

Implementation - MPI Consider N data points each of it is vector and P processors. (1) Assign N/P data points to each processor. (2) Node 0 randomly choose K points and assigns them as cluster means and broadcast. (3) In each processor for each data point find membership using the cluster mean. (4) Recalculate local means for each cluster in each processor. (5) Globally broadcast all local means for each processor find the global mean. (6) Go to step (3) and repeat until the number of iterations > 10000 or number of points where membership has changed is less than 0.1 %.

Implementation-MPI-Example K=2,P = 3,Dataset=[41,42,43,101,102,103] {} = subset [] = membership () = cluster mean Initialization Denotes a node {41,42} [-1,-1] (41,42) {43,101} [-1,-1] (41,42) {102,103} [-1,-1] (41,42)

Implementation-MPI-Example K=2,P = 3,Dataset=[41,42,43,101,102,103] {} = subset [] = membership () = cluster mean Initialization Denotes a node {41,42} [-1,-1] (41,42) {43,101} [-1,-1] (41,42) {102,103} [-1,-1] (41,42) Assignment Step {41,42} [1,2] (41,42) {43,101} [2,2] (41,42) {102,103} [2,2] (41,42)

Implementation-MPI-Example {} = subset [] = membership () = cluster mean Update Centroid, Broadcast and find Global mean {41,42} [1,2] (41,78.2) {43,101} [2,2] (41, 78.2) {102,103} [2,2] (41, 78.2)

Implementation-MPI-Example {} = subset [] = membership () = cluster mean Update Centroid, Broadcast and find Global mean {41,42} [1,2] (41,78.2) {43,101} [2,2] (41, 78.2) {102,103} [2,2] (41, 78.2) Assignment Step {41,42} [1,1] (41,78.2) {43,101} [1,2] (41, 78.2) {102,103} [2,2] (41, 78.2)

Implementation-MPI-Example {} = subset [] = membership () = cluster mean Update Centroid, Broadcast and find Global mean {41,42} [1,1] (42,102) {43,101} [1,2] (41, 102) {102,103} [2,2] (41, 102)

Implementation-MPI-Example {} = subset [] = membership () = cluster mean Update Centroid, Broadcast and find Global mean {41,42} [1,1] (42,102) {43,101} [1,2] (41, 102) {102,103} [2,2] (41, 102) Assignment Step {41,42} [1,1] (42,102) {43,101} [1,2] (41, 102) {102,103} [2,2] (41, 102) EXIT AFTER THIS POINT AS MEMBERSHIP DOESN T CHANGE

Implementation - OpenMP Consider N data points each of it vector and P threads. (1) Node 0 randomly choose K points as assign them as cluster means. (2) In each thread for each data point find membership using the cluster mean. (3) Recalculate local means for each cluster in each thread. (4) Globally broadcast all local means for each processor and find the global mean. (5) Find the global mean in each thread (6) Go to step (2) and repeat until the number of iterations >10000 or number of points where membership has is less than 0.1 %.

Test Results Each data point is 1X100 vector (which can be extended to any size 1XK without changing the code) Used 8 nodes of 8 cores for MPI and 1 node of 32 core for OpenMP Tried for cores 2,4,8,16,32 and 64 for MPI Tried for threads 2,4,8,16 and 32 for OpenMP

Test Results Took an average of 10 runs The number of data points tested were 1000,10000,100000,1000000 In MPI we start taking timings after the I/O operation of data placement into the nodes. I/O operation of data placement is much more than computational time.

Sequential V/s Parallel (MPI)

MPI Results

OpenMP Results

MPI v/s OpenMP

OpenMP Time Test Readings (in sec) Number of threads Number of Data points 2 4 8 16 32 1000 0.0118 0.0087 0.009 0.0066 0.0043 10000 0.1582 0.1234 0.08117 0.0698 0.0407 100000 1.4897 0.9337 0.7925 0.6038 0.3404 1000000 18.7079 9.8705 7.613 5.0962 3.0816

MPI Time Test Readings (in sec) Number of processors Number of Data points 2 4 8 16 32 64 1000 0.03169 0.0178 0.01065 0.00789 0.01886 0.04289 10000 0.35529 0.21173 0.10899 0.05737 0.2346 0.20442 100000 4.06499 2.1171 1.02921 0.53855 0.89992 0.84488 1000000 22.57271 16.41537 8.12979 5.03628 6.03449 4.98651

Speedup with K K refers to number of clusters More iterations occur for convergence More iterations means more communication Speed up decreases as K increases

Conclusions K means clustering is not a problem that can be easily parallelizable as it requires frequent communication between each nodes. We do not get very great speedup in MPI due to communication overhead. OpenMP gives better performance than MPI

Future Work We can use a hybrid of OpenMP and MPI to improve the speed. The loop where each point is assigned membership to right cluster can be threaded in a particular node. Since it is an NP Hard problem we can use a lot of approximation techniques to reduce the number of iterations and increase speedup.

References Algorithms Sequential & Parallel: A Unified Approach Russ Miller and Lawrence Boxer Parallel k-means Clustering for Quantitative Ecoregion Delineation using Large Data Sets Jitendra Kumara, Richard T. Millsa, Forrest M. Homana, William W. Hargroveb Parallel k/h-means Clustering for Large Data Sets - Kilian Stoel and Abdelkader Belkoniene

Questions/Comments