Skip to main content
QUICK REVIEW

[Paper Review] Fast Sorting Algorithms using AVX-512 on Intel Knights Landing

Bérenger Bramas|arXiv (Cornell University)|Apr 24, 2017
Parallel Computing and Optimization TechniquesComputer Science18 citations
TL;DR

This paper presents a high-performance, in-place sorting algorithm optimized for Intel Knights Landing using AVX-512 instructions. It combines a branch-free Bitonic sort for small subarrays with a vectorized partitioning kernel to accelerate Quicksort, achieving up to 4x speedup over GNU C++ std::sort across integer and double-precision data types.

ABSTRACT

This paper describes fast sorting techniques using the recent AVX-512 instruction set. Our implementations benefit from the latest possibilities offered by AVX-512 to vectorize a two-parts hybrid algorithm: we sort the small arrays using a branch-free Bitonic variant, and we provide a vectorized partitioning kernel which is the main component of the well-known Quicksort. Our algorithm sorts in-place and is straightforward to implement thanks to the new instructions. Meanwhile, we also show how an algorithm can be adapted and implemented with AVX-512. We report a performance study on the Intel KNL where our approach is faster than the GNU C++ sort algorithm for any size in both integer and double floating-point arithmetics by a factor of 4 in average.

Motivation & Objective

  • To design a fast, in-place sorting algorithm leveraging the latest AVX-512 instruction set on Intel Knights Landing.
  • To improve performance of Quicksort by vectorizing the partitioning phase using AVX-512 instructions.
  • To enable efficient sorting of small subarrays using a branch-free Bitonic sorting network tailored for AVX-512.
  • To demonstrate practical, straightforward implementation of advanced vectorized sorting techniques on modern x86-64 processors.

Proposed method

  • The algorithm uses a hybrid approach: small subarrays are sorted with a branch-free Bitonic sort variant optimized for 512-bit registers.
  • A vectorized partitioning kernel is implemented using AVX-512 instructions to process 16 integers or doubles per instruction-level operation.
  • The partitioning kernel enables efficient in-place sorting by leveraging gather-scatter and compare-and-swap operations in AVX-512.
  • The overall Quicksort framework uses the vectorized partitioning kernel to reduce data movement and improve instruction-level parallelism.
  • The implementation avoids complex memory access patterns and relies on AVX-512's wide registers and advanced control instructions for performance.

Experimental results

Research questions

  • RQ1How can AVX-512 instructions be effectively used to accelerate the partitioning phase of Quicksort?
  • RQ2To what extent can a branch-free Bitonic sort be optimized for 512-bit vector units on modern x86-64 processors?
  • RQ3Can a hybrid sorting approach combining vectorized partitioning and small-array Bitonic sorting outperform standard library implementations?
  • RQ4What is the performance gain of AVX-512-optimized sorting over GNU C++ std::sort on Intel Knights Landing across different data types?

Key findings

  • The proposed AVX-512-optimized sorting algorithm achieves an average performance speedup of 4x over GNU C++ std::sort on Intel Knights Landing.
  • The algorithm outperforms GNU C++ std::sort for all input sizes in both integer and double-precision floating-point sorting workloads.
  • The vectorized partitioning kernel significantly reduces the number of memory accesses and improves instruction-level parallelism.
  • The branch-free Bitonic variant for small subarrays reduces pipeline stalls and improves cache efficiency on AVX-512-enabled processors.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.