Abstract
Parallel programming, whether imperative or functional, has long focused on arrays as the central data type. Meanwhile, typed functional programming has explored a variety of data types, including lists and various forms of trees. Generic functional programming decomposes these data types into a small set of fundamental building blocks: sum, product, composition, and their associated identities. Definitions over these few fundamental type constructions then automatically assemble into algorithms for an infinite variety of data types—some familiar and some new. This paper presents generic functional formulations for two important and well-known classes of parallel algorithms: parallel scan (generalized prefix sum) and fast Fourier transform (FFT). Notably, arrays play no role in these formulations. Consequent benefits include a simpler and more compositional style, much use of common algebraic patterns and freedom from possibility of run-time indexing errors. The functional generic style also clearly reveals deep commonality among what otherwise appear to be quite different algorithms. Instantiating the generic formulations, two well-known algorithms for each of parallel scan and FFT naturally emerge, as well as two possibly new algorithms.
- Roland Backhouse, Jeremy Gibbons, Ralf Hinze, and Johan Jeuring. Datatype-Generic Programming: International Spring School, Revised Lectures . Lecture Notes in Computer Science. Springer Berlin Heidelberg, April 2007.Google Scholar
- Jost Berthold, Mischa Dieterle, Oleg Lobachev, and Rita Loogen. Parallel FFT with Eden skeletons . In International Conference on Parallel Computing Technologies , PaCT ’09, pages 73–83, 2009. Google ScholarDigital Library
- Richard Bird and Lambert Meertens. Nested Datatypes . In Mathematics of Program Construction, pages 52–67, 1998.Google Scholar
- Per Bjesse, Koen Claessen, Mary Sheeran, and Satnam Singh. Lava: Hardware design in Haskell . In International Conference on Functional Programming , pages 174–184, 1998. Google ScholarDigital Library
- Guy E. Blelloch. Prefix sums and their applications . Technical Report CMU-CS-90-190, School of Computer Science, Carnegie Mellon University, November 1990.Google Scholar
- Guy E. Blelloch. Programming parallel algorithms . Communications of the ACM, 39:85–97, 1996. Google ScholarDigital Library
- R. P. Brent and H. T. Kung. A regular layout for parallel adders . IEEE Transactions on Computers, 31(3), March 1982. Google ScholarDigital Library
- James W. Cooley and John W. Tukey. An algorithm for the machine calculation of complex Fourier series. Mathematics of Computation , 19:297–301, 1965. Google ScholarCross Ref
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms. The MIT Press, 3rd edition, 2009.Google Scholar
- G.C. Danielson and C. Lanczos. Some improvements in practical Fourier analysis and their application to X-ray scattering from liquids. Journal of the Franklin Institute, 233(5):435–452, 1942. Google ScholarCross Ref
- Fer-Jan de Vries. A functional program for the Fast Fourier Transform . SIGPLAN Notices, pages 67–74, January 1988. Google ScholarDigital Library
- Richard A. Eisenberg, Dimitrios Vytiniotis, Simon L. Peyton Jones, and Stephanie Weirich. Closed type families with overlapping equations . In Principles of Programming Languages, pages 671–684, 2014.Google Scholar
- Richard A. Eisenberg, Stephanie Weirich, and Hamidhasan G. Ahmed. Visible type application . In European Symposium on Programming Languages and Systems , pages 229–254, 2016. Google ScholarDigital Library
- Conal Elliott. Denotational design with type class morphisms . Technical Report 2009-01, LambdaPix, March 2009.Google Scholar
- Conal Elliott. Compiling to categories . Proc. ACM Program. Lang., 1(ICFP), September 2017. Google ScholarDigital Library
- Matteo Frigo. A fast Fourier transform compiler . In PLDI, volume 34, pages 169–180. ACM, May 1999. Google ScholarDigital Library
- Jeremy Gibbons. Upwards and downwards accumulations on trees . In Mathematics of Program Construction, 1993.Google ScholarCross Ref
- Jeremy Gibbons. Generic downwards accumulations . Science of Computer Programming, 37(1-3):37–65, May 2000. Google ScholarDigital Library
- Sergei Gorlatch. Programming with divide-and-conquer skeletons: A case study of FFT. The Journal of Supercomputing, 1998. Google ScholarDigital Library
- Pieter H. Hartel and Willem G. Vree. Arrays in a lazy functional language — a case study: The fast Fourier transform . In 2nd Arrays, functional languages, and parallel systems (ATABLE) , 1992.Google Scholar
- Michael T. Heideman, Don H. Johnson, and C. Sidney Burrus. Gauss and the history of the fast Fourier transform. IEEE ASSP Magazine , 1(4):14–21, October 1984. Google Scholar
- Ralf Hinze. Memo functions, polytypically! In 2nd Workshop on Generic Programming, pages 17–32, 2000.Google Scholar
- Ralf Hinze. An algebra of scans . In International Conference on Mathematics of Program Construction, pages 186–210, 2004. Google ScholarCross Ref
- Gérard Huet. The zipper . Journal of Functional Programming, 7(5):549–554, September 1997. Google ScholarDigital Library
- John Hughes. Generalising monads to arrows . Science of Computer Programming, 37:67–111, 1998. Google ScholarDigital Library
- Darius Jahandarie, Conor McBride, and João Cristóvão. newtype-generics , 2014. Haskell library.Google Scholar
- C. Barry Jay. Matrices, monads and the fast Fourier transform . Technical Report UTSSOCS-93.13, University of Technology, Sydney, 1993.Google Scholar
- Steven G. Johnson. Diagram to illustrate the general Cooley-Tukey FFT algorithm, 2010. URL https://en.wikipedia.org/wiki/ Cooley%E2%80%93Tukey_FFT_algorithm#General_factorizations .Google Scholar
- Geraint Jones. Deriving the fast Fourier algorithm by calculation . In Glasgow Workshop on Functional Programming, 1989.Google Scholar
- Geraint Jones. A fast flutter by the Fourier transform. In IV Higher Order Workshop, Banff 1990, pages 77–84, 1991. Google ScholarCross Ref
- Gabriele Keller and Manuel M. T. Chakravarty. On the distributed implementation of aggregate data structures by program transformation . In Parallel and Distributed Processing, pages 108–122, 1999.Google ScholarCross Ref
- Gabriele Keller, Manuel M. T. Chakravarty, Roman Leshchinskiy, and Simon Peyton. Regular, shape-polymorphic, parallel arrays in Haskell . In International Conference on Functional Programming, 2010. Google ScholarDigital Library
- Oleg Kiselyov, Kedar N. Swadi, and Walid Taha. A methodology for generating verified combinatorial circuits . In EMSOFT, 2004.Google ScholarDigital Library
- Richard E Ladner and Michael J Fischer. Parallel prefix computation. Journal of the ACM, 27(4):831–838, 1980. Google ScholarDigital Library
- José Pedro Magalhães, Atze Dijkstra, Johan Jeuring, and Andres Löh. A generic deriving mechanism for Haskell . In Haskell Symposium , pages 37–48, 2010. Google ScholarDigital Library
- José Pedro Magalhães and Andres Löh. A formal comparison of approaches to datatype-generic programming . In Workshop on Mathematically Structured Functional Programming , pages 50–67, March 2012. Google ScholarCross Ref
- José Pedro Magalhães et al. GHC.Generics, 2011. URL https://wiki.haskell.org/GHC.Generics . Haskell wiki page.Google Scholar
- Conor McBride. The derivative of a regular type is its type of one-hole contexts (extended abstract) , 2001. Unpublished.Google Scholar
- Conor McBride and Ross Paterson. Applicative programming with effects . Journal of Functional Programming, 18(1), 2008. Google ScholarDigital Library
- John T. O’Donnell. A correctness proof of parallel scan . Parallel Processing Letters, 04(03):329–338, 1994. Google ScholarCross Ref
- David Sharp and Martin Cripps. Synthesis of the fast Fourier transform algorithm by functional language program transformation. In Euromicro Workshop on Parallel and Distributed Processing, pages 136–143, January 1993. Google ScholarCross Ref
- Mary Sheeran. Parallel prefix network generation: An application of functional programming . In Hardware Design and Functional Languages , 2007.Google Scholar
- Mary Sheeran. Functional and dynamic programming in the design of parallel prefix networks . Journal of Functional Programming , 21(1):59–114, January 2011. Google ScholarDigital Library
- J. Sklansky. Conditional-sum addition logic. IRE Transactions on Electronic Computers, EC-9(2):226–231, June 1960. Google ScholarCross Ref
- Brent A Yorgey, Stephanie Weirich, Julien Cretin, Simon Peyton Jones, Dimitrios Vytiniotis, and José Pedro Magalhães. Giving Haskell a promotion . In Workshop on types in language design and implementation, 2012.Google ScholarDigital Library
Index Terms
- Generic functional parallel algorithms: scan and FFT
Recommendations
High-Performance Radix-2, 3 and 5 Parallel 1-D Complex FFT Algorithms for Distributed-Memory Parallel Computers
In this paper, we propose high-performance radix-2, 3 and 5 parallel 1-D complex FFT algorithms for distributed-memory parallel computers. We use the four-step or six-step FFT algorithms to implement the radix-2, 3 and 5 parallel 1-D complex FFT ...
A parallel 1-D FFT algorithm for the Hitachi SR8000
In this paper, we propose a high-performance parallel one-dimensional fast Fourier transform (FFT) algorithm on clusters of vector symmetric multiprocessor (SMP) nodes. The four-step FFT algorithm can be altered into a five-step FFT algorithm to expand ...
Design and Simulation of 32-Point FFT Using Radix-2 Algorithm for FPGA Implementation
ACCT '12: Proceedings of the 2012 Second International Conference on Advanced Computing & Communication TechnologiesThe Fast Fourier Transform (FFT) is one of the rudimentary operations in field of digital signal and image processing. Some of the very vital applications of the fast fourier transform include Signal analysis, Sound filtering, Data compression, Partial ...
Comments