Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3520306.3534500acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article
Open access

Parallel scan as a multidimensional array problem

Published: 13 June 2022 Publication History

Abstract

For many algorithms, it is challenging to identify a suitable parallel version, as the design space is typically very large. In this paper we demonstrate how rank-polymorphic array languages can be used as a tool to explore such design spaces through concise high-level specifications. If input data can be organised into a multi-dimensional array, and the algorithm can be stated as a recursive traversal over sub-arrays, array languages offer a lot of expressive power. The reason for this is that array shapes can be used to guide recursive traversals. Conciseness of specifications comes from array reshapes that move the desired elements into canonical hyperplanes.
As a case study, we discuss several variants of implementing prefix sums (also known as scans) in SaC. We demonstrate how small code adjustments suffice to change the concurrency pattern exposed to the compiler. It turns out that variability that is typically achieved by generic inductive data types such as binary trees is a special case of what is offered by the array paradigm.

References

[1]
Guy E. Blelloch. 1990. Prefix Sums and Their Applications. Carnegie Mellon University, USA.
[2]
Guy E. Blelloch. 1992. NESL: A Nested Data-Parallel Language. Carnegie Mellon University, USA.
[3]
Conal Elliott. 2017. Generic Functional Parallel Algorithms: Scan and FFT. Proc. ACM Program. Lang., 1, ICFP (2017), Article 7, aug, 25 pages. https://doi.org/10.1145/3110251
[4]
Message Passing Interface Forum. 1994. MPI: A Message-Passing Interface Standard. University of Tennessee, USA.
[5]
Clemens Grelck. 2005. Shared Memory Multiprocessor Support for Functional Array Processing in Sac. Journal of Functional Programming, 15, 3 (2005), 353–401. https://doi.org/10.1017/S0956796805005538
[6]
Clemens Grelck, Sven-Bodo Scholz, and Kai Trojahner. 2005. With-Loop Scalarization – Merging Nested Array Operations. In Implementation of Functional Languages, Phil Trinder, Greg J. Michaelson, and Ricardo Peña (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 118–134. isbn:978-3-540-27861-0 https://doi.org/10.1007/978-3-540-27861-0_8
[7]
Troels Henriksen. 2017. Design and Implementation of the Futhark Programming Language. Ph. D. Dissertation. University of Copenhagen. Universitetsparken 5, 2100 København.
[8]
Kenneth E. Iverson. 1962. A Programming Language. John Wiley & Sons, Inc., New York, NY, USA. isbn:0471430145
[9]
Sven-Bodo Scholz. 1998. With-loop-folding in Sac — Condensing Consecutive Array Operations. In Implementation of Functional Languages, 9th International Workshop (IFL’97), St. Andrews, UK, Selected Papers, Chris Clack, Tony Davie, and Kevin Hammond (Eds.) (Lecture Notes in Computer Science, Vol. 1467). Springer, 72–92. isbn:978-3-540-64849-9 https://doi.org/10.1007/BFb0055425
[10]
Sven-Bodo Scholz. 2003. Single Assignment C: Efficient Support for High-level Array Operations in a Functional Setting. J. Funct. Program., 13, 6 (2003), Nov., 1005–1059. issn:0956-7968 https://doi.org/10.1017/S0956796802004458
[11]
Sven-Bodo Scholz and Artjoms Šinkarovs. 2019. Tensor Comprehensions in SaC. In Proceedings of the 31st Symposium on Implementation and Application of Functional Languages (IFL ’19). Association for Computing Machinery, New York, NY, USA. Article 15, 13 pages. isbn:9781450375627 https://doi.org/10.1145/3412932.3412947
[12]
Justin Slepak, Olin Shivers, and Panagiotis Manolios. 2014. An Array-Oriented Language with Static Rank Polymorphism. In Programming Languages and Systems, Zhong Shao (Ed.). Springer, Berlin, Heidelberg. 27–46. isbn:978-3-642-54833-8 https://doi.org/10.1007/978-3-642-54833-8_3
[13]
Roger Stokes. 15 June 2015. Learning J. An Introduction to the J Programming Language. http://www.jsoftware.com/help/learning/contents.htm [Accessed 2020/02]

Cited By

View all
  • (2024)Fusing Gathers with Integer Linear ProgrammingProceedings of the 1st ACM SIGPLAN International Workshop on Functional Programming for Productivity and Performance10.1145/3677997.3678227(10-23)Online publication date: 28-Aug-2024
  • (2023)Rank-Polymorphism for Shape-Guided BlockingProceedings of the 11th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing10.1145/3609024.3609410(1-14)Online publication date: 30-Aug-2023

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ARRAY 2022: Proceedings of the 8th ACM SIGPLAN International Workshop on Libraries, Languages and Compilers for Array Programming
June 2022
57 pages
ISBN:9781450392693
DOI:10.1145/3520306
This work is licensed under a Creative Commons Attribution 4.0 International License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 June 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. algorithms
  2. array languages
  3. functional programming
  4. parallelism
  5. prefix sum
  6. rank polymorphism

Qualifiers

  • Research-article

Conference

ARRAY '22
Sponsor:

Acceptance Rates

Overall Acceptance Rate 17 of 25 submissions, 68%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)186
  • Downloads (Last 6 weeks)27
Reflects downloads up to 24 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Fusing Gathers with Integer Linear ProgrammingProceedings of the 1st ACM SIGPLAN International Workshop on Functional Programming for Productivity and Performance10.1145/3677997.3678227(10-23)Online publication date: 28-Aug-2024
  • (2023)Rank-Polymorphism for Shape-Guided BlockingProceedings of the 11th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing10.1145/3609024.3609410(1-14)Online publication date: 30-Aug-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media