在GPU上扩展最坏情况最优的Datalog
Scaling Worst-Case Optimal Datalog to GPUs
AI总结:
本文提出SRDatalog,首个基于WCOJ的GPU Datalog引擎,通过改进存储和内存管理解决二进制连接的OOM问题,并通过负载平衡和规则复用提升性能,实现在实际程序分析任务中21至47倍的加速。
摘要:
Datalog是一种用于复杂分析工作负载的声明式逻辑编程语言,如程序分析和图分析。Datalog的流行源于其独特的定位,将逻辑定义的规范与大规模数据并行性的潜力结合。尽管传统引擎基于CPU,但Datalog的内存限制促使人们越来越多地利用GPU。这些引擎通过SIMT友好的连接算法实现迭代关系连接,从而超越CPU引擎。不幸的是,所有现有的GPU Datalog引擎都基于二进制连接,这在生产系统如DOOP和ddisasm中出现的复杂多路查询中是不够的。对于这些查询,二进制分解会导致时间与空间的AGM界渐进爆炸,导致无论连接顺序如何都会发生OOM失败。最坏情况最优连接(WCOJ)避免了这种爆炸,但其属性每次的连接映射不适用于具有键偏斜的SIMT硬件,导致在流多处理器(SMs)之间出现严重的负载不平衡。我们提出了SRDatalog,首个基于WCOJ的GPU Datalog引擎。SRDatalog使用扁平列式存储和两阶段确定性内存分配来避免二进制连接的OOM失败和静态WCOJ系统的索引重建开销。为了减轻偏斜并隐藏硬件停滞,SRDatalog进一步采用根级直方图引导的负载平衡、结构辅助关系分割和流对齐的规则复用。在实际的程序分析工作负载上,SRDatalog实现了几何平均速度提升21至47倍。
英文摘要:
Datalog is a declarative logic-programming language used for complex analytic reasoning workloads such as program analysis and graph analytics. Datalog's popularity is due to its unique price-point, marrying logic-defined specification with the potential for massive data parallelism. While traditional engines are CPU-based, the memory-bound nature of Datalog has led to increasing interest in leveraging GPUs. These engines beat CPU-based engines by operationalizing iterated relational joins via SIMT-friendly join algorithms. Unfortunately, all existing GPU Datalog engines are built on binary joins, which are inadequate for the complex multi-way queries arising in production systems such as DOOP and ddisasm. For these queries, binary decomposition can incur the AGM bound asymptotic blowup in time and space, leading to OOM failures regardless of join order. Worst-Case Optimal Joins (WCOJ) avoid this blowup, but their attribute-at-a-time intersections map poorly to SIMT hardware under key skew, causing severe load imbalance across Streaming Multiprocessors (SMs). We present SRDatalog, the first GPU Datalog engine based on WCOJ. SRDatalog uses flat columnar storage and two-phase deterministic memory allocation to avoid the OOM failures of binary joins and the index-rebuild overheads of static WCOJ systems. To mitigate skew and hide hardware stalls, SRDatalog further employs root-level histogram-guided load balancing, structural helper-relation splitting, and stream-aligned rule multiplexing. On real-world program-analysis workloads, SRDatalog achieves geometric-mean speedups of 21x to 47x.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。