skip to main content
10.1145/2627373.2627376acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
tutorial

Abstracting Vector Architectures in Library Generators: Case Study Convolution Filters

Published: 09 June 2014 Publication History

Abstract

We present FGen, a program generator for high performance convolution operations (finite-impulse-response filters). The generator uses an internal mathematical DSL to enable structural optimization at a high level of abstraction. We use FGen as a testbed to demonstrate how to provide modular and extensible support for modern SIMD vector architectures in a DSL-based generator. Specifically, we show how to combine staging and generic programming with type classes to abstract over both the data type (real or complex) and the target architecture (e.g., SSE or AVX) when mapping DSL expressions to C code with explicit vector intrinsics. Benchmarks shows that the generated code is highly competitive with commercial libraries.

References

[1]
B. Aktemur, Y. Kameyama, O. Kiselyov, and C.-c. Shan. Shonan challenge for generative programming: short position paper. In Proc. Partial evaluation and program manipulation (PEPM), pages 147--154, 2013.
[2]
P. Bientinesi, J. A. Gunnels, M. E. Myers, E. Quintana-Orti, and R. van de Geijn. The science of deriving dense linear algebra algorithms. ACM Trans. on Mathematical Software, 31(1):1--26, 2005.
[3]
C. Burke and R. Hui. J for the APL programmer. SIGAPL APL Quote Quad, 27(1):11--17, Sept. 1996.
[4]
A. Cohen, S. Donadio, M. jesus Garzaran, C. Herrmann, and D. Padua. In search of a program generator to implement generic transformations for high-performance computing. In 1 st MetaOCaml Workshop (associated with GPCE, pages 166771--7, 2004.
[5]
Z. DeVito, J. Hegarty, A. Aiken, P. Hanrahan, and J. Vitek. Terra: A multi-stage language for high-performance computing. SIGPLAN Not., 48(6):105--116, June 2013.
[6]
F. Franchetti, Y. Voronenko, and M. Püschel. Formal loop merging for signal transforms. In Programming Languages Design and Implementation (PLDI), pages 315--326, 2005.
[7]
M. Frigo. A fast Fourier transform compiler. In Proc. Programming Language Design and Implementation (PLDI), pages 169--180, 1999.
[8]
J. A. Gunnels, F. G. Gustavson, G. M. Henry, and R. A. van de Geijn. FLAME: Formal linear algebra methods environment. ACM Trans. on Mathematical Software, 27(4):422--455, 2001.
[9]
K. E. Iverson. Programming Language. John Wiley & Sons Inc, 1962.
[10]
G. Keller, M. M. Chakravarty, R. Leshchinskiy, S. Peyton Jones, and B. Lippmeier. Regular, shape-polymorphic, parallel arrays in Haskell. volume 45, pages 261--272, New York, NY, USA, Sept. 2010. ACM.
[11]
Kx Systems. K reference manual version 2.0. 1998.
[12]
J. McGraw, S. Skedzielewski, S. Allan, and R. Oldehoeft. Sisal: Streams and iteration in a single assignment language: Reference manual version 1.2. 1998.
[13]
G. Ofenbeck, T. Rompf, A. Stojanov, M. Odersky, and M. Püschel. Spiral in Scala: Towards the systematic construction of generators for performance libraries. In International Conference on Generative Programming: Concepts & Experiences (GPCE), pages 125--134, 2013.
[14]
M. Püschel, F. Franchetti, and Y. Voronenko. Encyclopedia of Parallel Computing, chapter Spiral. Springer, 2011.
[15]
M. Püschel, J. M. F. Moura, J. Johnson, D. Padua, M. Veloso, B. Singer, J. Xiong, F. Franchetti, A. Gacic, Y. Voronenko, K. Chen, R. W. Johnson, and N. Rizzolo. SPIRAL: Code generation for DSP transforms. Proceedings of the IEEE, special issue on "Program Generation, Optimization, and Adaptation", 93(2):232-- 275, 2005.
[16]
J. Ragan-Kelley, C. Barnes, A. Adams, S. Paris, F. Durand, and S. P. Amarasinghe. Halide: a language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. In H.-J. Boehm and C. Flanagan, editors, PLDI, pages 519--530. ACM, 2013.
[17]
T. Rompf and M. Odersky. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled dsls. Commun. ACM, 55(6):121--130, 2012.
[18]
T. Rompf, A. K. Sujeeth, N. Amin, K. Brown, V. Jovanovic, H. Lee, M. Jonnalagedda, K. Olukotun, and M. Odersky. Optimizing data structures in high-level programs. In Proc. Principles of programming languages (POPL), pages 497--510, 2013.
[19]
T. Rompf, A. K. Sujeeth, H. Lee, K. J. Brown, H. Chafi, M. Odersky, and K. Olukotun. Building-blocks for performance oriented DSLs. DSL, 2011.
[20]
S.-B. Scholz. Single assignment C -- efficient support for high-level array operations in a functional setting, 2003.
[21]
A. Sinkarovs and S.-B. Scholz. Data layout inference for code vectorisation. In HPCS, pages 527--534. IEEE, 2013.
[22]
D. G. Spampinato and M. Püschel. A basic linear algebra compiler. In International Symposium on Code Generation and Optimization (CGO), 2014.
[23]
A. K. Sujeeth, H. Lee, K. J. Brown, T. Rompf, M. Wu, A. R. Atreya, M. Odersky, and K. Olukotun. OptiML: an implicitly parallel domain-specific language for machine learning. In Proceedings of the 28th International Conference on Machine Learning, ICML, 2011.
[24]
A. K. Sujeeth, T. Rompf, K. J. Brown, H. Lee, H. Chafi, V. Popic, M. Wu, A. Prokopec, V. Jovanovic, M. Odersky, and K. Olukotun. Composition and reuse with compiled domain-specific languages. In G. Castagna, editor, ECOOP, volume 7920 of Lecture Notes in Computer Science, pages 52--78. Springer, 2013.
[25]
W. Taha and T. Sheard. Metaml and multi-stage programming with explicit annotations. Theor. Comput. Sci., 248(1-2):211--242, 2000.
[26]
V. Ureche, T. Rompf, A. K. Sujeeth, H. Chafi, and M. Odersky. StagedSAC: a case study in performance-oriented dsl development. In O. Kiselyov and S. Thompson, editors, PEPM, pages 73--82. ACM, 2012.
[27]
R. Whaley, A. Petitet, and J. Dongarra. Automated empirical optimization of software and the ATLAS project. Parallel Computing, 27(1-2):3--35, 2001.

Cited By

View all
  • (2019)A stage-polymorphic IR for compiling MATLAB-style dynamic tensor expressionsProceedings of the 18th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3357765.3359514(34-47)Online publication date: 21-Oct-2019
  • (2018)SIMD intrinsics on managed language runtimesProceedings of the 2018 International Symposium on Code Generation and Optimization - CGO 201810.1145/3179541.3168810(2-15)Online publication date: 2018
  • (2018)SIMD intrinsics on managed language runtimesProceedings of the 2018 International Symposium on Code Generation and Optimization10.1145/3168810(2-15)Online publication date: 24-Feb-2018
  • Show More Cited By

Index Terms

  1. Abstracting Vector Architectures in Library Generators: Case Study Convolution Filters

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      ARRAY'14: Proceedings of ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming
      June 2014
      112 pages
      ISBN:9781450329378
      DOI:10.1145/2627373
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 09 June 2014

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Abstraction
      2. Domain Specific Language
      3. Performance
      4. Program Generation
      5. SIMD Vector Extensions

      Qualifiers

      • Tutorial
      • Research
      • Refereed limited

      Conference

      PLDI '14
      Sponsor:

      Acceptance Rates

      ARRAY'14 Paper Acceptance Rate 17 of 25 submissions, 68%;
      Overall Acceptance Rate 17 of 25 submissions, 68%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)3
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 20 Feb 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2019)A stage-polymorphic IR for compiling MATLAB-style dynamic tensor expressionsProceedings of the 18th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3357765.3359514(34-47)Online publication date: 21-Oct-2019
      • (2018)SIMD intrinsics on managed language runtimesProceedings of the 2018 International Symposium on Code Generation and Optimization - CGO 201810.1145/3179541.3168810(2-15)Online publication date: 2018
      • (2018)SIMD intrinsics on managed language runtimesProceedings of the 2018 International Symposium on Code Generation and Optimization10.1145/3168810(2-15)Online publication date: 24-Feb-2018
      • (2017)Structure-Aware Linear Solver for Realtime Convex Optimization for Embedded SystemsIEEE Embedded Systems Letters10.1109/LES.2017.27004019:3(61-64)Online publication date: 1-Sep-2017
      • (2016)Reflections on LMS: exploring front-end alternativesProceedings of the 2016 7th ACM SIGPLAN Symposium on Scala10.1145/2998392.2998399(41-50)Online publication date: 30-Oct-2016

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media