arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.08490cs.AR
收藏

通过减少CUDA内核加速小批量HGNN训练

Accelerating Mini-batch HGNN Training by Reducing CUDA Kernels

Meng Wu, Jingkai Qiu, Mingyu Yan, Wenming Li, Yang Zhang, Zhimin Zhang, Xiaochun Ye, Dongrui Fan

AI总结:

针对现有GPU方案训练异构图神经网络时CUDA内核多、GPU利用率低的问题,提出HiFuse增强方案,通过数据重组合并、语义图构建卸载到CPU及并行优化,实现了平均2.38倍的训练加速。

摘要:

异构图神经网络(HGNN)是捕获异构图中结构与语义信息的关键工具。然而,现有的基于GPU的解决方案(如PyTorch Geometric)在HGNN训练过程中,因存在大量执行时间短、受内存限制的CUDA内核,导致GPU利用率较低。\n 为解决这一问题,我们提出HiFuse——一种针对PyTorch Geometric的增强方案,旨在加速CPU-GPU系统上的小批量HGNN训练。从数据层面,我们将多个较小的顶点特征矩阵重组合并为更大的矩阵,使单个内核能够处理更大的数据块。这一方式有效利用了数据局部性,减少了内核启动开销,提升了整体GPU利用率。从工作流层面,我们精心将语义图的构建从GPU卸载到CPU,以减少CUDA内核的数量。为满足CPU的并行性需求并确保CPU与GPU之间的无缝执行,我们采用了多线程、异步流水线等并行化技术。这使得流程的不同阶段能够重叠执行,进一步提升GPU利用率并降低端到端执行延迟,实现计算资源更高效、均衡的利用。通过大量实验验证,HiFuse相比当前最优方案实现了平均2.38倍的加速比。

英文摘要:

Heterogeneous graph neural networks (HGNNs) are essential for capturing the structure and semantic information in heterogeneous graphs. However, existing GPU-based solutions, such as PyTorch Geometric, suffer from low GPU utilization due to numerous short-execution-time and memory-bound CUDA kernels during HGNN training. To address this issue, we introduce HiFuse, an enhancement for PyTorch Geometric designed to accelerate mini-batch HGNN training on CPU-GPU systems. From the data perspective, we reorganize and merge multiple smaller vertex feature matrices into larger ones, enabling a single kernel to process larger data chunks. This efficiently exploits data locality, reduces the kernel launch overhead, and improves overall GPU utilization. From the workflow perspective, we sophisticatedly offload the construction of semantic graphs from GPU to CPU to reduce the number of CUDA kernels. To meet the parallelism requirements on CPU and ensure seamless execution between CPU and GPU, we employ parallelization techniques including multi-threading and asynchronous pipeline. This allows different stages of the process to overlap, enhancing GPU utilization and reducing end-to-end execution latency, leading to a more efficient and balanced use of computational resources. Through extensive experiments, HiFuse demonstrates an average 2.38 times speedup compared to a state-of-the-art solution.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑