Spiral in scala

Author:

Ofenbeck Georg1,Rompf Tiark2,Stojanov Alen1,Odersky Martin3,Püschel Markus1

Affiliation:

1. ETH Zurich, Zurich, Switzerland

2. Oracle Labs & EPFL, Lausanne, Switzerland

3. EPFL, Lausanne, Switzerland

Abstract

Program generators for high performance libraries are an appealing solution to the recurring problem of porting and optimizing code with every new processor generation, but only few such generators exist to date. This is due to not only the difficulty of the design, but also of the actual implementation, which often results in an ad-hoc collection of standalone programs and scripts that are hard to extend, maintain, or reuse. In this paper we ask whether and which programming language concepts and features are needed to enable a more systematic construction of such generators. The systematic approach we advocate extrapolates from existing generators: a) describing the problem and algorithmic knowledge using one, or several, domain-specific languages (DSLs), b) expressing optimizations and choices as rewrite rules on DSL programs, c) designing data structures that can be configured to control the type of code that is generated and the data representation used, and d) using autotuning to select the best-performing alternative. As a case study, we implement a small, but representative subset of Spiral in Scala using the Lightweight Modular Staging (LMS) framework. The first main contribution of this paper is the realization of c) using type classes to abstract over staging decisions, i.e. which pieces of a computation are performed immediately and for which pieces code is generated. Specifically, we abstract over different complex data representations jointly with different code representations including generating loops versus unrolled code with scalar replacement - a crucial and usually tedious performance transformation. The second main contribution is to provide full support for a) and d) within the LMS framework: we extend LMS to support translation between different DSLs and autotuning through search.

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference41 articles.

1. Eigen C++ template library for linear algebra. http://eigen.tuxfamily.org. Eigen C++ template library for linear algebra. http://eigen.tuxfamily.org.

2. Shonan challenge for generative programming

3. Automating the generation of composed linear algebra kernels

4. Optimizing matrix multiply using PHiPAC

Cited by 3 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Model-based autotuning of discretization methods in numerical simulations of partial differential equations;Journal of Computational Science;2022-01

2. On-stack replacement for program generators and source-to-source compilers;Proceedings of the 20th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences;2021-10-17

3. A methodology for speeding up loop kernels by exploiting the software information and the memory architecture;Computer Languages, Systems & Structures;2015-04

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3