arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2003.07497cs.PFcs.LG
收藏

迈向高性能、可移植性和生产力:用于性能预测的轻量级增强神经网络

Towards High Performance, Portability, and Productivity: Lightweight Augmented Neural Networks for Performance Prediction

University of Southern California(南加州大学);US Army Research Lab-West(美国陆军研究实验室西部)

Ajitesh Srivastava, Naifeng Zhang, Rajgopal Kannan, Viktor K. Prasanna

摘要:

编写高性能代码需要在程序设计语言、编译器优化和硬件知识方面的大量专业知识。这通常会导致生产力和可移植性差,并且对于非程序员领域专家(如物理学家)来说不方便。更理想的是一种高级语言,其中领域专家简单地根据高级操作来指定工作负荷(例如,matrix-multiply(A,B)),并且编译器识别充分利用异构平台的最佳实现。为了创建同时支持生产力、可移植性和性能的编译器,关键在于预测工作负载中包含的主要操作(内核)的各种可用实现(变体)在各种硬件上的性能,以决定(a)应该为工作负载中的每个内核选择哪个变体,以及(b)变体应该在哪个硬件资源上运行。为了实现性能预测,我们提出了轻量级的增强神经网络的内核变体硬件的任意组合。一个关键的创新是利用内核的数学复杂性作为实现更高精度的特征。这些模型是紧凑的,以减少编译时和运行时的训练时间和快速推理。使用少于75个参数的模型,只有250个训练数据实例,我们能够获得3%的低MAPE,在48个内核变体硬件组合上显著优于传统的前馈神经网络。我们进一步证明,我们的变量选择方法可以用于Halide实现,以获得高达1.7倍的加速比Halide的自动调度。

英文摘要:

Writing high-performance code requires significant expertise in the programming language, compiler optimizations, and hardware knowledge. This often leads to poor productivity and portability and is inconvenient for a non-programmer domain-specialist such as a Physicist. More desirable is a high-level language where the domain-specialist simply specifies the workload in terms of high-level operations (e.g., matrix-multiply(A, B)), and the compiler identifies the best implementation fully utilizing the heterogeneous platform. For creating a compiler that supports productivity, portability, and performance simultaneously, it is crucial to predict the performance of various available implementations (variants) of the dominant operations (kernels) contained in the workload on various hardware to decide (a) which variant should be chosen for each kernel in the workload, and (b) on which hardware resource the variant should run. To enable the performance prediction, we propose lightweight augmented neural networks for arbitrary combinations of kernel-variant-hardware. A key innovation is utilizing the mathematical complexity of the kernels as a feature to achieve higher accuracy. These models are compact to reduce training time and fast inference during compile-time and run-time. Using models with less than 75 parameters, and only 250 training data instances, we are able to obtain a low MAPE of 3%, significantly outperforming traditional feed-forward neural networks on 48 kernel-variant-hardware combinations. We further demonstrate that our variant-selection approach can be used in Halide implementations to obtain up to 1.7x speedup over Halide's auto-scheduler.

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

↑