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 2014Publication 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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. C. Burke and R. Hui. J for the APL programmer. SIGAPL APL Quote Quad, 27(1):11--17, Sept. 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Frigo. A fast Fourier transform compiler. In Proc. Programming Language Design and Implementation (PLDI), pages 169--180, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. K. E. Iverson. Programming Language. John Wiley & Sons Inc, 1962. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Kx Systems. K reference manual version 2.0. 1998.Google ScholarGoogle Scholar
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Püschel, F. Franchetti, and Y. Voronenko. Encyclopedia of Parallel Computing, chapter Spiral. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  20. S.-B. Scholz. Single assignment C -- efficient support for high-level array operations in a functional setting, 2003.Google ScholarGoogle Scholar
  21. A. Sinkarovs and S.-B. Scholz. Data layout inference for code vectorisation. In HPCS, pages 527--534. IEEE, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  22. D. G. Spampinato and M. Püschel. A basic linear algebra compiler. In International Symposium on Code Generation and Optimization (CGO), 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. W. Taha and T. Sheard. Metaml and multi-stage programming with explicit annotations. Theor. Comput. Sci., 248(1-2):211--242, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

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

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • 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

        Copyright © 2014 ACM

        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].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 9 June 2014

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • tutorial
        • Research
        • Refereed limited

        Acceptance Rates

        ARRAY'14 Paper Acceptance Rate17of25submissions,68%Overall Acceptance Rate17of25submissions,68%

        Upcoming Conference

        PLDI '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader