PHOBIC:具有优化桶大小和交错编码的完美哈希
PHOBIC: Perfect Hashing with Optimized Bucket Sizes and Interleaved Coding
AI总结:
本文提出PHOBIC技术,通过优化预期桶大小的闭式分布和分区交错种子编码方案,在相同查询时间和构造吞吐量下比PTHash节省0.17位/键空间,并提供GPU加速实现。
摘要:
最小完美哈希函数(MPHF)将包含n个键的集合无冲突地映射到{1, ..., n}。这类函数在生物信息学和数据库等领域有着广泛应用。本文重新研究了PTHash——一种专为快速查询设计的构造技术。PTHash将输入键分配到小桶中,并为每个桶搜索一个哈希函数种子,使其键无冲突地放置在输出域中。所有种子的集合随后以压缩方式存储。由于前面的桶更容易放置,因此按大小非递增顺序处理桶。此外,PTHash启发式地产生不平衡的桶大小分布,将60%的键分配到30%的桶中。我们的主要贡献是刻画了预期桶大小的最优分布(至低阶项)。我们得到了一个简单的闭式解,在实践中提高了空间高效配置的构造吞吐量。我们的第二个贡献是一种新颖的种子编码方案。我们将键划分为多个分区。在每个分区内,执行桶分配和搜索步骤。然后,通过连续放置所有分区中第i个桶的种子,以交错方式存储种子。每个分区中第i个桶的种子遵循相同的统计分布。这允许我们为每个桶调整压缩器。因此,我们将我们的技术称为PHOBIC——具有优化桶大小和交错编码的完美哈希。与PTHash相比,在相同查询时间和构造吞吐量下,PHOBIC的空间效率提高了0.17位/键。我们还贡献了GPU实现以进一步加速MPHF构造。对于快速查询配置,PHOBIC-GPU可以以2.17位/键、每键28纳秒的速度构造完美哈希函数,并在CPU上以37纳秒每键的速度进行查询。
英文摘要:
A minimal perfect hash function (MPHF) maps a set of n keys to {1, ..., n} without collisions. Such functions find widespread application e.g. in bioinformatics and databases. In this paper we revisit PTHash - a construction technique particularly designed for fast queries. PTHash distributes the input keys into small buckets and, for each bucket, it searches for a hash function seed that places its keys in the output domain without collisions. The collection of all seeds is then stored in a compressed way. Since the first buckets are easier to place, buckets are considered in non-increasing order of size. Additionally, PTHash heuristically produces an imbalanced distribution of bucket sizes by distributing 60% of the keys into 30% of the buckets. Our main contribution is to characterize, up to lower order terms, an optimal distribution of expected bucket sizes. We arrive at a simple, closed form solution which improves construction throughput for space efficient configurations in practice. Our second contribution is a novel encoding scheme for the seeds. We split the keys into partitions. Within each partition, we run the bucket distribution and search step. We then store the seeds in an interleaved way by consecutively placing the seeds for the i-th buckets from all partitions. The seeds for the i-th bucket of each partition follow the same statistical distribution. This allows us to tune a compressor for each bucket. Hence, we call our technique PHOBIC - Perfect Hashing with Optimized Bucket sizes and Interleaved Coding. Compared to PTHash, PHOBIC is 0.17 bits/key more space efficient for same query time and construction throughput. We also contribute a GPU implementation to further accelerate MPHF construction. For a configuration with fast queries, PHOBIC-GPU can construct a perfect hash function at 2.17 bits/key in 28 ns per key, which can be queried in 37 ns on the CPU.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。