切片即一切:迈向分布式矩阵乘法的通用单侧算法
Slicing Is All You Need: Towards A Universal One-Sided Algorithm for Distributed Matrix Multiplication
AI总结:
本文提出一种支持所有分区与复制因子组合的通用单侧分布式矩阵乘法算法,利用切片计算重叠块,实现高效通信,性能与PyTorch DTensor相当。
摘要:
科学、数据分析和AI工作负载中的许多重要应用都依赖于分布式矩阵乘法。先前的工作已经开发了大量适用于不同问题规模和分区方式的算法,包括1D、2D、1.5D和2.5D算法。当前工作的一个局限性是现有算法仅限于部分分区方式。要支持所有可能的分区方式空间,需要多种算法实现。如果针对特定分区方式集合没有可用的算法实现,则必须重新分布一个或多个操作数,从而增加通信成本。本文提出了一种通用的分布式矩阵乘法单侧算法,支持所有分区方式和复制因子的组合。我们的算法使用切片(索引算术)来计算必须相乘的重叠块集合。这个本地矩阵乘法列表可以直接执行,也可以重新排序并降低到优化的IR以最大化重叠。我们使用基于C++的高层PGAS编程框架实现我们的算法,该框架利用节点内互连进行直接的GPU到GPU通信。我们评估了各种分区方式和复制因子下的性能,发现我们的工作与PyTorch DTensor(一个针对AI模型的高度优化的分布式张量库)相比具有竞争力。
英文摘要:
Many important applications across science, data analytics, and AI workloads depend on distributed matrix multiplication. Prior work has developed a large array of algorithms suitable for different problem sizes and partitionings including 1D, 2D, 1.5D, and 2.5D algorithms. A limitation of current work is that existing algorithms are limited to a subset of partitionings. Multiple algorithm implementations are required to support the full space of possible partitionings. If no algorithm implementation is available for a particular set of partitionings, one or more operands must be redistributed, increasing communication costs. This paper presents a universal one-sided algorithm for distributed matrix multiplication that supports all combinations of partitionings and replication factors. Our algorithm uses slicing (index arithmetic) to compute the sets of overlapping tiles that must be multiplied together. This list of local matrix multiplies can then either be executed directly, or reordered and lowered to an optimized IR to maximize overlap. We implement our algorithm using a high-level C++-based PGAS programming framework that performs direct GPU-to-GPU communication using intra-node interconnects. We evaluate performance for a wide variety of partitionings and replication factors, finding that our work is competitive with PyTorch DTensor, a highly optimized distributed tensor library targeting AI models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。