skip to main content
research-article

Data flow fusion with series expressions in Haskell

Published:23 September 2013Publication History
Skip Abstract Section

Abstract

Existing approaches to array fusion can deal with straight-line producer consumer pipelines, but cannot fuse branching data flows where a generated array is consumed by several different consumers. Branching data flows are common and natural to write, but a lack of fusion leads to the creation of an intermediate array at every branch point. We present a new array fusion system that handles branches, based on Waters's series expression framework, but extended to work in a functional setting. Our system also solves a related problem in stream fusion, namely the introduction of duplicate loop counters. We demonstrate speedup over existing fusion systems for several key examples.

References

  1. Paul Caspi, Daniel Pilaud, Nicolas Halbwachs, and John Plaice. Lustre: A declarative language for programming synchronous systems. In POPL: Principles of Programming Languages. ACM, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Paul Caspi and Marc Pouzet. A Functional Extension to Lustre. In International Symposium on Languages for Intentional Programming. World Scientific, 1995.Google ScholarGoogle Scholar
  3. Paul Caspi and Marc Pouzet. Synchronous Kahn networks. In ICFP: International Conference on Functional Programming. ACM, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Manuel M. T. Chakravarty and Gabriele Keller. Functional array fusion. In ICFP: International Conference on Functional Programming. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Siddhartha Chatterjee, Guy E. Blelloch, and Allan L. Fisher. Size and access inference for data-parallel programs. In PLDI: Programming Language Design and Implementation. ACM, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Koen Claessen, Mary Sheeran, and Joel Svensson. Expressive array constructs in an embedded GPU kernel programming language. In DAMP: Declarative Aspects of Multicore Programming. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Duncan Coutts, Roman Leshchinskiy, and Don Stewart. Stream fusion: from lists to streams to nothing at all. In ICFP: Internal Conference of Functional Programming. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Andrew Gill, John Launchbury, and Simon L Peyton Jones. A short cut to deforestation. In FPCA: Functional Programming Languages and Computer Architecture. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Clemens Grelck, Karsten Hinckfuß, and Sven-Bodo Scholz. With-loop fusion for data locality and parallelism. In IFL: Implementation and Application of Functional Languages. Springer-Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Nicolas Halbwachs, Pascal Raymond, and Christophe Ratel. Generating efficient code from data-flow programs. In PLILP: Programming Langauge Implementation and Logic Programming, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  11. Zhenjiang Hu, Hideya Iwasaki, Masato Takeichi, and Akihiko Takano. Tupling calculation eliminates multiple data traversals. In ICFP: International Conference on Functional Programming. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. John Hughes. The Design and Implementation of Programming Languages. PhD thesis, Programming Research Group, Oxford University, July 1983.Google ScholarGoogle Scholar
  13. Gabriele Keller, Manuel M. T. Chakravarty, Roman Leshchinskiy, Simon L. Peyton Jones, and Ben Lippmeier. Regular, Shape-polymorphic, Parallel Arrays in Haskell. In ICFP: International Conference on Functional Programming. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. John Launchbury and Simon L. Peyton Jones. Lazy functional state threads. In PLDI: Programming Language Design and Implementation. ACM, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Simon Marlow, Alexey Rodriguez Yakushev, and Simon Peyton Jones. Faster laziness using dynamic pointer tagging. In ICFP: International Conference on Functional Programming, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Erik Meijer, Maarten Fokkinga, and Ross Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In FPCA: Functional Programming Languages and Computer Architecture. ACM, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Simon Peyton Jones and John Launchbury. Unboxed values as first class citizens in a non-strict functional language. In FPCA: Functional Programming and Computer Architecture. ACM, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Simon Peyton Jones, Roman Leshchinskiy, Gabriele Keller, and Manuel M. T. Chakravarty. Harnessing the multicores: Nested data parallelism in Haskell. In FSTTCS: Foundations of Software Technology and Theoretical Computer Science. Schloss Dagstuhl, 2008.Google ScholarGoogle Scholar
  19. Marc Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, April 2006.Google ScholarGoogle Scholar
  20. Tiark Rompf et al. Optimizing data structures in high-level programs: new directions for extensible compilers based on staging. In POPL: Principles of Programming Languages. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Vivek Sarkar and Guang R Gao. Optimization of array accesses by collective loop transformations. In International Conference on Supercomputing. ACM, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Olin Shivers. The anatomy of a loop. In ICFP: International Conference on Functional Programming. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Guy Steele. Common Lisp the Language. Digital Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Philip Wadler. Listlessness is better than laziness. In LISP and Functional Programming, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Joe D. Warren. A hierarchical basis for reordering transformations. In POPL: Principles of Programming Languages. ACM, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Richard C. Waters. Efficient interpretation of synchronizable series expressions. In PLDI: Programming Language Design and Implementation. ACM, 1987.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Richard C. Waters. Automatic transformation of series expressions into loops. TOPLAS: Transactions on Programming Languages and Systems, 13(1), 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Data flow fusion with series expressions in Haskell

    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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 48, Issue 12
      Haskell '13
      December 2013
      149 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2578854
      Issue’s Table of Contents
      • cover image ACM Conferences
        Haskell '13: Proceedings of the 2013 ACM SIGPLAN symposium on Haskell
        September 2013
        158 pages
        ISBN:9781450323833
        DOI:10.1145/2503778

      Copyright © 2013 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 23 September 2013

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!