Inspiration

Iterative relational algebra (RA kernels in a fixed-point loop) enables bottom-up logic programming languages such as Datalog which can be implemented using relational algebra primitives (e.g., projections, reorderings, and joins). While much has explored standalone RA operations on the GPU, relatively less work focuses on iterative RA, which exposes new challenges (e.g., deduplication and memory management).

What it does

We developed a GPU-based hash-join implementation, leveraging (a) a novel open-addressing-based hash table implementation, (b) operator fusing to optimize memory access and (c) two variant implementations of deduplication. To evaluate our work, we implemented transitive closure using our hash-join-based CUDA library and compared its performance against cuDF (GPU-based) and Souffl\'e (CPU-based).

How we built it

We conduct our experiments on the ThetaGPU supercomputer of Argonne National lab. It has 24 NVIDIA DGX A100 nodes with eight NVIDIA A100 Tensor Core GPUs per node. Two nodes have 640 GB of GPU memory, while others have 320 GB of GPU memory each. Each node features two AMD EPYC 7742 processors with 3.31GHz clock speed and a total of 128 cores. The experiments are conducted on Ubuntu 20.04 operating system. cuDF package was installed on a Python conda environment, and we developed our code using CUDA version 11.4. We use Souffle version 2.3 with 128 threads in ThetaGPU. As cuDF and our CUDA experiments use only one GPU device (single-gpu benchmark) we use a single GPU node from ThetaGPU. The single GPU node has 108 multiprocessors on device (SM) and we use 3456(32 × 108) blocks per grid and 512 threads per block for each of the CUDA kernels. To evaluate the experiments, we use real-world and synthetic graph datasets from the Stanford large network dataset collection, SuiteSparse matrix collection, and road network real datasets collection.

Challenges we ran into

  • Unlike C++, CUDA lacks efficient data structures, limiting our implementation's capabilities.
  • The available VRAM of a single GPU imposes constraints on our implementation's scalability.
  • Debugging kernel code posed significant challenges, turning it into a nightmarish experience.

Accomplishments that we're proud of

Our hash-join-based transitive closure computation shows favorable results against both cuDF and Souffle, with gains up to 10.8x against cuDF and 3.9x against Souffle.

What we learned

  • Efficient memory management is crucial for successful CUDA implementations.
  • Handling the indeterministic result size per iteration in Iterative RA operations requires careful consideration.
  • While low-level GPU code allows optimization opportunities, it demands considerable time and effort compared to using off-the-shelf libraries like cuDF.

What's next for Accelerating iterative relational algebra operations

  • Conduct a comparative analysis of iterative transitive closure computation using CUDA, SYCL, and HIP parallel programming models to determine the most efficient candidate for iterative RA.
  • Explore extending the solution to multi-GPU clusters, paving the way for a high-performance Datalog backend.

Publications

  • Shovon, A. R., Gilray, T., Micinski, K., & Kumar, S. (2023). Towards Iterative Relational Algebra on the {GPU}. In 2023 USENIX Annual Technical Conference (USENIX ATC 23) (pp. 1009-1016).​
  • Shovon, A. R., Dyken, L. R., Green, O., Gilray, T., & Kumar, S. (2022, November). Accelerating Datalog applications with cuDF. In 2022 IEEE/ACM Workshop on Irregular Applications: Architectures and Algorithms (IA3) (pp. 41-45). IEEE.​

Porting CUDA code to SYCL

  • We cleaned the existing CUDA project to simply the file structure in a new repository
  • We installed SYCLomatic locally.
  • We used SYCLomatic to port CUDA code to SYCL​
  • We ran the SYCL code in Intel Dev Cloud

Project repository

​

Status to code migration

  • We ported the CUDA transitive closure computation code to SYCL using SYCLomatic
  • We needed to manually change some of the converted code to resolve compilation error
  • The SYCL results are correct for small datasets but incorrect for larger ones
  • As SYCL supports many standard data structures, we decided to implement SYCL implementation from scratch removing the overheads of Thrust APIS

Feedback

  • Examples of dynamic data structure implementations using SYCL would be helpful​
  • Automated generation of additional comments on ported code can explain the converted code​

Future direction

  • Implement transitive closure computation using SYCL​ from scratch
  • Compare the TC computation with CUDA, cuDF, and Souffle on single GPU​
  • Extend the computation to use multiGPU environment on intel GPU targeting the Aurora supercomputer​

Slides

  • Our code porting journey from CUDA to SYCL can be found in this slide deck

Built With

Share this project:

Updates

Submission history