Indexed Streams: A Formal Intermediate Representation for Fused Contraction Programs

被引:5
作者
Kovach, Scott [1 ]
Kolichala, Praneeth [1 ]
Gu, Tiancheng [1 ]
Kjolstad, Fredrik [1 ]
机构
[1] Stanford Univ, Stanford, CA 94305 USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2023年 / 7卷 / PLDI期
基金
美国国家科学基金会;
关键词
contractions; streams; operational semantics; functional programming; FUSION; LANGUAGE; ALGEBRA;
D O I
10.1145/3591268
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We introduce indexed streams, a formal operational model and intermediate representation that describes the fused execution of a contraction language that encompasses both sparse tensor algebra and relational algebra. We prove that the indexed stream model is correct with respect to a functional semantics. We also develop a compiler for contraction expressions that uses indexed streams as an intermediate representation. The compiler is only 540 lines of code, but we show that its performance can match both the TACO compiler for sparse tensor algebra and the SQLite and DuckDB query processing libraries for relational algebra.
引用
收藏
页数:25
相关论文
共 58 条
[1]   LevelHeaded: A Unified Engine for Business Intelligence and Linear Algebra Querying [J].
Aberger, Christopher R. ;
Lamb, Andrew ;
Olukotun, Kunle ;
Re, Christopher .
2018 IEEE 34TH INTERNATIONAL CONFERENCE ON DATA ENGINEERING (ICDE), 2018, :449-460
[2]   EmptyHeaded: A Relational Engine for Graph Processing [J].
Aberger, Christopher R. ;
Lamb, Andrew ;
Tu, Susan ;
Noetzli, Andres ;
Olukotun, Kunle ;
Re, Christopher .
ACM TRANSACTIONS ON DATABASE SYSTEMS, 2017, 42 (04)
[3]   Autoscheduling for Sparse Tensor Algebra with an Asymptotic Cost Model [J].
Ahrens, Peter ;
Kjolstad, Fredrik ;
Amarasinghe, Saman .
PROCEEDINGS OF THE 43RD ACM SIGPLAN INTERNATIONAL CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '22), 2022, :269-285
[4]   The generalized distributive law [J].
Aji, SM ;
McEliece, RJ .
IEEE TRANSACTIONS ON INFORMATION THEORY, 2000, 46 (02) :325-343
[5]  
Anonymous, 2023, Zenodo, DOI 10.5281/ZENODO.7809339
[6]  
Astrahan M. M., 1976, ACM Transactions on Database Systems, V1, P97, DOI 10.1145/320455.320457
[7]   Compiler Support for Sparse Tensor Computations in MLIR [J].
Bik, Aart ;
Koanantakool, Penporn ;
Shpeisman, Tatiana ;
Vasilache, Nicolas ;
Zheng, Bixia ;
Kjolstad, Fredrik .
ACM TRANSACTIONS ON ARCHITECTURE AND CODE OPTIMIZATION, 2022, 19 (04)
[8]   A provable time and space efficient implementation of NESL [J].
Blelloch, GE ;
Greiner, J .
ACM SIGPLAN NOTICES, 1996, 31 (06) :213-225
[9]  
Blelloch Guy E., 1992, CMUCS92103 CARN MELL
[10]  
Boncz P, 2014, LECT NOTES COMPUT SC, V8391, P61, DOI 10.1007/978-3-319-04936-6_5