Generating Permutations Using Hash Tables

Oded Green, Corey J. Nolet, Joe Eaton
{"title":"Generating Permutations Using Hash Tables","authors":"Oded Green, Corey J. Nolet, Joe Eaton","doi":"10.1109/HPEC55821.2022.9926387","DOIUrl":null,"url":null,"abstract":"Given a set of $N$ distinct values, the operation of shuffling those elements and creating a random order is used in a wide range range of applications, including (but not limited to) statistical analysis, machine learning, games, and bootstrapping. The operation of shuffling elements is equivalent to generating a random permutation and applying the permutation. For example, the random permutation of an input allows splitting into two or more subsets without bias. This operation is repeated for machine learning applications when both a train and test data set are needed. In this paper we describe a new method for creating random permutations that is scalable, efficient, and simple. We show that the operation of generating a random permutation shares traits with building a hashtable. Our method uses a fairly new hash table, called HashGraph, to generate the permutation. HashGraph's unique data-structure ensures easy generation and retrieval of the permutation. HashGraph is one of the fastest known hash-tables for the GPU and also outperforms many leading CPU hash-tables. We show the performance of our new permutation generation scheme using both Python and CUDA versions of HashGraph. Our CUDA implementation is roughly 10% faster than our Python implementation. In contrast to the shuffle operation in NVIDIA's Thrust and cuPy frameworks, our new permutation generation algorithm is 2.6 x and 1.73 x faster, respectively and up to 150 x faster than numPy.","PeriodicalId":200071,"journal":{"name":"2022 IEEE High Performance Extreme Computing Conference (HPEC)","volume":"69 6 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-09-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 IEEE High Performance Extreme Computing Conference (HPEC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/HPEC55821.2022.9926387","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Given a set of $N$ distinct values, the operation of shuffling those elements and creating a random order is used in a wide range range of applications, including (but not limited to) statistical analysis, machine learning, games, and bootstrapping. The operation of shuffling elements is equivalent to generating a random permutation and applying the permutation. For example, the random permutation of an input allows splitting into two or more subsets without bias. This operation is repeated for machine learning applications when both a train and test data set are needed. In this paper we describe a new method for creating random permutations that is scalable, efficient, and simple. We show that the operation of generating a random permutation shares traits with building a hashtable. Our method uses a fairly new hash table, called HashGraph, to generate the permutation. HashGraph's unique data-structure ensures easy generation and retrieval of the permutation. HashGraph is one of the fastest known hash-tables for the GPU and also outperforms many leading CPU hash-tables. We show the performance of our new permutation generation scheme using both Python and CUDA versions of HashGraph. Our CUDA implementation is roughly 10% faster than our Python implementation. In contrast to the shuffle operation in NVIDIA's Thrust and cuPy frameworks, our new permutation generation algorithm is 2.6 x and 1.73 x faster, respectively and up to 150 x faster than numPy.
使用哈希表生成排列
给定一组N个不同的值,对这些元素进行洗牌并创建随机顺序的操作可用于广泛的应用程序,包括(但不限于)统计分析、机器学习、游戏和自举。洗牌元素的操作相当于产生一个随机排列并应用该排列。例如,输入的随机排列允许无偏差地分成两个或多个子集。当需要训练数据集和测试数据集时,机器学习应用程序会重复此操作。在本文中,我们描述了一种创建随机排列的新方法,它是可扩展的,高效的,简单的。我们展示了生成随机排列的操作与构建哈希表具有相同的特征。我们的方法使用一个相当新的散列表(称为HashGraph)来生成排列。HashGraph独特的数据结构确保了排列的轻松生成和检索。HashGraph是GPU上已知最快的哈希表之一,性能也优于许多领先的CPU哈希表。我们使用Python和CUDA版本的HashGraph展示了我们的新排列生成方案的性能。我们的CUDA实现比Python实现大约快10%。与NVIDIA的Thrust和cuPy框架中的shuffle操作相比,我们的新排列生成算法分别快2.6倍和1.73倍,比numPy快150倍。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信