[论文解读] BLASX: A High Performance Level-3 BLAS Library for Heterogeneous Multi-GPU Computing
BLASX 是一个针对异构多 GPU 系统的高性能、向后兼容的 Level-3 BLAS 库,采用动态的、缓存与局部性感知的运行时,并引入一种新颖的两级分层 tile 缓存,以最小化通信开销并最大化并发性。它在深度学习工作负载中实现线性加速,性能比 cuBLAS-XT、MAGMA 和 SuperMatrix 最高提升 2.48 倍,在 MATLAB 工作负载中最高提升 12.75 倍,同时通信量减少 200%。
Basic Linear Algebra Subprograms (BLAS) are a set of low level linear algebra kernels widely adopted by applications involved with the deep learning and scientific computing. The massive and economic computing power brought forth by the emerging GPU architectures drives interest in implementation of compute-intensive level 3 BLAS on multi-GPU systems. In this paper, we investigate existing multi-GPU level 3 BLAS and present that 1) issues, such as the improper load balancing, inefficient communication, insufficient GPU stream level concurrency and data caching, impede current implementations from fully harnessing heterogeneous computing resources; 2) and the inter-GPU Peer-to-Peer(P2P) communication remains unexplored. We then present BLASX: a highly optimized multi-GPU level-3 BLAS. We adopt the concepts of algorithms-by-tiles treating a matrix tile as the basic data unit and operations on tiles as the basic task. Tasks are guided with a dynamic asynchronous runtime, which is cache and locality aware. The communication cost under BLASX becomes trivial as it perfectly overlaps communication and computation across multiple streams during asynchronous task progression. It also takes the current tile cache scheme one step further by proposing an innovative 2-level hierarchical tile cache, taking advantage of inter-GPU P2P communication. As a result, linear speedup is observable with BLASX under multi-GPU configurations; and the extensive benchmarks demonstrate that BLASX consistently outperforms the related leading industrial and academic projects such as cuBLAS-XT, SuperMatrix, MAGMA and PaRSEC.
研究动机与目标
- 解决现有多 GPU Level-3 BLAS 库因负载不平衡、通信效率低下以及缺乏 GPU 流并发性而导致的性能不佳问题。
- 克服当前实现方案在 GPU 能力和实时性能差异较大的异构 GPU 环境中的局限性。
- 通过利用 GPU 到 GPU 的对等(P2P)访问并引入两级分层 tile 缓存,最小化 CPU-GPU 通信。
- 在抽象低层复杂性(如任务调度和内存管理)的同时,保持与现有基于 CPU BLAS 应用程序的向后兼容性。
- 在包括 Kepler 和 Maxwell GPU 在内的异构配置下,实现跨多种多 GPU 系统的线性可扩展性和高性能。
提出的方法
- 采用基于 tile 的算法,将矩阵划分为 tile,将 tile 上的操作视为原子任务,以实现细粒度并行。
- 采用动态异步运行时,具备缓存与局部性感知能力,支持根据异构 GPU 的特性自适应地调度任务,实现负载均衡。
- 实现两级分层 tile 缓存:L1 缓存使用 GPU 片上内存,L2 缓存聚合多 GPU 内存,减少 CPU-GPU 数据移动。
- 设计一种新型的 LRU 替换算法和缓存一致性协议,确保在多 GPU 异步任务执行下保持数据一致性。
- 通过异步任务推进机制,在多个 GPU 流中重叠通信与计算,使通信开销可忽略不计。
- 仅暴露一个调优参数——tile 大小,以最小化用户工作量,同时在 GPU 饱和度、PCI-E 效率和并行性之间实现平衡。
实验结果
研究问题
- RQ1在多 GPU Level-3 BLAS 实现中,如何有效缓解异构 GPU 之间的负载不平衡问题?
- RQ2在多 GPU 系统中,通过与计算重叠,通信开销最多能减少到何种程度?
- RQ3两级分层 tile 缓存是否能通过利用 GPU 到 GPU 的 P2P 访问有效减少 CPU-GPU 通信?
- RQ4BLASX 如何在保持与现有基于 CPU BLAS 应用程序向后兼容的同时,实现在多 GPU 系统上的卓越性能?
- RQ5tile 大小对性能的影响如何?是否可以通过单一 tile 大小配置在多种硬件平台上实现最优性能?
主要发现
- BLASX 在多 GPU 系统上实现了线性加速,包括包含 2 块 K40 和 2 块 TITAN X GPU 的异构配置,而 cuBLAS-XT、MAGMA 和 SuperMatrix 均表现出较差的可扩展性。
- 在配备 3 块 K40c GPU 的 Everest 系统上,BLASX 在 DGEMM 性能方面持续优于 SuperMatrix、MAGMA 和 PaRSEC 等学术实现。
- 与 NVIDIA 的 cuBLAS-XT 相比,BLASX 平均性能提升 25%,通信量减少 200%。
- 在 Caffe 中,与仅使用 GPU 的 Caffe 相比,BLASX 将深度学习训练速度最高提升 2.48 倍;与仅使用 CPU 的 Caffe 相比,最高提升 62.3 倍,支持参数量高达 3.2×10^10 的模型。
- 在 MATLAB 中,BLASX 在 Everest 系统上将单精度矩阵乘法加速 12.75 倍,双精度运算加速 8.27 倍。
- BLASX 的性能在 tile 大小为 1024×1024 时达到最优,该配置在 GPU 饱和度、PCI-E 效率和可用并行性之间实现了最佳平衡。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。