A minimal perfect hash function (MPHF) bijectively maps a set S of objects to the first |S| integers. It can be used as a building block in databases and data compression. RecSplit [Esposito et al., ALENEX'20] is currently the most space efficient practical minimal perfect hash function. It heavily relies on trying out hash functions in a brute force way. We introduce rotation fitting, a new technique that makes the search more efficient by drastically reducing the number of tried hash functions. Additionally, we greatly improve the construction time of RecSplit by harnessing parallelism on the level of bits, vectors, cores, and GPUs. In combination, the resulting improvements yield speedups up to 239 on an 8-core CPU and up to 5438 using a GPU. The original single-threaded RecSplit implementation needs 1.5 hours to construct an MPHF for 5 Million objects with 1.56 bits per object. On the GPU, we achieve the same space usage in just 5 seconds. Given that the speedups are larger than the increase in energy consumption, our implementation is more energy efficient than the original implementation.
翻译:最小完美哈希函数(MPHF)能够将对象集合S双射映射到前|S|个整数,可作为数据库与数据压缩中的基础模块。RecSplit [Esposito等人,ALENEX'20] 是当前空间效率最高的实用最小完美哈希函数,其核心依赖于对哈希函数的暴力试错搜索。我们提出旋转拟合(rotation fitting)新技术,通过大幅减少待测试哈希函数数量提升搜索效率。此外,我们在比特层级、向量层级、核心层级及GPU层级实现并行化,显著改善了RecSplit的构建时间。综合优化后,在8核CPU上实现最高239倍加速,在GPU上实现最高5438倍加速。原始单线程RecSplit实现需要1.5小时构建包含500万个对象、每对象占用1.56比特的MPHF,而我们在GPU上仅需5秒即可达到相同空间利用率。鉴于加速比超过能耗增长幅度,本实现相比原始方案具有更高能效。