Abstract
Efficient parallel implementations of various sorting algorithms on modern hardware platforms are essential to numerous application areas. In this paper, we first measure the performance of the leading segmented sort implementation on CUDA-enabled GPUs and determine optimal setups using the resulting runtimes. Subsequently, we propose a number of changes that improve efficiency for segments of specific lengths. Furthermore, an alternative key-only version is introduced, that is specifically optimized to just sort keys instead of key-value pairs, which allows for further optimization. Performance is evaluated by comparing runtimes of the original algorithm with our improved version for segments of different lengths resulting in average speedups between 1.26 and 1.35 on four GPUs of different generations (Pascal, Volta, Ampere, Ada Lovelace). Furthermore, comparison to alternative segmented sort implementations from CUB and ModernGPU results in average speedups of at least 2.2 and 2.5, respectively, across all tested architectures. To illustrate how our improved sorting algorithm can be beneficial in a practical application, we have integrated it into the MetaCache-GPU pipeline for metagenomic DNA classification resulting in speedups of up to 25.6% for the sorting step. Code is publicly available at
https://gitlab.rlp.net/pararch/faster-segmented-sort-on-gpus.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Arkhipov, D.I., Wu, D., Li, K., Regan, A.C.: Sorting with GPUs: a survey. arXiv preprint arXiv:1709.02520 (2017)
Baxter, S.: ModernGPU: Patterns and behaviors for GPU computing (2016). https://github.com/moderngpu/moderngpu
Büren, F., Jünger, D., Kobus, R., Hundt, C., Schmidt, B.: Suffix array construction on multi-GPU systems. In: Proceedings of the 28th International Symposium on High-Performance Parallel and Distributed Computing, pp. 183–194 (2019)
Dalton, S., Bell, N., Olson, L., Garland, M.: CUSP: A C++ Templated Sparse Matrix Library (2015). http://cusplibrary.github.io/
Flick, P., Aluru, S.: Parallel distributed memory construction of suffix and longest common prefix arrays. In: International Conference for High Performance Computing, Networking, Storage and Analysis, SC 2015, Austin, TX, USA, pp. 16:1–16:10 (2015)
Graefe, G.: Implementing sorting in database systems. ACM Comput. Surv. (CSUR) 38(3), 10-es (2006)
Gu, Y., He, Y., Fatahalian, K., Blelloch, G.: Efficient BVH construction via approximate agglomerative clustering. In: Proceedings of the 5th High-Performance Graphics Conference, pp. 81–88 (2013)
Hou, K., Liu, W., Wang, H., Feng, W.C.: Fast Segmented sort on GPUs. In: Proceedings of the International Conference on Supercomputing, pp. 1–10 (2017)
Kobus, R., Müller, A., Jünger, D., Hundt, C., Schmidt, B.: MetaCache-GPU: ultra-fast metagenomic classification. In: 50th International Conference on Parallel Processing, pp. 1–11 (2021)
Kobus, R., Nelgen, J., Henkys, V., Schmidt, B.: Artifact for euro-par 2023 paper: “faster segmented sort on GPUs’’. Figshare (2023). https://doi.org/10.6084/m9.figshare.23540553
Leischner, N., Osipov, V., Sanders, P.: GPU sample sort. In: 2010 IEEE International Symposium on Parallel & Distributed Processing (IPDPS), pp. 1–10. IEEE (2010)
Liu, W., Vinter, B.: A framework for general sparse matrix-matrix multiplication on GPUs and heterogeneous processors. J. Parallel Distrib. Comput. 85, 47–61 (2015)
NVIDIA: CUB: Cooperative primitives for CUDA C++ (2021). https://nvlabs.github.io/cub/
Satish, N., Harris, M., Garland, M.: Designing efficient sorting algorithms for manycore GPUs. In: 2009 IEEE International Symposium on Parallel & Distributed Processing, pp. 1–10. IEEE (2009)
Schmid, R., Pisani, F., Borin, E., Cáceres, E.: An evaluation of segmented sorting strategies on GPUs. In: 2016 IEEE HPCC/SmartCity/DSS, pp. 1123–1130. IEEE (2016)
Schmid, R.F., Pisani, F., Cáceres, E.N., Borin, E.: An evaluation of fast segmented sorting implementations on GPUs. Parallel Comput. 110, 102889 (2022)
Yuan, Y., Lee, R., Zhang, X.: The Yin and Yang of processing data warehousing queries on GPU devices. Proc. VLDB Endowment 6(10), 817–828 (2013)
Zhang, J., Wang, H., Feng, W.C.: cuBLASTP: fine-grained parallelization of protein sequence search on CPU+GPU. IEEE/ACM Trans. Comput. Biol. Bioinf. 14(4), 830–843 (2015)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Kobus, R., Nelgen, J., Henkys, V., Schmidt, B. (2023). Faster Segmented Sort on GPUs. In: Cano, J., Dikaiakos, M.D., Papadopoulos, G.A., Pericàs, M., Sakellariou, R. (eds) Euro-Par 2023: Parallel Processing. Euro-Par 2023. Lecture Notes in Computer Science, vol 14100. Springer, Cham. https://doi.org/10.1007/978-3-031-39698-4_45
Download citation
DOI: https://doi.org/10.1007/978-3-031-39698-4_45
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-39697-7
Online ISBN: 978-3-031-39698-4
eBook Packages: Computer ScienceComputer Science (R0)