Many recent machine learning models show dynamic shape characteristics. However, existing AI compiler optimization systems suffer a lot from problems brought by dynamic shape models, including compilation overhead, memory usage, optimization pipeline and deployment complexity. This paper provides a compiler system to natively support optimization for dynamic shape workloads, named DISC. DISC enriches a set of IR to form a fully dynamic shape representation. It generates the runtime flow at compile time to support processing dynamic shape based logic, which avoids the interpretation overhead at runtime and enlarges the opportunity of host-device co-optimization. It addresses the kernel fusion problem of dynamic shapes with shape propagation and constraints collecting methods. This is the first work to demonstrate how to build an end-to-end dynamic shape compiler based on MLIR infrastructure. Experiments show that DISC achieves up to 3.3x speedup than TensorFlow/PyTorch, and 1.8x than Nimble.
MKPipe: A Compiler Framework for Optimizing Multi-Kernel Workloads in OpenCL for FPGA
OpenCL for FPGA使开发人员能够使用类似于处理器的编程模型来设计FPGA。最近的工作表明,在OpenCL级别的代码优化是很重要的,以实现高计算效率。然而,现有的工作要么主要集中在优化单个内核或完全依赖于通道来设计多内核流水线。在本文中,我们提出了一个源代码到源代码的编译器框架,MKPipe,用于优化多内核工作负载的OpenCL FPGA。除了通道,我们提出了新的方案,使多内核管道。我们的优化编译器采用了系统的方法来探索这些优化方法的权衡。为了使内核执行之间更有效的重叠,我们还提出了一种新的工作项/工作组ID重新映射技术。此外,我们提出了新的算法的吞吐量平衡和资源平衡,调整优化对单个内核的多内核工作负载。我们的研究结果表明,我们的编译器优化的多内核实现了高达3.6倍(平均1.4倍)的加速比超过基线,其中内核已经被单独优化。
Introducing Molly: Distributed Memory Parallelization with LLVM
为分布式内存机器编程一直是一项乏味的任务,但这是必要的,因为编译器本身还没有足够的能力为这样的机器进行优化。Molly是LLVM编译器工具链的一个扩展,如果程序被组织在静态确定的循环控制流中,它能够分发和重组工作负载和数据。这些被表示为多面体整数点集,允许应用于它们的程序转换。程序员可以根据需要声明内存分布和布局,并自动生成必要的异步MPI通信。主要动机是在IBM Blue Gene/Q超级计算机上运行Lattice QCD模拟,但由于实施尚未完成,本文展示了Conway生命游戏的功能。
Breaking the Computation and Communication Abstraction Barrier in Distributed Machine Learning Workloads
University of Massachusetts Amherst(马萨诸塞大学阿默斯特分校);Ohio State University(俄亥俄州立大学);Chinese Academy of Sciences(中国科学院);University of California, Riverside(加州大学河滨分校);Microsoft Research(微软研究院)