Queue Streaming Model Theory, Algorithms, and Implementation
Total Page:16
File Type:pdf, Size:1020Kb
Mississippi State University Scholars Junction Theses and Dissertations Theses and Dissertations 1-1-2019 Queue Streaming Model Theory, Algorithms, and Implementation Anup D. Zope Follow this and additional works at: https://scholarsjunction.msstate.edu/td Recommended Citation Zope, Anup D., "Queue Streaming Model Theory, Algorithms, and Implementation" (2019). Theses and Dissertations. 3708. https://scholarsjunction.msstate.edu/td/3708 This Dissertation - Open Access is brought to you for free and open access by the Theses and Dissertations at Scholars Junction. It has been accepted for inclusion in Theses and Dissertations by an authorized administrator of Scholars Junction. For more information, please contact [email protected]. Queue streaming model: Theory, algorithms, and implementation By Anup D. Zope A Dissertation Submitted to the Faculty of Mississippi State University in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy in Computational Engineering in the Center for Advanced Vehicular Systems Mississippi State, Mississippi May 2019 Copyright by Anup D. Zope 2019 Queue streaming model: Theory, algorithms, and implementation By Anup D. Zope Approved: Edward A. Luke (Major Professor) Shanti Bhushan (Committee Member) Maxwell Young (Committee Member) J. Mark Janus (Committee Member) Seongjai Kim (Committee Member) Manav Bhatia (Graduate Coordinator) Jason M. Keith Dean Bagley College of Engineering Name: Anup D. Zope Date of Degree: May 3, 2019 Institution: Mississippi State University Major Field: Computational Engineering Major Professor: Edward A. Luke Title of Study: Queue streaming model: Theory, algorithms, and implementation Pages of Study: 195 Candidate for Degree of Doctor of Philosophy In this work, a model of computation for shared memory parallelism is presented. To address fundamental constraints of modern memory systems, the presented model con- strains how parallelism interacts with memory access patterns and in doing so provides a method for design and analysis of algorithms that estimates reliable execution time based on a few architectural parameters. This model is presented as an alternative to modern thread based models that focus on computational concurrency but rely on reactive hardware policies to hide and amortize memory latency. Since modern processors use reactive mech- anisms and heuristics to deduce the data access requirement of computations, the memory access costs of these threaded programs may be difficult to predict reliably. This research presents the Queue Streaming Model (QSM) that aims to address these shortcomings by providing a prescriptive mechanism to achieve latency-amortized and predictable-cost data access. Further, the work presents application of the QSM to algorithms commonly used in a number of applications. These algorithms include structured regular computations rep- resented by merge sort, unstructured irregular computations represented by sparse matrix dense vector multiplication, and dynamic computations represented by MapReduce. The analysis of these algorithms reveal architectural tradeoffs between memory system bottle- necks and algorithm design. The techniques described in this dissertation reveal a general software approach that could be used to construct more general irregular applications, pro- vided they can be transformed into a relational query form. It demonstrates that the QSM can be used to design algorithms that enhance utilization of memory system resources by structuring concurrency and memory accesses such that system bandwidths are balanced and latency is amortized. Finally, the benefit of applying the QSM algorithm to the Euler inviscid flow solver is demonstrated through experiments on the Intel R Xeon R E5-2680 v2 processor using ten cores. The transformation produced a speed-up of 25% over an optimized OpenMP implementation having identical computational structure. Key words: queue streaming model, bridging model of computation, streaming access, performance predictability and portability DEDICATION I dedicate this work to my mom and dad, my wife and son, my brother and his family, and my parents-in-law whose unconditional love, unwavering support, and encouragement has made me feel confident at every step in my life and helped me pursue my dreams. ii ACKNOWLEDGEMENTS I have heartfelt gratitude for Dr. Edward A. Luke, my major professor, whose moti- vation, guidance, and expertise has made this work possible. Looking back at the years I have spent under his supervision, I realize that he has helped me grow tremendously in my career. His encouragement and timely advice has shown me a way to make the best of every success and failure in this journey towards graduation. I think I am fortunate to have an opportunity to work under his supervision. Thank you, Dr. Luke, for everything! I am thankful to Dr. J. Mark Janus for imparting me the foundational knowledge in CFD that was useful to me during my dissertation work. I want to thank Dr. Seongjai Kim for acquainting me with the mathematics of partial differential equations and linear algebra that provided me a different viewpoint to look at the numerical behavior of scientific sim- ulations. I thank Dr. Maxwell Young for providing me useful feedback on the dissertation that has helped improve its quality. I also thank Dr. Yang Zhang and Dr. Shanti Bhushan for the encouragement to conduct this research. I thank all my committee members for their inputs into this research. I am grateful to Dr. Janus and Dr. Roger King for providing me the opportunity to pursue graduate study in Computational Engineering at Mississippi State University. I thank Dr. Luke, Dr. Janus, Dr. David Thompson, Dr. Keith Walters, Dr. Dave Marcum, Dr. Eric Hansen, and Dr. Christopher Archibald who have helped me appreciate the wide iii spectrum of Computational Engineering. I am thankful to the system admin team at High Performance Computing Collaboratory, Mississippi State University, especially Joey B. Jones, for providing me the help and support for using the facility. I appreciate the efforts by Teri M. Robinson of the Office of Thesis and Dissertation Format Review, Mississippi State University for providing suggestions to improve readability of this dissertation. This research had partial support from The Department of Defense (DoD) High Perfor- mance Computing Modernization Program (HPCMP). It was also supported by the Center for Advanced Vehicular Systems at Mississippi State University. I am grateful for this fi- nancial support. I am also grateful to the Science and Technology Corporation, Hampton, VA and the NASA Advanced Supercomputing Division for providing me training oppor- tunity. In particular, I would like to thank Henry Jin, Jerry Yan, and Stephen Lesh for providing me guidance during the training period. I am also thankful to the Dean’s office of the Bagley College of Engineering, the Center for Advanced Vehicular Systems, and the Department of Computer Science and Engineering for providing the support for traveling to conferences during this research. Last but not least, I would like to thank my family and the friends I made in Starkville, who helped me create fond memories of the time I have spent here. iv TABLE OF CONTENTS DEDICATION . ii ACKNOWLEDGEMENTS . iii LIST OF TABLES . ix LIST OF FIGURES . .x LIST OF SYMBOLS, ABBREVIATIONS, AND NOMENCLATURE . xiv CHAPTER I. INTRODUCTION . .1 II. QUEUE STREAMING MODEL (QSM) . .6 2.1 Introduction . .6 2.2 The Level-0 QSM . .7 2.2.1 Estimation of the Execution Time . 12 2.2.2 Estimation of the Look-back Distance . 12 2.3 The Level-1 QSM . 13 2.4 The Level-2 QSM . 15 2.5 The Level-3 QSM . 18 2.6 Management of Queued Access in the QSM . 22 2.6.1 Queue Scheduler Policy and Queue Buffer Capacity . 22 2.6.2 Estimation of the Queue Overhead . 26 2.7 Extensions of the QSM . 27 2.7.1 Core Level Parallel Features . 28 2.7.2 Fine Grained Synchronization . 29 2.7.3 Multi-level Memories . 30 2.7.4 Emulation on a Cache-based Processor . 30 III. RELATED WORK . 32 v 3.1 Introduction . 32 3.2 Stream Programming . 32 3.2.1 Parallelism Opportunities in a Stream Program . 33 3.2.2 Streaming Processors . 34 3.2.2.1 Imagine . 35 3.2.2.2 Merrimac . 36 3.2.2.3 Cell Broadband Engine . 36 3.2.2.4 Raw Architecture . 37 3.2.3 Streaming Languages . 38 3.2.3.1 StreamC and KernelC . 38 3.2.3.2 StreamIt . 39 3.2.3.3 RaftLib . 40 3.2.3.4 Brook . 41 3.2.4 General Purpose Processor Enhancements for Streaming . 42 3.3 Data Flow Model . 43 3.4 Decoupled Access-Execute Architecture . 44 3.4.1 DAE vs Superscalar Cache-based Processor . 46 3.4.2 DAE vs QSM . 47 3.5 Cache-based Multi-core/Multi-context Processors . 49 3.5.1 QSM vs Cache-based Multi-core/Multi-context Processors 54 3.6 Summary . 55 IV. ALGORITHMS IN QSM . 57 4.1 Introduction . 57 4.2 Merge Sort . 58 4.2.1 Phase 1 . 59 4.2.1.1 Version 1: For the Level-0 QSM . 59 4.2.1.2 Version 2: For the Level-1 QSM . 65 4.2.1.3 Version 3: For the Level-3 QSM . 66 4.2.2 Phase 2 . 69 4.2.2.1 Version 1: Using Merge Sort . 69 4.2.2.2 Version 2: Using Bitonic Merge . 69 4.2.2.3 Version 3: Hybrid of Merge and Bitonic Merge . 71 4.2.2.4 Architectural Implications . 71 4.3 Sparse Matrix - Dense Vector Multiplication (SpMV) . 72 4.3.1 Version 1: Using Scattered Access . 74 4.3.1.1 Case 1: Using Ar:.................. 74 4.3.1.2 Case 2: Using Ac ................... 75 4.3.2 Version 2: Using Streaming Access . 75 4.3.2.1 Case 1: Using Ar:.................. 75 4.3.2.2 Case 2: Using Ac:.................. 76 4.3.3 Version 3: Using QSM . 77 vi 4.3.3.1 Look-back Access to R0 ..............