Optimizing Sorting With Genetic Algorithms Xiaoming Li, María Jesús Garzarán, and David Padua University of Illinois at Urbana-Champaign.

Slides:



Advertisements
Similar presentations
Algorithm Design Techniques
Advertisements

Optimizing Matrix Multiplication with a Classifier Learning System Xiaoming Li (presenter) María Jesús Garzarán University of Illinois at Urbana-Champaign.
Representing Hypothesis Operators Fitness Function Genetic Programming
The Study of Cache Oblivious Algorithms Prepared by Jia Guo.
Analysis of Algorithms
Using Parallel Genetic Algorithm in a Predictive Job Scheduling
Parallel Sorting Sathish Vadhiyar. Sorting  Sorting n keys over p processors  Sort and move the keys to the appropriate processor so that every key.
Offline Adaptation Using Automatically Generated Heuristics Frédéric de Mesmay, Yevgen Voronenko, and Markus Püschel Department of Electrical and Computer.
Types of Algorithms.
Parameter control Chapter 8. A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Parameter Control in EAs 2 Motivation 1 An EA has many.
Parameter Control A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Chapter 8.
Chapter 4: Divide and Conquer Master Theorem, Mergesort, Quicksort, Binary Search, Binary Trees The Design and Analysis of Algorithms.
SLIQ: A Fast Scalable Classifier for Data Mining Manish Mehta, Rakesh Agrawal, Jorma Rissanen Presentation by: Vladan Radosavljevic.
Sorting Chapter Sorting Consider list x 1, x 2, x 3, … x n We seek to arrange the elements of the list in order –Ascending or descending Some O(n.
Content Based Image Clustering and Image Retrieval Using Multiple Instance Learning Using Multiple Instance Learning Xin Chen Advisor: Chengcui Zhang Department.
Bitmap Index Buddhika Madduma 22/03/2010 Web and Document Databases - ACS-7102.
Faster Sorting Methods Chapter 9. 2 Chapter Contents Merge Sort Merging Arrays Recursive Merge Sort The Efficiency of Merge Sort Merge Sort in the Java.
Object Recognition Using Genetic Algorithms CS773C Advanced Machine Intelligence Applications Spring 2008: Object Recognition.
Cache effective mergesort and quicksort Nir Zepkowitz Based on: “Improving Memory Performance of Sorting Algorithms” by Li Xiao, Xiaodong Zhang, Stefan.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
S: Application of quicksort on an array of ints: partitioning.
CSC 2300 Data Structures & Algorithms March 20, 2007 Chapter 7. Sorting.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Chapter 8 Physical Database Design. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Overview of Physical Database.
Review Rong Jin. Comparison of Different Classification Models  The goal of all classifiers Predicating class label y for an input x Estimate p(y|x)
Ensemble Learning (2), Tree and Forest
The Group Runtime Optimization for High-Performance Computing An Install-Time System for Automatic Generation of Optimized Parallel Sorting Algorithms.
SPL: A Language and Compiler for DSP Algorithms Jianxin Xiong 1, Jeremy Johnson 2 Robert Johnson 3, David Padua 1 1 Computer Science, University of Illinois.
Genetic Algorithm.
Genetic Algorithms and Ant Colony Optimisation
Cristian Urs and Ben Riveira. Introduction The article we chose focuses on improving the performance of Genetic Algorithms by: Use of predictive models.
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
GATree: Genetically Evolved Decision Trees 전자전기컴퓨터공학과 데이터베이스 연구실 G 김태종.
Sorting with Heaps Observation: Removal of the largest item from a heap can be performed in O(log n) time Another observation: Nodes are removed in order.
Towards Robust Indexing for Ranked Queries Dong Xin, Chen Chen, Jiawei Han Department of Computer Science University of Illinois at Urbana-Champaign VLDB.
Boltzmann Machine (BM) (§6.4) Hopfield model + hidden nodes + simulated annealing BM Architecture –a set of visible nodes: nodes can be accessed from outside.
Lecture 2 Sorting. Sorting Problem Insertion Sort, Merge Sort e.g.,
GENETIC ALGORITHMS FOR THE UNSUPERVISED CLASSIFICATION OF SATELLITE IMAGES Ankush Khandelwal( ) Vaibhav Kedia( )
Indexing.
Neural and Evolutionary Computing - Lecture 9 1 Evolutionary Neural Networks Design  Motivation  Evolutionary training  Evolutionary design of the architecture.
GENETIC ALGORITHM A biologically inspired model of intelligence and the principles of biological evolution are applied to find solutions to difficult problems.
Tuning Before Feedback: Combining Ranking Discovery and Blind Feedback for Robust Retrieval* Weiguo Fan, Ming Luo, Li Wang, Wensi Xi, and Edward A. Fox.
Genetic Algorithms. Evolutionary Methods Methods inspired by the process of biological evolution. Main ideas: Population of solutions Assign a score or.
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis
/ 26 Evolutionary Computing Chapter 8. / 26 Chapter 8: Parameter Control Motivation Parameter setting –Tuning –Control Examples Where to apply parameter.
Evolutionary Computation: Genetic Algorithms Copying ideas of Nature Madhu, Natraj,
 Genetic Algorithms  A class of evolutionary algorithms  Efficiently solves optimization tasks  Potential Applications in many fields  Challenges.
Sorting: Implementation Fundamental Data Structures and Algorithms Klaus Sutner February 24, 2004.
Chapter 12 FUSION OF FUZZY SYSTEM AND GENETIC ALGORITHMS Chi-Yuan Yeh.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Adaptive Sorting “A Dynamically Tuned Sorting Library” “Optimizing Sorting with Genetic Algorithms” By Xiaoming Li, Maria Jesus Garzaran, and David Padua.
Library Generators and Program Optimization David Padua University of Illinois at Urbana-Champaign.
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
A Memory-hierarchy Conscious and Self-tunable Sorting Library To appear in 2004 International Symposium on Code Generation and Optimization (CGO ’ 04)
Database Management Systems, R. Ramakrishnan 1 Algorithms for clustering large datasets in arbitrary metric spaces.
Chapter 4, Part II Sorting Algorithms. 2 Heap Details A heap is a tree structure where for each subtree the value stored at the root is larger than all.
Chapter 9: Sorting1 Sorting & Searching Ch. # 9. Chapter 9: Sorting2 Chapter Outline  What is sorting and complexity of sorting  Different types of.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
19 March More on Sorting CSE 2011 Winter 2011.
Tree and Forest Classification and Regression Tree Bagging of trees Boosting trees Random Forest.
CMPT 238 Data Structures More on Sorting: Merge Sort and Quicksort.
Genetic Algorithm(GA)
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
An Evolutionary Approach
Parameter control Chapter 8.
Evolutionary Computation: Genetic Algorithms
Lecture 4. Niching and Speciation (1)
Parameter control Chapter 8.
Parameter control Chapter 8.
Presentation transcript:

Optimizing Sorting With Genetic Algorithms Xiaoming Li, María Jesús Garzarán, and David Padua University of Illinois at Urbana-Champaign

ESSL on Power3

ESSL on Power4

Outline  Our Solution  Primitives & Selection mechanisms  Genetic Algorithm  Performance results  Classifier System  Conclusion

Motivation  No universally best sorting algorithm  Can we automatically GENERATE and tune sorting algorithms for each platform (such as FFTW and Spiral)? –Performance of sorting on the platform and on the input characteristics.  The algorithm selection may not be enough.

Algorithm Selection (CGO’04)  Select the best algorithm from Quicksort, Multiway Merge Sort and CC-radix.  Relevant input characteristics: number of keys, entropy vector.

Algorithm Selection (CGO’0

Proposed Solution  We need different algorithms for different partitions  The best sorting algorithm should be the result of the composition of the these different best algorithms.  Build Composite Sorting algorithms –Identify primitives from the sorting algorithms –Design a general method to select an appropriate sorting primitive at runtime –Design a mechanism to combine the primitives and the selection methods to generate the composite sorting algorithm

Outline  Our Solution  Primitives & Selection mechanisms  Genetic Algorithm  Performance results  Classifier System  Conclusion

Sorting Primitives  Divide-by-Value –A step in Quicksort –Select one or multiple pivots and sort the input array around these pivots –Parameter: number of pivots  Divide-by-Position (DP) –Divide input into same-size sub-partitions –Use heap to merge the multiple sorted sub-partitions –Parameters: size of sub-partitions, fan-out and size of the heap

Sorting Primitives  Divide-by-Radix (DR) –Non-comparison based sorting algorithm –Parameter: radix (r bits) –Step 1: Scan the input to get distribution array, which records how many elements in each of the 2 r sub-partitions. –Step 2: Compute the accumulative distribution array, which is used as the indexes when copying the input to the destination array. –Step 3: Copy the input to the 2 r sub-partitions counter accum.dest src

Sorting Primitives  Divide-by-radix-assuming-uniform-distribution (DU) –Step 1 and Step 2 in DR are expensive. –If the input elements are distributed among 2 r sub-partitions near evenly, the input can be copied into the destination array directly assuming every partition have the same number of elements. –Overhead: partition overflow –Parameter: radix (r bits) accum.dest.src

Selection Primitives Branch-by-Size Branch-by-Entropy –Parameter: number of branches, threshold vector of the branches

Leaf Primitives  When the size of a partition is small, we stick to one algorithm to sort the partition fully.  Two methods are used in the cleanup operation –Quicksort –CC-Radix

Composite Sorting Algorithms The composite sorting algorithms are built from these primitives. The algorithms have shapes of tree.

Outline  Our Solution  Primitives & Selection mechanisms  Genetic Algorithm  Performance results  Classifier System  Conclusion

Search Strategy  Search the best tree  Search the best parameter values of the primitives –Good solutions for small size problem should be retained to use in the solution for larger problem.  Genetic algorithms are a natural solution that satisfy the requirements: –Preserve good sub-trees –Give good sub-trees more chances to propagate

Composite Sorting Algorithms Search the best parameter values to adapt –To the architectural features –To the input characteristics

Search Strategy  Search for the best tree  Search for the best parameter values of the primitives –Good solutions for small size problem should be retained to use in the solution for larger problem.  Genetic algorithms are a natural solution that satisfy the requirements: –Preserve good sub-trees –Give good sub-trees more chances to propagate

Genetic Algorithm Mutation –Mutate the structure of the algorithm. –Change the parameter values of primitives.

Crossover Propagate good sub-trees

Fitness Function  A fitness function measures the relative performance of the genomes in a population.  The average performance of a genome on the training inputs is the base for the fitness of the genome.  A genome which performs well across inputs is preferred –fitness is penalized when performance varies across the test inputs

Library Generation  Installation phase: Use genetic algorithm to search for the sorting genome. –Set of genomes in initial population –Test the genomes in a set of inputs with different characteristics

Outline  Our Solution  Primitives & Selection mechanisms  Genetic Algorithm  Performance results  Classifier System  Conclusion

Platforms  AMD Athlon MP  Sun UltraSparcIII  SGI R12000  IBM Power3  IBM Power4  Intel Itanium2  Intel Xeon

AMD Athlon MP

Power3

Multiple-peak Performance

Outline  Our Solution  Primitives & Selection mechanisms  Genetic Algorithm  Performance results  Classifier System  Conclusion

The best genomes in different regions

Problems of Genetic Adaptation  Fitness function is the average performance of the genome on the test inputs.  Fitness function in our genetic algorithm prefers genomes with stable performance  The genetic algorithm is not powerful enough to evolve into the complex genome which chooses the best genome in each small region

Using Classifier System  Search the best genomes for different regions of the input characteristics. –Selects the regions –Selects the best algorithm for each region  Nice feature: The fitness of a genomes in a region will not be affected by its fitness in other regions

Map sorting composition into a classifier system  The input characteristics (number of keys and entropy vector) are encoded into bit strings.  A rule in the classifier system has two parts –Condition: A string consisting of ‘0’, ‘1’, and ‘*’. Condition string will be used to match the encoded input characteristics. –Action: Sorting genomes without branch primitives

Example for Classifier Sorting Example: –For inputs of up-to 16M keys –Encode number of keys with 4 bits. 0000: 0~1M, 0001: 1~2M… Number of keys = 10.5M. Encoded into “1100” ConditionActionFitnessAccuracy (dr 5 (lq 1 16)) …… (dp 4 2 ( lr 5 16)) …… …… ** *(dv 2 ( lr 6 16))

Performance of Classifier Sorting Power3

Power4

Conclusions  Replace the complexity of finding an efficient algorithm with the task of defining a set of generic primitives.  Design methods to search in the space of the composition of the primitives. Genetic algorithms Classifier system