Jincheng Zhou, Jin Zhang, Xiang Zhang, Tiaojie Xiao, Di Ma, Chunye Gong
{"title":"ARM NEON 上的混合矢量化合并排序","authors":"Jincheng Zhou, Jin Zhang, Xiang Zhang, Tiaojie Xiao, Di Ma, Chunye Gong","doi":"arxiv-2409.03970","DOIUrl":null,"url":null,"abstract":"Sorting algorithms are the most extensively researched topics in computer\nscience and serve for numerous practical applications. Although various sorts\nhave been proposed for efficiency, different architectures offer distinct\nflavors to the implementation of parallel sorting. In this paper, we propose a\nhybrid vectorized merge sort on ARM NEON, named NEON Merge Sort for short\n(NEON-MS). In detail, according to the granted register functions, we first\nidentify the optimal register number to avoid the register-to-memory access,\ndue to the write-back of intermediate outcomes. More importantly, following the\ngeneric merge sort framework that primarily uses sorting network for column\nsort and merging networks for three types of vectorized merge, we further\nimprove their structures for high efficiency in an unified asymmetry way: 1) it\nmakes the optimal sorting networks with few comparators become possible; 2)\nhybrid implementation of both serial and vectorized merges incurs the pipeline\nwith merge instructions highly interleaved. Experiments on a single FT2000+\ncore show that NEON-MS is 3.8 and 2.1 times faster than std::sort and\nboost::block\\_sort, respectively, on average. Additionally, as compared to the\nparallel version of the latter, NEON-MS gains an average speedup of 1.25.","PeriodicalId":501422,"journal":{"name":"arXiv - CS - Distributed, Parallel, and Cluster Computing","volume":"71 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"A Hybrid Vectorized Merge Sort on ARM NEON\",\"authors\":\"Jincheng Zhou, Jin Zhang, Xiang Zhang, Tiaojie Xiao, Di Ma, Chunye Gong\",\"doi\":\"arxiv-2409.03970\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Sorting algorithms are the most extensively researched topics in computer\\nscience and serve for numerous practical applications. Although various sorts\\nhave been proposed for efficiency, different architectures offer distinct\\nflavors to the implementation of parallel sorting. In this paper, we propose a\\nhybrid vectorized merge sort on ARM NEON, named NEON Merge Sort for short\\n(NEON-MS). In detail, according to the granted register functions, we first\\nidentify the optimal register number to avoid the register-to-memory access,\\ndue to the write-back of intermediate outcomes. More importantly, following the\\ngeneric merge sort framework that primarily uses sorting network for column\\nsort and merging networks for three types of vectorized merge, we further\\nimprove their structures for high efficiency in an unified asymmetry way: 1) it\\nmakes the optimal sorting networks with few comparators become possible; 2)\\nhybrid implementation of both serial and vectorized merges incurs the pipeline\\nwith merge instructions highly interleaved. Experiments on a single FT2000+\\ncore show that NEON-MS is 3.8 and 2.1 times faster than std::sort and\\nboost::block\\\\_sort, respectively, on average. Additionally, as compared to the\\nparallel version of the latter, NEON-MS gains an average speedup of 1.25.\",\"PeriodicalId\":501422,\"journal\":{\"name\":\"arXiv - CS - Distributed, Parallel, and Cluster Computing\",\"volume\":\"71 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-09-06\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Distributed, Parallel, and Cluster Computing\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2409.03970\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Distributed, Parallel, and Cluster Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.03970","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Sorting algorithms are the most extensively researched topics in computer
science and serve for numerous practical applications. Although various sorts
have been proposed for efficiency, different architectures offer distinct
flavors to the implementation of parallel sorting. In this paper, we propose a
hybrid vectorized merge sort on ARM NEON, named NEON Merge Sort for short
(NEON-MS). In detail, according to the granted register functions, we first
identify the optimal register number to avoid the register-to-memory access,
due to the write-back of intermediate outcomes. More importantly, following the
generic merge sort framework that primarily uses sorting network for column
sort and merging networks for three types of vectorized merge, we further
improve their structures for high efficiency in an unified asymmetry way: 1) it
makes the optimal sorting networks with few comparators become possible; 2)
hybrid implementation of both serial and vectorized merges incurs the pipeline
with merge instructions highly interleaved. Experiments on a single FT2000+
core show that NEON-MS is 3.8 and 2.1 times faster than std::sort and
boost::block\_sort, respectively, on average. Additionally, as compared to the
parallel version of the latter, NEON-MS gains an average speedup of 1.25.