DOI QR코드

DOI QR Code

An Implementation of Efficient Quicksort Utilizing SIMD-Based VBP Technique

SIMD 기반의 VBP 기법을 적용한 효율적인 퀵정렬의 구현

  • 홍길석 (한국기술교육대학교 컴퓨터공학과) ;
  • 김홍연 (한국기술교육대학교 컴퓨터공학과) ;
  • 강성현 (한국기술교육대학교 컴퓨터공학과) ;
  • 민준기 (한국기술교육대학교 컴퓨터공학과)
  • Received : 2017.03.06
  • Accepted : 2017.05.27
  • Published : 2017.08.15

Abstract

SIMD (Single Instruction Multiple Data) is a representative parallelization architecture that processes multiple data loaded in a SIMD register with a single instruction. Quicksort is a sorting algorithm that picks an element as a pivot from the array and reorders the array such that all elements having the values less than the pivot value are located in the left side on the pivot as well as all elements having the value greater than the pivot value are located in the right side on the pivot and then the algorithm performs the same task on both sublist recursively. In this paper, we propose an efficient Quicksort algorithm applying the SIMD instructions which minimally invokes conditional branches to avoid the performance degradation incurred by branch misprediction in a pipeline architecture. In addition, we improve the performance of the Quicksort algorithm by fetching data into a SIMD register as a byte unit to apply VBP (Vertical Bit Parallel) and the early pruning technique.

SIMD(Single Instruction Multiple Data)는 대표적인 병렬화 아키텍처 중 하나로, SIMD 레지스터에 적재된 여러 개의 데이터들을 하나의 명령어로 처리하는 기술이다. 퀵정렬(Quicksort)은 데이터 값들이 리스트로 저장되어 있을 때, 임의의 위치에 있는 데이터 값을 피봇으로 하여 그것보다 작은 값은 왼편으로, 큰 값은 오른편으로 분할하여 생성된 두 개의 서브리스트에 대하여 같은 작업을 반복함으로써 데이터 값들을 정렬하는 정렬 알고리즘이다. 본 연구에서는 SIMD 명령어를 이용하여 파이프라인 아키텍처에서 조건 예측 실패에 따른 성능 저하를 유발하지 않도록 분기 조건을 최소로 사용하는 효율적인 퀵정렬(Quicksort) 알고리즘을 제안한다. 또한, VBP(Vertical Bit Parallel) 기법과 얼리 프루닝(early pruning) 기법을 적용하여 SIMD 레지스터에 데이터를 바이트 단위로 적재함으로써 퀵 정렬 알고리즘의 성능을 향상하였다.

Keywords

Acknowledgement

Grant : 대규모 트랜잭션 처리와 실시간 복합 분석을 통합한 일체형 데이터 엔지니어링 기술 개발

Supported by : 정보통신기술진흥센터, 한국연구재단

References

  1. Polychroniou, Orestis, and Kenneth A. Ross, "Vectorized Bloom filters for advanced SIMD processors," Proc. of the Tenth International Workshop on Data Management on New Hardware. ACM, p. 6, 2014.
  2. J. Zhou and K. A. Ross, "Implementing Database Operations Using SIMD Instructions," Proc. of ACM SIGMOD, pp. 145-156, 2002.
  3. Fuguo, Dong, Fan Hui, and Yuan Da, "A novel image median filtering algorithm based on incomplete quick sort algorithm," International Journal of Digital Content Technology and its Applications, Vol. 4, No. 6, 2010.
  4. Sanders, Peter, and Sebastian Winkel, "Super scalar sample sort," European Symposium on Algorithms, Springer Berlin Heidelberg, pp. 784-796, Sep. 2004.
  5. Cedeman, Daniel, and Philippas Tsigas, "Gpuquicksort: A practical quicksort algorithm for graphics processors," Journal of Experimental Algorithmics (JEA), Vol. 14, No. 4, 2009.
  6. C.A.R Hoare, "Quicksort," The Computer Journal, Vol. 5, No. 1, pp. 10-16, 1692. https://doi.org/10.1093/comjnl/5.1.10
  7. Gueron, Shay, and Vlad Krasnov, "Fast quicksort implementation using AVX instructions," The Computer Journal, Vol. 59, No. 1, pp. 83-90, 2016. https://doi.org/10.1093/comjnl/bxv063
  8. Yinan Li, Jignesh M. Patel, "BitWeaving: Fast Scans for Main Memory Data Processing," Proc. ACM SIGMOD Int. Conf. Mang. Data, pp. 289-300, 2013.
  9. Kaligosi, Kanela, and Peter Sanders, "How branch mispredictions affect quicksort," European Symposium on Algorithms. Springer Berlin Heidelberg, pp. 780-791, 2006.