[Paper Review] High Performance Construction of RecSplit Based Minimal Perfect Hash Functions
This paper proposes a high-performance construction of RecSplit-based minimal perfect hash functions (MPHFs) using rotation fitting and multi-level parallelism (bit, vector, multi-core, and GPU). By reducing the search space for bijections and leveraging massive parallelism, the method achieves up to 5,438× speedup over the original single-threaded RecSplit, constructing a 5M-object MPHF in just 5 seconds on a GPU while maintaining near-optimal space usage of 1.584 bits per object.
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.
Motivation & Objective
- Address the high construction time of RecSplit, the most space-efficient practical MPHF, which relies on brute-force hash function search.
- Reduce the computational cost of finding bijections in RecSplit by introducing a novel search mechanism that prunes the search space.
- Accelerate MPHF construction through multi-level parallelism (bit-level, vector, multi-core, and GPU) to make space-efficient MPHF construction practical for large-scale datasets.
- Improve energy efficiency by making GPU-based construction faster than CPU-based alternatives, despite higher energy consumption per operation.
- Demonstrate that brute-force approaches with aggressive parallelism can outperform algorithmically sophisticated alternatives in practice, even for less space-efficient MPHF variants.
Proposed method
- Introduce rotation fitting: a technique that splits objects into two sets, hashes them, and tries to fit one set into the 'holes' of the other by cyclically shifting (rotating) the hash values to achieve a bijection.
- Use bit-parallel operations (e.g., popcount, rank1, select1, rotate) to efficiently evaluate multiple hash functions in parallel at the bit level.
- Leverage SIMD instructions to process multiple hash function evaluations in a single instruction, increasing throughput on CPUs.
- Apply multi-threading across CPU cores to distribute the workload of testing hash functions across multiple threads.
- Utilize GPU acceleration to evaluate millions of hash function candidates in parallel, exploiting the massive data-level parallelism inherent in the brute-force search.
- Integrate rotation fitting into the RecSplit framework to reduce the number of candidate hash functions that need to be tested, improving search efficiency.
Experimental results
Research questions
- RQ1Can the brute-force search for bijections in RecSplit be made significantly more efficient without sacrificing space efficiency?
- RQ2To what extent can bit-parallel and vectorized operations reduce the cost of evaluating candidate hash functions in MPHF construction?
- RQ3How effective is GPU acceleration in reducing construction time for space-optimized MPHF constructions?
- RQ4Does the combination of rotation fitting and multi-level parallelism lead to better energy efficiency compared to traditional CPU-based construction?
- RQ5Can a simple, brute-force approach with aggressive parallelism outperform more sophisticated algorithmic designs in practice, even for less space-efficient MPHF variants?
Key findings
- Rotation fitting reduces the number of candidate hash functions that need to be tested by efficiently searching for bijections through cyclic shifting, significantly improving search efficiency.
- The SIMD-optimized implementation achieves a 50× speedup over the original single-threaded RecSplit on a CPU, with construction time reduced from 1.5 hours to ~18 minutes for 5 million objects.
- Multi-threaded execution on a 16-thread CPU achieves a 239× speedup compared to the original single-threaded RecSplit, reducing construction time to ~3.8 minutes.
- GPU acceleration reduces construction time for 5 million objects from 1.5 hours to just 5 seconds, achieving a 5,438× speedup over the original implementation.
- Despite higher energy consumption per operation, the GPU-based construction is more energy efficient overall because of the dramatic reduction in total time, making it more sustainable for large-scale applications.
- The proposed method maintains near-optimal space usage—1.584 bits per object—matching the best-known practical MPHF construction, while outperforming other state-of-the-art methods in both construction time and energy efficiency.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.