Sorting, Searching, and Simulation in the MapReduce Framework Michael T. Goodrich Dept. of Computer Science.

Slides:



Advertisements
Similar presentations
Parallel Algorithms.
Advertisements

MAP REDUCE PROGRAMMING Dr G Sudha Sadasivam. Map - reduce sort/merge based distributed processing Best for batch- oriented processing Sort/merge is primitive.
PRAM Algorithms Sathish Vadhiyar. PRAM Model - Introduction Parallel Random Access Machine Allows parallel-algorithm designers to treat processing power.
MapReduce.
SkewReduce YongChul Kwon Magdalena Balazinska, Bill Howe, Jerome Rolia* University of Washington, *HP Labs Skew-Resistant Parallel Processing of Feature-Extracting.
LIBRA: Lightweight Data Skew Mitigation in MapReduce
Optimal PRAM algorithms: Efficiency of concurrent writing “Computer science is no more about computers than astronomy is about telescopes.” Edsger Dijkstra.
Lecture 3: Parallel Algorithm Design
A Model of Computation for MapReduce
Seunghwa Kang David A. Bader Large Scale Complex Network Analysis using the Hybrid Combination of a MapReduce Cluster and a Highly Multithreaded System.
Advanced Algorithms Piyush Kumar (Lecture 12: Parallel Algorithms) Welcome to COT5405 Courtesy Baker 05.
Cloud Computing Resource provisioning Keke Chen. Outline  For Web applications statistical Learning and automatic control for datacenters  For data.
PRAM (Parallel Random Access Machine)
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
TECH Computer Science Parallel Algorithms  several operations can be executed at the same time  many problems are most naturally modeled with parallelism.
Advanced Topics in Algorithms and Data Structures Lecture pg 1 Recursion.
Slide 1 Parallel Computation Models Lecture 3 Lecture 4.
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
Accelerated Cascading Advanced Algorithms & Data Structures Lecture Theme 16 Prof. Dr. Th. Ottmann Summer Semester 2006.
ACL, June Pairwise Document Similarity in Large Collections with MapReduce Tamer Elsayed, Jimmy Lin, and Douglas W. Oard University of Maryland,
Ivory : Ivory : Pairwise Document Similarity in Large Collection with MapReduce Tamer Elsayed, Jimmy Lin, and Doug Oard Laboratory for Computational Linguistics.
Google’s Map Reduce. Commodity Clusters Web data sets can be very large – Tens to hundreds of terabytes Standard architecture emerging: – Cluster of commodity.
1 External Sorting for Query Processing Yanlei Diao UMass Amherst Feb 27, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Parallel K-Means Clustering Based on MapReduce The Key Laboratory of Intelligent Information Processing, Chinese Academy of Sciences Weizhong Zhao, Huifang.
1 Lecture 3 PRAM Algorithms Parallel Computing Fall 2008.
Advanced Topics in Algorithms and Data Structures 1 Two parallel list ranking algorithms An O (log n ) time and O ( n log n ) work list ranking algorithm.
Basic PRAM algorithms Problem 1. Min of n numbers Problem 2. Computing a position of the first one in the sequence of 0’s and 1’s.
Complexity Classes Kang Yu 1. NP NP : nondeterministic polynomial time NP-complete : 1.In NP (can be verified in polynomial time) 2.Every problem in NP.
1 Lecture 2: Parallel computational models. 2  Turing machine  RAM (Figure )  Logic circuit model RAM (Random Access Machine) Operations supposed to.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 8, 2005 Session 8.
Zois Vasileios Α. Μ :4183 University of Patras Department of Computer Engineering & Informatics Diploma Thesis.
Ahsanul Haque *, Swarup Chandra *, Latifur Khan * and Michael Baron + * Department of Computer Science, University of Texas at Dallas + Department of Mathematical.
Data Structures for Orthogonal Range Queries A New Data Structure and Comparison to Previous Work. Application to Contact Detection in Solid Mechanics.
Pairwise Document Similarity in Large Collections with MapReduce Tamer Elsayed, Jimmy Lin, and Douglas W. Oard Association for Computational Linguistics,
Outline  introduction  Sorting Networks  Bubble Sort and its Variants 2.
Chapter 11 Indexing & Hashing. 2 n Sophisticated database access methods n Basic concerns: access/insertion/deletion time, space overhead n Indexing 
Parallel Suffix Array Construction by Accelerated Sampling Matthew Felice Pace University of Warwick Joint work with Alexander Tiskin University of Warwick.
-1.1- Chapter 2 Abstract Machine Models Lectured by: Nguyễn Đức Thái Prepared by: Thoại Nam.
1 Lectures on Parallel and Distributed Algorithms COMP 523: Advanced Algorithmic Techniques Lecturer: Dariusz Kowalski Lectures on Parallel and Distributed.
RAM, PRAM, and LogP models
Bulk Synchronous Processing (BSP) Model Course: CSC 8350 Instructor: Dr. Sushil Prasad Presented by: Chris Moultrie.
Parallel Algorithms. Parallel Models u Hypercube u Butterfly u Fully Connected u Other Networks u Shared Memory v.s. Distributed Memory u SIMD v.s. MIMD.
06/12/2015Applied Algorithmics - week41 Non-periodicity and witnesses  Periodicity - continued If string w=w[0..n-1] has periodicity p if w[i]=w[i+p],
Department of Computer Science MapReduce for the Cell B. E. Architecture Marc de Kruijf University of Wisconsin−Madison Advised by Professor Sankaralingam.
Data Structures and Algorithms in Parallel Computing Lecture 2.
CS4432: Database Systems II Query Processing- Part 2.
Chapter 5 Ranking with Indexes 1. 2 More Indexing Techniques n Indexing techniques:  Inverted files - best choice for most applications  Suffix trees.
Data Structures and Algorithms in Parallel Computing Lecture 1.
Winter 2014Parallel Processing, Fundamental ConceptsSlide 1 2 A Taste of Parallel Algorithms Learn about the nature of parallel algorithms and complexity:
Bijective tree encoding Saverio Caminiti. 2 Talk Outline Domains Prüfer-like codes Prüfer code (1918) Neville codes (1953) Deo and Micikevičius code (2002)
HYPERCUBE ALGORITHMS-1
MapReduce Basics Chapter 2 Lin and Dyer & /tutorial/
3/12/2013Computer Engg, IIT(BHU)1 PRAM ALGORITHMS-3.
Item Based Recommender System SUPERVISED BY: DR. MANISH KUMAR BAJPAI TARUN BHATIA ( ) VAIBHAV JAISWAL( )
Lecture 3: Parallel Algorithm Design
Data Driven Resource Allocation for Distributed Learning
Interquery Parallelism
Lecture 2: Parallel computational models
Course Description Algorithms are: Recipes for solving problems.
PRAM Algorithms.
Data Structures and Algorithms in Parallel Computing
Lecture#12: External Sorting (R&G, Ch13)
Parallel Algorithms for Geometric Graph Problems
Lecture 5 PRAM Algorithms (cont.)
CSE838 Lecture notes copy right: Moon Jung Chung
Chapter 11 Limitations of Algorithm Power
Parallel Algorithms A Simple Model for Parallel Processing
Course Description Algorithms are: Recipes for solving problems.
Chapter 2 Lin and Dyer & MapReduce Basics Chapter 2 Lin and Dyer &
Bin Packing Michael T. Goodrich Some slides adapted from slides from
Presentation transcript:

Sorting, Searching, and Simulation in the MapReduce Framework Michael T. Goodrich Dept. of Computer Science

MapReduce A framework for designing computations for large clusters of computers. Decouples location from data and computation Image from taken from Yahoo! Hadoop Presentation: Part 2, OSCON 2007.

Map-Shuffle-Reduce Map: (k,v) -> [(k 1,v 1 ),(k 2,v 2 ),…] must depend only on this one pair, (k,v) Shuffle: For each key k used in the first coordinate of a pair, collect all pairs with k as first coordinate [(k,v 1 ),(k,v 2 ),…] Reduce: For each list, [(k,v 1 ),(k,v 2 ),…]: Perform a sequential computation to produce a set of pairs, [(k’ 1,v’ 1 ),(k’ 2,v’ 2 ),…] Pairs from this reduce step can be output or used in another map-shuffle-reduce cycle. Image from

A Simple Example Count number of occurrences of each word in a large document or corpus –Map: (word,null) -> (word,1) –Shuffle: groups occurrences of each word –Reduce: count number of 1’s in each list This has one round of computation, but can take a long time (e.g., 7% of all English words are “the”). Image from

Evaluating MapReduce Algorithms If map/reduce time is dominated by a buffer-size, B, parallelism is increased. –So time is dominated by number of rounds and message complexity –Eliminates false efficiency of the trivial one- round algorithm similar approaches were used by –[Feldman et al., 08], who choose B=polylog(n) –[Karloff et al., 10], who choose B=n 1-  –We choose B=n 1/k, for a given integer parameter, k>0, to allow for a spectrum of possible buffer sizes, e.g., k=2, 3, or 4 would be natural for real-world problem instances

Our Results Label a set of inputs from 1..N in O(k) rounds Simulate any bulk-synchronous parallel (BSP) algorithm with constant overhead –extends constant-overhead EREW PRAM simulation of [Karloff et al., 10] Simulate any CRCW PRAM algorithm with an overhead of O(k) per PRAM step Applications: sorting, 2-d/3-d convex hulls, fixed-d linear programming in O(k) rounds Perform multisearching of a tree of size n with n searches

Invisible B-Trees Define a B-tree labeling, (L,i), where L is a level and i is an index. Each node knows its parent-node label and its children labels Perform a top-down or bottom-up computation in such a tree, automatically ignoring missing nodes. Image from

4,25 4,26 4,21 4,19 4,13 4,15 4,5 4,4 4,3 4,1 4,7 Invisible B-Trees Allows for tree-based computations that utilize only the necessary nodes. 1,1 3,3 2,3 2,2 3,2 2,1 3,1 3,6 3,5 3,4 3,9 3,8 3,7 4,2 4,8 4,6 4,27 4,20 4,14 4,9

Index-Labeling the Input B-ary distribute-and-combine: 1.Assign each pair a random value from 1 to N 3 2.Apply invisible B-tree technique to perform a bottom-up sum (with each tuple worth 1) 3.Perform a top-down prefix sum computation Now the pairs are numbered 1 to N. Takes O(log B N) = O(k) rounds. Image from

BSP Simulation Each super-step involves sending/receiving B messages. To simulate: 1.Create a tuple for each memory cell and processor 2.Map each message to the destination processor label, P. 3.Reduce by performing one step of processor P, outputting the messages for next round. Theorem: Given a BSP algorithm A that runs in T super- steps with a total memory size N using P < N processors, we can simulate A using T rounds and message complexity O(TM) in the memory-bound MapReduce framework with reducer buffer size bounded by B = N/P and total memory size M. Some implications…

MapReduce Sorting Given the optimal BSP algorithm of [Goodrich, 99], we can sort N values in the MapReduce framework in O(k) rounds and O(kN) message complexity. Image from

MapReduce Convex Hulls Given BSP algorithms of [Goodrich, 97], we can do 2-d and 3- convex hulls in O(k) rounds, w.h.p., with message complexity O(kN). Image from

CRCW PRAM Simulation Create tuples for memory cells and processors. For each memory access, use an invisible B-tree to map read/write requests to the memory cells and back to the processors. –Allows us to simulate even the most powerful version of the CRCW PRAM, where writes are combined according to an associative function Theorem: Given an algorithm A in the CRCW PRAM model, with write conflicts resolved according to a commutative semigroup function, f, such that A runs in T steps using P processors and N memory cells, we can simulate A in the memory-bound MapReduce framework in O(kT) rounds and O(kT(N + P)) message complexity, where k=O(log B P). Image from

Fixed-d Linear Programming [Alon and Meggido, 94] give a constant- time CRCW PRAM algorithm for fixed-d linear programming w.h.p. This gives us a MapReduce algorithm running in time O(k) w.h.p. Image from

Multisearching Given: a binary tree T of size n and a set Q of n queries to perform on T. T: Q={q 1,q 2,…,q n } [Goodrich 97] gives a BSP solution, but it would require O(n log2 n) message complexity to simulate it in the MapReduce framework.

Pipelined Multisearching Break Q into k random groups of size n/k each. Sample from Q 1 to get an estimate of the query distribution. Build the circuit of [Goodrich 97] for Q1. Pipeline all the queries through this circuit. Total time O(k). Message complexity: O(kn)

Conclusion and Open Problems We have given a general way of analyzing MapReduce algorithms and some techniques: –the invisible B-tree –index labeling –BSP simulation –CRCW simulation –multi-searching Other problems: –Sparse graph problems? Image from B-tree