Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3453483.3454079acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article
Open access

Reverse engineering for reduction parallelization via semiring polynomials

Published: 18 June 2021 Publication History

Abstract

Parallel reduction, which summarizes a given dataset, e.g., the total, average, and maximum, plays a crucial role in parallel programming. This paper presents a new approach, reverse engineering, to automatically discovering nontrivial parallel reductions in sequential programs. The body of the sequential reduction loop is regarded as a black box, and its input-output behaviors are sampled. If the behaviors correspond to a set of linear polynomials over a semiring, a divide-and-conquer parallel reduction is generated. Auxiliary reverse-engineering methods enable a long and nested loop body to be decomposed, which makes our parallelization scheme applicable to various types of reduction loops. This approach is not only simple and efficient but also agnostic to the details of the input program. Its potential is demonstrated through several use case scenarios. A proof-of-concept implementation successfully inferred linear polynomials for nearly all of the 74 benchmarks exhaustively collected from the literature. These characteristics and experimental results demonstrate the promise of the proposed approach, despite its inherent unsoundness.

References

[1]
Fabrizio Biondi, Sébastien Josse, Axel Legay, and Thomas Sirvent. 2017. Effectiveness of synthesis in concolic deobfuscation. Comput. Secur., 70 (2017), 500–515. https://doi.org/10.1016/j.cose.2017.07.006
[2]
Guy E. Blelloch. 1993. Prefix Sums and Their Applications. In Synthesis of Parallel Algorithms, John H. Reif (Ed.). Morgan Kaufmann Publishers. https://doi.org/10.1184/R1/6608579.v1
[3]
Juan Manuel Martinez Caamaño, Manuel Selva, Philippe Clauss, Artyom Baloian, and Willy Wolff. 2017. Full runtime polyhedral optimizing loop transformations with the generation, instantiation, and scheduling of code-bones. Concurr. Comput. Pract. Exp., 29, 15 (2017), https://doi.org/10.1002/cpe.4192
[4]
Simone Campanoni, Glenn Holloway, Gu-Yeon Wei, and David Brooks. 2015. HELIX-UP: Relaxing program semantics to unleash parallelization. In Proceedings of the 13th Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO ’15). IEEE, 235–245. https://doi.org/10.1109/CGO.2015.7054203
[5]
Rezaul Chowdhury, Pramod Ganapathi, Stephen L. Tschudi, Jesmin Jahan Tithi, Charles Bachmeier, Charles E. Leiserson, Armando Solar-Lezama, Bradley C. Kuszmaul, and Yuan Tang. 2017. Autogen: Automatic Discovery of Efficient Recursive Divide-&-Conquer Algorithms for Solving Dynamic Programming Problems. ACM Trans. Parallel Comput., 4, 1 (2017), 4:1–4:30. https://doi.org/10.1145/3125632
[6]
Bruce Collie, Jackson Woodruff, and Michael F. P. O’Boyle. 2020. Modeling Black-Box Components with Probabilistic Synthesis. In Proceedings of the 19th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, GPCE 2020, Jeff Gray (Ed.). ACM. https://doi.org/10.1145/3425898.3426952
[7]
Azadeh Farzan and Victor Nicolet. 2017. Synthesis of divide and conquer parallelism for loops. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, Barcelona, Spain, June 18-23, 2017, Albert Cohen and Martin T. Vechev (Eds.). ACM, 540–555. https://doi.org/10.1145/3062341.3062355
[8]
Azadeh Farzan and Victor Nicolet. 2019. Modular divide-and-conquer parallelization of nested loops. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2019, Phoenix, AZ, USA, June 22-26, 2019, Kathryn S. McKinley and Kathleen Fisher (Eds.). ACM, 610–624. https://doi.org/10.1145/3314221.3314612
[9]
Grigory Fedyukovich, Maaz Bin Safeer Ahmad, and Rastislav Bodík. 2017. Gradual synthesis for static parallelization of single-pass array-processing programs. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, Barcelona, Spain, June 18-23, 2017, Albert Cohen and Martin T. Vechev (Eds.). ACM, 572–585. https://doi.org/10.1145/3062341.3062382
[10]
Allan L. Fisher and Anwar M. Ghuloum. 1994. Parallelizing complex scans and reductions. In Proceedings of the ACM SIGPLAN’94 Conference on Programming Language Design and Implementation (PLDI), Orlando, Florida, June 20-24, 1994. 135–146. https://doi.org/10.1145/178243.178255
[11]
Alfons Geser and Sergei Gorlatch. 1999. Parallelizing functional programs by generalization. Journal of Functional Programming, 9, 6 (1999), 649–673. https://doi.org/10.1017/S0956796899003536
[12]
Patrice Godefroid and Ankur Taly. 2012. Automated synthesis of symbolic instruction encodings from I/O samples. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’12, Beijing, China - June 11 - 16, 2012, Jan Vitek, Haibo Lin, and Frank Tip (Eds.). ACM, 441–452. https://doi.org/10.1145/2254064.2254116
[13]
Sumit Gulwani, Vijay Anand Korthikanti, and Ashish Tiwari. 2011. Synthesizing geometry constructions. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, June 4-8, 2011, Mary W. Hall and David A. Padua (Eds.). ACM, 50–61. https://doi.org/10.1145/1993498.1993505
[14]
Sumit Gulwani, Oleksandr Polozov, and Rishabh Singh. 2017. Program Synthesis. Found. Trends Program. Lang., 4, 1-2 (2017), 1–119. https://doi.org/10.1561/2500000010
[15]
Mohammad R. Haghighat and Constantine D. Polychronopoulos. 1996. Symbolic Analysis for Parallelizing Compilers. ACM Trans. Program. Lang. Syst., 18, 4 (1996), 477–518. https://doi.org/10.1145/233561.233568
[16]
Liang Han, Wei Liu, and James Tuck. 2010. Speculative parallelization of partial reduction variables. In Proceedings of the CGO 2010, The 8th International Symposium on Code Generation and Optimization, Toronto, Ontario, Canada, April 24-28, 2010, Andreas Moshovos, J. Gregory Steffan, Kim M. Hazelwood, and David R. Kaeli (Eds.). ACM, 141–150. https://doi.org/10.1145/1772954.1772975
[17]
Susmit Jha, Sumit Gulwani, Sanjit A. Seshia, and Ashish Tiwari. 2010. Oracle-guided component-based program synthesis. In Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering - Volume 1, ICSE 2010, Cape Town, South Africa, 1-8 May 2010, Jeff Kramer, Judith Bishop, Premkumar T. Devanbu, and Sebastián Uchitel (Eds.). ACM, 215–224. https://doi.org/10.1145/1806799.1806833
[18]
Peng Jiang, Linchuan Chen, and Gagan Agrawal. 2018. Revealing parallel scans and reductions in recurrences through function reconstruction. In Proceedings of the 27th International Conference on Parallel Architectures and Compilation Techniques, PACT 2018, Limassol, Cyprus, November 01-04, 2018, Skevos Evripidou, Per Stenström, and Michael F. P. O’Boyle (Eds.). ACM, 10:1–10:13. https://doi.org/10.1145/3243176.3243204
[19]
Xuan-Bach D. Le, Duc-Hiep Chu, David Lo, Claire Le Goues, and Willem Visser. 2017. S3: syntax- and semantic-guided repair synthesis via programming by examples. In Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2017, Paderborn, Germany, September 4-8, 2017, Eric Bodden, Wilhelm Schäfer, Arie van Deursen, and Andrea Zisman (Eds.). ACM, 593–604. https://doi.org/10.1145/3106237.3106309
[20]
Guilherme Vieira Leobas and Fernando Magno Quintão Pereira. 2020. Semiring Optimizations: Dynamic Elision of Expressions with Identity and Absorbing Elements. In Proceedings of the 2020 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2020, part of SPLASH 2020, David Grove (Ed.). ACM. https://doi.org/10.1145/3428199
[21]
Yanhong A. Liu, Scott D. Stoller, Ning Li, and Tom Rothamel. 2005. Optimizing aggregate array computations in loops. ACM Transactions on Programming Languages and Systems, 27, 1 (2005), 91–125. https://doi.org/10.1145/1053468.1053471
[22]
Kiminori Matsuzaki, Zhenjiang Hu, and Masato Takeichi. 2006. Towards automatic parallelization of tree reductions in dynamic programming. In SPAA 2006: Proceedings of the 18th Annual ACM Symposium on Parallel Algorithms and Architectures, Cambridge, Massachusetts, USA, July 30 - August 2, 2006, Phillip B. Gibbons and Uzi Vishkin (Eds.). ACM, 39–48. isbn:1-59593-452-9 https://doi.org/10.1145/1148109.1148116
[23]
Sasa Misailovic, Deokhwan Kim, and Martin C. Rinard. 2013. Parallelizing Sequential Programs with Statistical Accuracy Tests. ACM Trans. Embed. Comput. Syst., 12, 2s (2013), 88:1–88:26. https://doi.org/10.1145/2465787.2465790
[24]
Sparsh Mittal. 2016. A Survey of Techniques for Approximate Computing. ACM Comput. Surv., 48, 4 (2016), 62:1–62:33. https://doi.org/10.1145/2893356
[25]
Akimasa Morihata. 2019. Lambda calculus with algebraic simplification for reduction parallelization by equational reasoning. Proc. ACM Program. Lang., 3, ICFP (2019), 80:1–80:25. https://doi.org/10.1145/3341644
[26]
Akimasa Morihata, Kento Emoto, Kiminori Matsuzaki, Zhenjiang Hu, and Hideya Iwasaki. 2018. Optimizing Declarative Parallel Distributed Graph Processing by Using Constraint Solvers. In Functional and Logic Programming - 14th International Symposium, FLOPS 2018, Nagoya, Japan, May 9-11, 2018, Proceedings, John P. Gallagher and Martin Sulzmann (Eds.) (Lecture Notes in Computer Science, Vol. 10818). Springer, 166–181. https://doi.org/10.1007/978-3-319-90686-7_11
[27]
Akimasa Morihata and Kiminori Matsuzaki. 2010. Automatic Parallelization of Recursive Functions Using Quantifier Elimination. In Functional and Logic Programming, 10th International Symposium, FLOPS 2010, Sendai, Japan, April 19-21, 2010. Proceedings, Matthias Blume, Naoki Kobayashi, and Germán Vidal (Eds.) (Lecture Notes in Computer Science, Vol. 6009). Springer, 321–336. isbn:978-3-642-12250-7 https://doi.org/10.1007/978-3-642-12251-4_23
[28]
Kazutaka Morita, Akimasa Morihata, Kiminori Matsuzaki, Zhenjiang Hu, and Masato Takeichi. 2007. Automatic inversion generates divide-and-conquer parallel programs. In Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation, San Diego, California, USA, June 10-13, 2007, Jeanne Ferrante and Kathryn S. McKinley (Eds.). ACM, 146–155. https://doi.org/10.1145/1250734.1250752
[29]
Andy Podgurski and Lynn Pierce. 1993. Retrieving Reusable Software by Sampling Behaviour. ACM Trans. Softw. Eng. Methodol., 2, 3 (1993), 286–303. https://doi.org/10.1145/152388.152392
[30]
Lawrence Rauchwerger and David A. Padua. 1999. The LRPD test: speculative run-time parallelization of loops with privatization and reduction parallelization. IEEE Trans. Parallel Distributed Syst., 10, 2 (1999), 160–180. https://doi.org/10.1109/71.752782
[31]
Shigeyuki Sato and Hideya Iwasaki. 2011. Automatic parallelization via matrix multiplication. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, June 4-8, 2011, Mary W. Hall and David A. Padua (Eds.). ACM, 470–479. isbn:978-1-4503-0663-8 https://doi.org/10.1145/1993498.1993554
[32]
Manuel Selva, Fabian Gruber, Diogo Sampaio, Christophe Guillon, Louis-Noël Pouchet, and Fabrice Rastello. 2020. Building a Polyhedral Representation from an Instrumented Execution: Making Dynamic Analyses of Nonaffine Programs Scalable. ACM Trans. Archit. Code Optim., 16, 4 (2020), 45:1–45:26. https://doi.org/10.1145/3363785
[33]
Andreas Simburger, Sven Apel, Armin Größ linger, and Christian Lengauer. 2019. PolyJIT: Polyhedral Optimization Just in Time. Int. J. Parallel Program., 47, 5-6 (2019), 874–906. https://doi.org/10.1007/s10766-018-0597-3
[34]
Armando Solar-Lezama. 2013. Program sketching. Int. J. Softw. Tools Technol. Transf., 15, 5-6 (2013), 475–495. https://doi.org/10.1007/s10009-012-0249-7
[35]
Rishi Surendran and Vivek Sarkar. 2016. Automatic parallelization of pure method calls via conditional future synthesis. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2016, part of SPLASH 2016, Amsterdam, The Netherlands, October 30 - November 4, 2016, Eelco Visser and Yannis Smaragdakis (Eds.). ACM, 20–38. https://doi.org/10.1145/2983990.2984035
[36]
Patricia Suriana, Andrew Adams, and Shoaib Kamil. 2017. Parallel associative reductions in Halide. In Proceedings of the 2017 International Symposium on Code Generation and Optimization, CGO 2017, Austin, TX, USA, February 4-8, 2017, Vijay Janapa Reddi, Aaron Smith, and Lingjia Tang (Eds.). ACM, 281–291. https://doi.org/10.1109/CGO.2017.7863747
[37]
Zheng Wang, Georgios Tournavitis, Björn Franke, and Michael F. P. O’Boyle. 2014. Integrating profile-driven parallelism detection and machine-learning-based mapping. ACM Trans. Archit. Code Optim., 11, 1 (2014), 2:1–2:26. https://doi.org/10.1145/2579561
[38]
Dana N. Xu, Siau-Cheng Khoo, and Zhenjiang Hu. 2004. PType System: A Featherweight Parallelizability Detector. In Programming Languages and Systems: Second Asian Symposium, APLAS 2004, Taipei, Taiwan, November 4-6, 2004. Proceedings, Wei-Ngan Chin (Ed.) (Lecture Notes in Computer Science, Vol. 3302). Springer, 197–212. isbn:3-540-23724-0 https://doi.org/10.1007/978-3-540-30477-7_14
[39]
Hao Yu and Lawrence Rauchwerger. 2006. An Adaptive Algorithm Selection Framework for Reduction Parallelization. IEEE Trans. Parallel Distributed Syst., 17, 10 (2006), 1084–1096. https://doi.org/10.1109/TPDS.2006.131

Cited By

View all
  • (2023)Measuring Carbon in Cities and Their Buildings through Reverse Engineering of Life Cycle AssessmentApplied System Innovation10.3390/asi60500766:5(76)Online publication date: 28-Aug-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI 2021: Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation
June 2021
1341 pages
ISBN:9781450383912
DOI:10.1145/3453483
This work is licensed under a Creative Commons Attribution International 4.0 License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 June 2021

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. parallelization
  2. program synthesis
  3. reduction loop
  4. reverse engineering
  5. semiring

Qualifiers

  • Research-article

Conference

PLDI '21
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)132
  • Downloads (Last 6 weeks)13
Reflects downloads up to 27 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Measuring Carbon in Cities and Their Buildings through Reverse Engineering of Life Cycle AssessmentApplied System Innovation10.3390/asi60500766:5(76)Online publication date: 28-Aug-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media