An automatically-tuned sorting library

  • Authors:
  • Eran Bida;Sivan Toledo

  • Affiliations:
  • School of Computer Science, Tel-Aviv University, Tel-Aviv 69978, Israel;School of Computer Science, Tel-Aviv University, Tel-Aviv 69978, Israel

  • Venue:
  • Software—Practice & Experience
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present ATSL, an automatically-tuned sorting library. ATSL generates a sorting routine optimized to the target machine for a specific data type. ATSL finds a high-performance sorting routine by searching an algorithmic space that we have defined. The search space includes basic sorting algorithms and automatically-generated compositions of sorting algorithms. Performance measurements are used both for ranking candidate algorithms and for characterizing the behavior of candidates in specific settings (e.g. ranges of input sizes). These characterizations allow ATSL to generate hybrid algorithms that intelligently exploit the strengths of particular algorithms, such as high speed at specific input-size ranges. Many sorting algorithms can be tuned using numeric parameters and ATSL searches these parameter spaces to find values that yield high performance on the target machine. The building blocks from which ATSL synthesizes sorting algorithms include adaptations of many of the most effective hand-tuned sorting routines, including several that are tuned for cache efficiency. An extensive experimental evaluation shows that ATSL generates high-performance codes that are well tuned for the target machine and data type. The experiments were conducted on six different machines, of several architectures, and with three different compilers. The algorithms that are generated are fast; in particular, they beat the hand-tuned building blocks and the compiler's C++ built-in sorting routine. The algorithms that ATSL generates on different machines and using different compilers are different from each other. Copyright © 2007 John Wiley & Sons, Ltd.