GPU-Based Dynamic Hyperspace Hash with Full Concurrency

Zhuo Ren, Yu Gu, Chuanwen Li, Fangfang Li, Ge Yu

Abstract

Hyperspace hashing, frequently applied to NoSQL databases, builds indexes by mapping objects with multiple attributes to a multidimensional space. This approach accelerates queries on secondary attributes beyond simple primary key lookups. Leveraging the rich computing resources of modern GPUs, we propose GHSH (GPU-Based Dynamic Hyperspace Hash), a fully concurrent, lock-free dynamic hyperspace hash table. By utilizing atomic operations and a specialized concurrency control strategy, GHSH ensures wait-free read operations and high parallel efficiency. Our design incorporates hardware-aware "super nodes" and a warp-level pre-combination data sharing strategy. Experimental results on an Nvidia RTX2080Ti GPU demonstrate that GHSH achieves a 20-100x speedup over CPU counterparts, processing up to 396 million updates per second and 995 million search queries per second while maintaining performance comparable to state-of-the-art primary-key-only GPU hashes.

What Problem Does This Paper Address?

NoSQL databases excel at primary key lookups but often struggle with "secondary attributes"—such as finding all employees with a specific salary or all tweets from a certain location. Traditional secondary indexes are computationally expensive to maintain during high-velocity writes. Hyperspace hashing offers a solution by mapping multi-attribute data into a multidimensional coordinate system, but implementing this efficiently on GPUs presents significant hurdles.

Hyperspace hashing maps multi-attribute data (e.g., Name, Phone) into a multidimensional coordinate system for efficient multi-attribute querying.

The primary challenges for GPU implementation include:

  1. Branch Divergence: Performance drops when threads in a warp follow different execution paths.
  2. Memory Throughput: Traditional hash structures often cause uncoalesced memory access, wasting hardware bandwidth.
  3. Concurrency Control: Managing simultaneous reads and writes without heavy-duty locks is difficult in massively parallel environments.

Methods

GHSH introduces several novel techniques to align hyperspace hashing with GPU hardware characteristics:

  • Super Node Structure: GHSH utilizes "super nodes" designed with a Structure-of-Arrays (SoA) layout. Each node is exactly 128 bytes, matching the GPU's 32-thread warp size to enable single-transaction coalesced memory access.
  • Warp Pre-combination Data Sharing (WPDS): To mitigate branch divergence, GHSH groups queries by bucket and type before processing. This ensures threads within a warp perform similar tasks, maximizing parallel efficiency.
  • Lock-Free Concurrency: The system employs atomic operations (e.g., atomicCAS) instead of locks, allowing high-concurrency updates without stalling the pipeline.
  • Temporary Repeated Read Strategy: To achieve wait-free reads, GHSH writes new data to a target bucket before removing it from the source during data moves. This ensures readers always find a valid version of the record.
  • Adaptive Indexing: To combat the "curse of dimensionality," where hash space grows exponentially with attributes, GHSH partitions large multidimensional spaces into manageable subspaces.
A 3D subspace mapping attributes like city, salary, and age to manage high-dimensional data efficiently.

Key Results

The authors evaluated GHSH using synthetic datasets ranging from $2^{10}$ to $2^{27}$ elements on an Nvidia RTX2080Ti GPU. Key findings include:

  • Exceptional Throughput: GHSH achieved a peak of 396 million updates/s and 995 million search queries/s.
  • Massive Speedup: The implementation is 20x faster at building and 100x faster at searching than multi-threaded CPU implementations using OpenMP.
  • High Utilization: Performance remained stable even at 97% memory utilization, a significant improvement over many GPU hash tables that degrade after 60-70% load.
  • Versatility: Despite supporting complex multi-attribute queries, GHSH's raw speed for simple key lookups remains competitive with specialized primary-key-only GPU hashes like Slab Hash.

Conclusion and Future Work

GHSH demonstrates that hardware-aware data structures can unlock massive performance gains for complex indexing tasks on GPUs. While currently optimized for fixed-length 4-byte attributes, future research could extend this efficiency to variable-length data types like strings. Additionally, automating the optimal grouping of attributes into subspaces remains an area for further refinement.

Summary updated

BibTeX
@inproceedings{ren2021gpu,
  author = {Zhuo Ren and Yu Gu and Chuanwen Li and Fangfang Li and Ge Yu},
  title = {{GPU-Based Dynamic Hyperspace Hash with Full Concurrency}},
  booktitle = {Data Sci. Eng},
  year = {2021},
  url = {https://openreview.net/forum?id=TVRGqt5ymy},
}
Figure