1 / 29

Quicksort Algorithm on GPU

Quicksort Algorithm on GPU. Team #11 Kha Man Hieu Nguyen. Introduction. Quicksort is one of the fastest sorting algorithms in practice on CPU but it is not considered an efficient sorting solution on GPU  GOAL: Achieve a high Quicksort performance on GPU. Introduction. IMPORTANT.

Download Presentation

Quicksort Algorithm on GPU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Quicksort Algorithm on GPU Team #11 Kha Man Hieu Nguyen

  2. Introduction • Quicksort is one of the fastest sorting algorithms in practice on CPU but it is not considered an efficient sorting solution on GPU  GOAL: Achieve a high Quicksort performance on GPU Quicksort Algorithm on GPU

  3. Introduction IMPORTANT Quicksort Algorithm on GPU

  4. What is GPU • A graphics processing unit (GPU), also occasionally called visual processing unit (VPU), is a specialized electronic circuit designed to rapidly manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display (Wikipedia) Quicksort Algorithm on GPU

  5. Quicksort Algorithm on GPU

  6. CPU vs GPU Quicksort Algorithm on GPU

  7. An example of CUDA Hardware model Quicksort Algorithm on GPU

  8. An example of CUDA Hardware model Warp is a group of threads perform the same instructions concurrently Quicksort Algorithm on GPU

  9. An example of CUDA Hardware model Quicksort Algorithm on GPU

  10. An example of CUDA Hardware model Synchronization Quicksort Algorithm on GPU

  11. An example of CUDA Hardware model Two warps cannot execute simultaneously on a single multiprocessor Quicksort Algorithm on GPU

  12. An example of CUDA Hardware model Quicksort Algorithm on GPU

  13. Quicksort algorithm Quicksort Algorithm on GPU

  14. In-place version Quicksort Algorithm on GPU

  15. Problems with in-place version • GPUs have limited cache memory. • Expensive thread synchronization when the number of threads is huge. Quicksort Algorithm on GPU

  16. GPU Quicksort • Phase One • Sequences divided • Block synchronization on the CPU Thread Block 1 Thread Block 2 Quicksort Algorithm on GPU

  17. Quicksort • Phase Two • Each block is assigned own sequence • Run entirely on GPU Thread Block 1 Thread Block 2 Quicksort Algorithm on GPU

  18. Quicksort – Phase One 2 2 0 7 4 9 3 3 3 7 8 4 8 7 2 5 0 7 6 3 4 2 9 8 Quicksort Algorithm on GPU

  19. Quicksort – Phase One 2 2 0 7 4 9 3 3 3 7 8 4 8 7 2 5 0 7 6 3 4 2 9 8 • AssignThread Blocks Quicksort Algorithm on GPU

  20. Quicksort – Phase One 2 2 0 7 4 9 3 3 3 7 8 4 8 7 2 5 0 7 6 3 4 2 9 8 • Uses an auxiliaryarray Quicksort Algorithm on GPU

  21. Quicksort – Synchronization 2 2 0 7 4 9 3 3 3 7 8 4 8 7 2 5 0 7 6 3 4 2 9 8 LeftPointer = 0 1 Thread Block ONE Fetch-And-Add on LeftPointer 0 Thread Block TWO Quicksort Algorithm on GPU

  22. Quicksort – Synchronization 2 2 0 7 4 9 3 3 3 7 8 4 8 7 2 5 0 7 6 3 4 2 9 8 3 2 LeftPointer = 2 2 Thread Block ONE Fetch-And-Add on LeftPointer 3 Thread Block TWO Quicksort Algorithm on GPU

  23. Quicksort – Synchronization 2 2 0 7 4 9 3 3 37 8 4 8 7 2 5 0 7 6 3 4 2 9 8 3 2 2 3 LeftPointer = 4 5 Thread Block ONE Fetch-And-Add on LeftPointer 4 Thread Block TWO Quicksort Algorithm on GPU

  24. Quicksort – Synchronization 2 2 0 7493 3 3 7 848 7 2 5 0 7 6 3 4 2 9 8 3 2 2 3 3 0 2 0 3 2 7 9 7 8 8 7 5 7 6 9 8 LeftPointer = 10 Quicksort Algorithm on GPU

  25. Quicksort – Synchronization 2 2 0 7 4 9 3 3 3 7 8 4 8 7 2 5 0 7 6 3 4 2 9 8 3 2 2 3 3 0 2 0 3 2 4 4 4 7 9 7 8 8 7 5 7 6 9 8 Quicksort Algorithm on GPU

  26. Two Pass Partitioning 2 2 0 7 4 9 3 3 3 7 8 4 8 7 2 5 0 7 6 3 4 2 9 8 < < < < < < < < < < = = = > > > > > > > > > > > = = = Quicksort Algorithm on GPU

  27. Implementation plan • We will implement the GPU quicksort algorithm on our Hydra server, observe and analyze the result to see the improvement Quicksort Algorithm on GPU

  28. References • D. Cederman and P. Tsigas, “A practical quicksort algorithm for graphic processors,” in Proc. 16th Annual European Symposium on Algorithms (ESA 2008), Sep. 2008, pp. 246-258. • E. Sintorn and U. Assarsson. Fast parallel gpu-sorting using a hybrid algorithm. Journal of Parallel and Distributed Computing, 68(10):1381 - 1388, 2008. General-Purpose Processing using Graphics. • Processing Units D. Cederman and P. Tsigas, “On sorting and load balancing on GPUs,” in Proc. SIGARCH Comput. Archit.News,36:11–18, 2009 • N. K. Govindaraju, J. Gray, R. Kumar, and D. Manocha, “ GPUTeraSort: High performance graphics coprocessor sorting for large database management,” in Proceedings of the 2006 ACM SIGMOD International Conference on Management of Data, pages 325-336, June 2006. Quicksort Algorithm on GPU

  29. Question? Quicksort Algorithm on GPU

More Related