Tuned Openmp to CUDA Translation

Total Page:16

File Type:pdf, Size:1020Kb

Tuned Openmp to CUDA Translation Tuned OpenMP to CUDA Translation Rudi Eigenmann Seyong Lee Purdue University Motivation Many-Core Processors: New Opportunities for General-Purpose High-Performance Computing Multicore CPUs Cell BE ˇ GPGPUs Multicore FPGAs Etc. Floating-Point Operations per Second and Memory Bandwidth for the CPU and GPU GFLOP/s GB/s Time Time (a) Peak GFLOP/s (b) Peak Memory Bandwidth Courtesy: NVIDIA Tradeoff between Performance and Programmability in Many-Core Processors (a) CPU (b) GPU Courtesy: NVIDIA GPU provides more computing power but worse programmability than CPU. GPU architectures are optimized for stream computations. General-Purpose GPUs (GPGPUs) provide better programmability for general applications. CUDA programming model is more user-friendly than previous approaches, but still complex and error-prone. Goal and Approach Contribution Propose a new API, called OpenMPC, for improved CUDA programming, which provides both programmability and tunability. Developed a fully automatic and parameterized reference compilation system to support OpenMPC. Developed several tools to assist users in performance tuning. Evaluation on the 14 OpenMP programs: User-assisted tuning with optional manual modification of input OpenMP programs improves performance 1.24 times on average (up to 7.71 times) over un-tuned versions, which is 75% (92% if excluding one benchmark) of the performance of hand-written CUDA versions. Related Work Baskaran [08] G-ADAPT [09] OpenMP-to-GPGPU [09] Baskaran [10] Volkov [08] Nukada [09] OpenMPC [10] Automatic - CUDA-lite [08] hiCUDA [09] Semi JCUDA [09] PGI Accelerator [09] Automatic Automatic Optimization CUDA [07] OpenCL [08] Leung [10] Ryoo [08] Manual BrookGPU [04] Manual Semi-Automatic Automatic GPU Code Generation Overview of the CUDA Programming Model The CUDA Programming Model Host Device A general-purpose multi-threaded Grid 1 Kernel SIMD model for GPGPU Block Block Block 1 programming (0, 0) (1, 0) (2, 0) A CUDA program consists of a Block Block Block series of sequential and parallel (0, 1) (1, 1) (2, 1) execution phases. Grid 2 Parallel regions are executed by a Kernel set of threads (thread batching) 2 Architectural Limit Block (1, 1) No global synchronization Thread Thread Thread Thread Thread mechanism is supported. (0, 0) (1, 0) (2, 0) (3, 0) (4, 0) Thread Thread Thread Thread Thread No H/W caching mechanism for (0, 1) (1, 1) (2, 1) (3, 1) (4, 1) global memory Thread Thread Thread Thread Thread (0, 2) (1, 2) (2, 2) (3, 2) (4, 2) CUDA Programming Model Courtesy: NVIDIA CUDA Memory Model Grid Device Thread Block M Multiprocessor N Thread Block 0 Multiprocessor 1 Shared Memory Shared Memory Registers Registers Partitioned Register File Instruction Processor 1 ••• Processor 8 Unit Thread 0 ••• Thread K Constant Cache Local Local Memory Memory Texture Cache Global Memory Off-chip Device Memory CPU Global Memory Texture Memory with a Dedicated Cache Memory Constant Memory Texture Memory Constant Memory with a Dedicated Cache Partitioned Local Memory (a) CUDA Memory Model (b) CUDA Hardware Model A host CPU and a GPU device have separate address space. The shared memory and register bank in a multiprocessor are dynamically partitioned among the active thread blocks running on the multiprocessor. Programming Complexity Comparison (Jacobi) OpenMP code CUDA code float a[SIZE_2][SIZE_2]; float b[SIZE_2][SIZE_2]; float a[SIZE_2][SIZE_2]; __global__ void main_kernel0(float a[SIZE_2][SIZE_2], float b[SIZE_2][SIZE_2]) { float b[SIZE_2][SIZE_2]; int main (int argc, char *argv[]) { int i,j; int _bid = (blockIdx.x+(blockIdx.y*gridDim.x)); int _gtid = (threadIdx.x+(_bid*blockDim.x)); i=(_gtid+1); int i, j, k; for (k = 0; k < ITER; k++) { if (i<=SIZE { for (j=1; j<=SIZE j ++ ) #pragma omp parallel for private(i, j) a[i][j]=(b[(i-1)][j]+b[(i+1)][j]+b[i][(j-1)]+b[i][(j+1)])/4.0F; for (i = 1; i <= SIZE; i++) for (j = 1; j <= SIZE; j++) } } a[i][j] = (b[i - 1][j] + b[i + 1][j] + b[i][j - 1] + b[i][j + 1]) / 4.0f; __global__ void main_kernel1(float a[SIZE_2][SIZE_2], float b[SIZE_2][SIZE_2]) { #pragma omp parallel for private(i, j) for (i = 1; i <= SIZE; i++) int i,j; int _bid = (blockIdx.x+(blockIdx.y*gridDim.x)); int _gtid = (threadIdx.x+(_bid*blockDim.x)); i=(_gtid+1); for (j = 1; j <= SIZE; j++) if (i<=SIZE { b[i][j] = a[i][j]; return 0; for (j=1; j<=SIZE j ++ ) b[i][j]=a[i][j]; } } } int main(int argc, char * argv[]) { int i,j,k; float * gpu__a; float * gpu__b; gpuBytes=(SIZE_2*SIZE_2)*sizeof (float); CUDA_SAFE_CALL(cudaMalloc(((void * * )( & gpu__a)), gpuBytes)); dim3 dimBlock0(BLOCK_SIZE, 1, 1); dim3 dimGrid0(NUM_BLOCKS, 1, 1); CUDA_SAFE_CALL(cudaMemcpy(gpu__a, a, gpuBytes, cudaMemcpyHostToDevice)); gpuBytes=((SIZE_2*SIZE_2)*sizeof (float)); CUDA_SAFE_CALL(cudaMalloc(((void * * )( & gpu__b)), gpuBytes)); CUDA_SAFE_CALL(cudaMemcpy(gpu__b, b, gpuBytes, cudaMemcpyHostToDevice)); dim3 dimBlock1(BLOCK_SIZE, 1, 1); dim3 dimGrid1(NUM_BLOCKS, 1, 1); for (k=0; k<ITER; k ++ ) { main_kernel0<<<dimGrid0, dimBlock0, 0, 0>>>((float (*)[SIZE_2])gpu__a, (float (*)[SIZE_2])gpu__b); main_kernel1<<<dimGrid1, dimBlock1, 0, 0>>>((float (*)[SIZE_2)])gpu__a, (float (*)[SIZE_2])gpu__b); } gpuBytes=(SIZE_2*SIZE_2)*sizeof (float); CUDA_SAFE_CALL(cudaMemcpy(b, gpu__b, gpuBytes, cudaMemcpyDeviceToHost)); CUDA_SAFE_CALL(cudaFree(gpu__b)); gpuBytes=(SIZE_2*SIZE_2)*sizeof (float); CUDA_SAFE_CALL(cudaMemcpy(a, gpu__a, gpuBytes, cudaMemcpyDeviceToHost)); CUDA_SAFE_CALL(cudaFree(gpu__a)); fflush(stdout); fflush(stderr); return 0; } OpenMP Version of Jacobi float a[SIZE_2][SIZE_2]; float b[SIZE_2][SIZE_2]; int main (int argc, char *argv[]) { int i, j, k; for (k = 0; k < ITER; k++) { #pragma omp parallel for private(i, j) for (i = 1; i <= SIZE; i++) for (j = 1; j <= SIZE; j++) a[i][j] = (b[i - 1][j] + b[i + 1][j] + b[i][j - 1] + b[i][j + 1]) / 4.0f; #pragma omp parallel for private(i, j) for (i = 1; i <= SIZE; i++) for (j = 1; j <= SIZE; j++) b[i][j] = a[i][j]; return 0; } CUDA Version of Jacobi int main(int argc, char * argv[]) { GPU Memory Allocation and Data Transfer to GPU int i,j,k; float * gpu__a; float * gpu__b; gpuBytes=(SIZE_2*SIZE_2)*sizeof (float); CUDA_SAFE_CALL(cudaMalloc(((void * * )( & gpu__a)), gpuBytes)); CUDA_SAFE_CALL(cudaMemcpy(gpu__a, a, gpuBytes, cudaMemcpyHostToDevice)); gpuBytes=((SIZE_2*SIZE_2)*sizeof (float)); CUDA_SAFE_CALL(cudaMalloc(((void * * )( & gpu__b)), gpuBytes)); CUDA_SAFE_CALL(cudaMemcpy(gpu__b, b, gpuBytes, cudaMemcpyHostToDevice)); dim3 dimBlock0(BLOCK_SIZE, 1, 1); dim3 dimGrid0(NUM_BLOCKS, 1, 1); dim3 dimBlock1(BLOCK_SIZE, 1, 1); dim3 dimGrid1(NUM_BLOCKS, 1, 1); for (k=0; k<ITER; k ++ ) { main_kernel0<<<dimGrid0, dimBlock0, 0, 0>>>((float (*)[SIZE_2])gpu__a, (float (*)[SIZE_2])gpu__b); main_kernel1<<<dimGrid1, dimBlock1, 0, 0>>>((float (*)[SIZE_2)])gpu__a, (float (*)[SIZE_2])gpu__b); GPU Kernel Execution } gpuBytes=(SIZE_2*SIZE_2)*sizeof (float); CUDA_SAFE_CALL(cudaMemcpy(b, gpu__b, gpuBytes, cudaMemcpyDeviceToHost)); gpuBytes=(SIZE_2*SIZE_2)*sizeof (float); CUDA_SAFE_CALL(cudaMemcpy(a, gpu__a, gpuBytes, cudaMemcpyDeviceToHost)); CUDA_SAFE_CALL(cudaFree(gpu__b)); CUDA_SAFE_CALL(cudaFree(gpu__a)); fflush(stdout); fflush(stderr); return 0; } Data Transfer Back To CPU and GPU Memory Deallocation CUDA Version of Jacobi (2) __global__ void main_kernel0(float a[SIZE_2][SIZE_2], float b[SIZE_2][SIZE_2]) { int i,j; int _bid = (blockIdx.x+(blockIdx.y*gridDim.x)); int _gtid = (threadIdx.x+(_bid*blockDim.x)); i=(_gtid+1); if (i<=SIZE { for (j=1; j<=SIZE j ++ ) a[i][j]=(b[(i-1)][j]+b[(i+1)][j]+b[i][(j-1)]+b[i][(j+1)])/4.0F; } } __global__ void main_kernel1(float a[SIZE_2][SIZE_2], float b[SIZE_2][SIZE_2]) { int i,j; int _bid = (blockIdx.x+(blockIdx.y*gridDim.x)); int _gtid = (threadIdx.x+(_bid*blockDim.x)); i=(_gtid+1); if (i<=SIZE { for (j=1; j<=SIZE j ++ ) b[i][j]=a[i][j]; } } Why OpenMP? Advantages of OpenMP as a programming paradigm for GPGPUs. Loop-level parallelism of OpenMP is an ideal target for utilizing GPU’s highly parallel computing units. OpenMP’s fork-join model well represents the relationship between a master thread in CPU and a set of worker threads in a GPU. Incremental parallelization of OpenMP can add the same benefit to GPGPU programming. Baseline Translation of OpenMP into CUDA Identify Kernel Regions (parallel work to be executed on the GPU) Serial Int a; region ….. 1) Split an OpenMP parallel region at #pragma omp parallel every synchronization point. { ….. Parallel 2) Select sub-parallel regions containing #pragma omp for region at least one omp-for loop and transform Implicit for( … ) { … } them into kernel functions. barrier ….. } Input OpenMP Program Unoptimized Performance of OpenMP Programs on CUDA Kernel Benchmarks NAS Parallel Benchmarks Rodinia Benchmarks • Speedups are over serial on the CPU, when the largest available input data were used. • Experimental Platform: CPU: two Dual-Core AMD Opteron at 3 GHz GPU: NVIDIA Quadro FX 5600 with 16 multiprocessors at 1.35GHz Differences between OpenMP and CUDA Programming Models OpenMP Model CUDA Model Coarse-grain parallelism Fine-grain parallelism (runs (runs tens of threads.) thousands of threads.) SIMD/MIMD model SIMD model Threads work well on both Threads strongly prefer regular and irregular regular memory access memory access patterns. patterns Optimized for traditional Optimized for stream shared-memory architectures that operate multiprocessors (SMPs) on a large data space (or stream) in parallel and tuned for fast access to regular, consecutive data. Intra-Thread vs. Inter-Thread Locality Thread
Recommended publications
  • The Importance of Data
    The landscape of Parallel Programing Models Part 2: The importance of Data Michael Wong and Rod Burns Codeplay Software Ltd. Distiguished Engineer, Vice President of Ecosystem IXPUG 2020 2 © 2020 Codeplay Software Ltd. Distinguished Engineer Michael Wong ● Chair of SYCL Heterogeneous Programming Language ● C++ Directions Group ● ISOCPP.org Director, VP http://isocpp.org/wiki/faq/wg21#michael-wong ● [email protected][email protected] Ported ● Head of Delegation for C++ Standard for Canada Build LLVM- TensorFlow to based ● Chair of Programming Languages for Standards open compilers for Council of Canada standards accelerators Chair of WG21 SG19 Machine Learning using SYCL Chair of WG21 SG14 Games Dev/Low Latency/Financial Trading/Embedded Implement Releasing open- ● Editor: C++ SG5 Transactional Memory Technical source, open- OpenCL and Specification standards based AI SYCL for acceleration tools: ● Editor: C++ SG1 Concurrency Technical Specification SYCL-BLAS, SYCL-ML, accelerator ● MISRA C++ and AUTOSAR VisionCpp processors ● Chair of Standards Council Canada TC22/SC32 Electrical and electronic components (SOTIF) ● Chair of UL4600 Object Tracking ● http://wongmichael.com/about We build GPU compilers for semiconductor companies ● C++11 book in Chinese: Now working to make AI/ML heterogeneous acceleration safe for https://www.amazon.cn/dp/B00ETOV2OQ autonomous vehicle 3 © 2020 Codeplay Software Ltd. Acknowledgement and Disclaimer Numerous people internal and external to the original C++/Khronos group, in industry and academia, have made contributions, influenced ideas, written part of this presentations, and offered feedbacks to form part of this talk. But I claim all credit for errors, and stupid mistakes. These are mine, all mine! You can’t have them.
    [Show full text]
  • AMD Accelerated Parallel Processing Opencl Programming Guide
    AMD Accelerated Parallel Processing OpenCL Programming Guide November 2013 rev2.7 © 2013 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo, AMD Accelerated Parallel Processing, the AMD Accelerated Parallel Processing logo, ATI, the ATI logo, Radeon, FireStream, FirePro, Catalyst, and combinations thereof are trade- marks of Advanced Micro Devices, Inc. Microsoft, Visual Studio, Windows, and Windows Vista are registered trademarks of Microsoft Corporation in the U.S. and/or other jurisdic- tions. Other names are for informational purposes only and may be trademarks of their respective owners. OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos. The contents of this document are provided in connection with Advanced Micro Devices, Inc. (“AMD”) products. AMD makes no representations or warranties with respect to the accuracy or completeness of the contents of this publication and reserves the right to make changes to specifications and product descriptions at any time without notice. The information contained herein may be of a preliminary or advance nature and is subject to change without notice. No license, whether express, implied, arising by estoppel or other- wise, to any intellectual property rights is granted by this publication. Except as set forth in AMD’s Standard Terms and Conditions of Sale, AMD assumes no liability whatsoever, and disclaims any express or implied warranty, relating to its products including, but not limited to, the implied warranty of merchantability, fitness for a particular purpose, or infringement of any intellectual property right. AMD’s products are not designed, intended, authorized or warranted for use as compo- nents in systems intended for surgical implant into the body, or in other applications intended to support or sustain life, or in any other application in which the failure of AMD’s product could create a situation where personal injury, death, or severe property or envi- ronmental damage may occur.
    [Show full text]
  • Exploring Weak Scalability for FEM Calculations on a GPU-Enhanced Cluster
    Exploring weak scalability for FEM calculations on a GPU-enhanced cluster Dominik G¨oddeke a,∗,1, Robert Strzodka b,2, Jamaludin Mohd-Yusof c, Patrick McCormick c,3, Sven H.M. Buijssen a, Matthias Grajewski a and Stefan Turek a aInstitute of Applied Mathematics, University of Dortmund bStanford University, Max Planck Center cComputer, Computational and Statistical Sciences Division, Los Alamos National Laboratory Abstract The first part of this paper surveys co-processor approaches for commodity based clusters in general, not only with respect to raw performance, but also in view of their system integration and power consumption. We then extend previous work on a small GPU cluster by exploring the heterogeneous hardware approach for a large-scale system with up to 160 nodes. Starting with a conventional commodity based cluster we leverage the high bandwidth of graphics processing units (GPUs) to increase the overall system bandwidth that is the decisive performance factor in this scenario. Thus, even the addition of low-end, out of date GPUs leads to improvements in both performance- and power-related metrics. Key words: graphics processors, heterogeneous computing, parallel multigrid solvers, commodity based clusters, Finite Elements PACS: 02.70.-c (Computational Techniques (Mathematics)), 02.70.Dc (Finite Element Analysis), 07.05.Bx (Computer Hardware and Languages), 89.20.Ff (Computer Science and Technology) ∗ Corresponding author. Address: Vogelpothsweg 87, 44227 Dortmund, Germany. Email: [email protected], phone: (+49) 231 755-7218, fax: -5933 1 Supported by the German Science Foundation (DFG), project TU102/22-1 2 Supported by a Max Planck Center for Visual Computing and Communication fellowship 3 Partially supported by the U.S.
    [Show full text]
  • Evolution of the Graphical Processing Unit
    University of Nevada Reno Evolution of the Graphical Processing Unit A professional paper submitted in partial fulfillment of the requirements for the degree of Master of Science with a major in Computer Science by Thomas Scott Crow Dr. Frederick C. Harris, Jr., Advisor December 2004 Dedication To my wife Windee, thank you for all of your patience, intelligence and love. i Acknowledgements I would like to thank my advisor Dr. Harris for his patience and the help he has provided me. The field of Computer Science needs more individuals like Dr. Harris. I would like to thank Dr. Mensing for unknowingly giving me an excellent model of what a Man can be and for his confidence in my work. I am very grateful to Dr. Egbert and Dr. Mensing for agreeing to be committee members and for their valuable time. Thank you jeffs. ii Abstract In this paper we discuss some major contributions to the field of computer graphics that have led to the implementation of the modern graphical processing unit. We also compare the performance of matrix‐matrix multiplication on the GPU to the same computation on the CPU. Although the CPU performs better in this comparison, modern GPUs have a lot of potential since their rate of growth far exceeds that of the CPU. The history of the rate of growth of the GPU shows that the transistor count doubles every 6 months where that of the CPU is only every 18 months. There is currently much research going on regarding general purpose computing on GPUs and although there has been moderate success, there are several issues that keep the commodity GPU from expanding out from pure graphics computing with limited cache bandwidth being one.
    [Show full text]
  • Graphics Processing Units
    Graphics Processing Units Graphics Processing Units (GPUs) are coprocessors that traditionally perform the rendering of 2-dimensional and 3-dimensional graphics information for display on a screen. In particular computer games request more and more realistic real-time rendering of graphics data and so GPUs became more and more powerful highly parallel specialist computing units. It did not take long until programmers realized that this computational power can also be used for tasks other than computer graphics. For example already in 1990 Lengyel, Re- ichert, Donald, and Greenberg used GPUs for real-time robot motion planning [43]. In 2003 Harris introduced the term general-purpose computations on GPUs (GPGPU) [28] for such non-graphics applications running on GPUs. At that time programming general-purpose computations on GPUs meant expressing all algorithms in terms of operations on graphics data, pixels and vectors. This was feasible for speed-critical small programs and for algorithms that operate on vectors of floating-point values in a similar way as graphics data is typically processed in the rendering pipeline. The programming paradigm shifted when the two main GPU manufacturers, NVIDIA and AMD, changed the hardware architecture from a dedicated graphics-rendering pipeline to a multi-core computing platform, implemented shader algorithms of the rendering pipeline in software running on these cores, and explic- itly supported general-purpose computations on GPUs by offering programming languages and software- development toolchains. This chapter first gives an introduction to the architectures of these modern GPUs and the tools and languages to program them. Then it highlights several applications of GPUs related to information security with a focus on applications in cryptography and cryptanalysis.
    [Show full text]
  • The Shallow Water Equations on Graphics Processing Units
    Compact Stencils for the Shallow Water Equations on Graphics Processing Units Technology for a better society 1 Brief Outline • Introduction to Computing on GPUs • The Shallow Water Equations • Compact Stencils on the GPU • Physical correctness • Summary Technology for a better society 2 Introduction to GPU Computing Technology for a better society 3 Long, long time ago, … 1942: Digital Electric Computer (Atanasoff and Berry) 1947: Transistor (Shockley, Bardeen, and Brattain) 1956 1958: Integrated Circuit (Kilby) 2000 1971: Microprocessor (Hoff, Faggin, Mazor) 1971- More transistors (Moore, 1965) Technology for a better society 4 The end of frequency scaling 2004-2011: Frequency A serial program uses 2% 1971-2004: constant 29% increase in of available resources! frequency 1999-2011: 25% increase in Parallelism technologies: parallelism • Multi-core (8x) • Hyper threading (2x) • AVX/SSE/MMX/etc (8x) 1971: Intel 4004, 1982: Intel 80286, 1993: Intel Pentium P5, 2000: Intel Pentium 4, 2010: Intel Nehalem, 2300 trans, 740 KHz 134 thousand trans, 8 MHz 1.18 mill. trans, 66 MHz 42 mill. trans, 1.5 GHz 2.3 bill. trans, 8 X 2.66 GHz Technology for a better society 5 How does parallelism help? 100% The power density of microprocessors Single Core 100% is proportional to the clock frequency cubed: 100% 85% Multi Core 100% 170 % Frequency Power 30% Performance GPU 100 % ~10x Technology for a better society 6 The GPU: Massive parallelism CPU GPU Cores 4 16 Float ops / clock 64 1024 Frequency (MHz) 3400 1544 GigaFLOPS 217 1580 Memory (GiB) 32+ 3 Performance
    [Show full text]
  • Fragment Shader
    Programmable Graphics Hardware Outline 2/ 49 A brief Introduction into Programmable Graphics Hardware • Hardware Graphics Pipeline • Shading Languages • Tools • GPGPU • Resources [email protected] Dynamic Graphics Project University of Toronto Hardware Graphics Pipeline 3/ 49 Hardware Graphics Pipeline From vertices to pixels ... and what you can do in between. [email protected] Dynamic Graphics Project University of Toronto Hardware Graphics Pipeline 4/ 49 Hardware Graphics Pipeline GPU Video Memory CPU Vertex Fragment Processor Processor Raster Render Screen Unit Target [email protected] Dynamic Graphics Project University of Toronto Hardware Graphics Pipeline 5/ 49 Hardware Graphics Pipeline GPU Video Memory CPU Vertex Fragment Processor Processor Raster Render Screen Unit Target [email protected] Dynamic Graphics Project University of Toronto Hardware Graphics Pipeline 6/ 49 Hardware Graphics Pipeline GPU Video Memory CPU Vertex Fragment Processor Processor Raster Render Screen Unit Target [email protected] Dynamic Graphics Project University of Toronto Hardware Graphics Pipeline 7/ 49 Hardware Graphics Pipeline GPU Video Memory CPU Vertex Fragment Processor Processor Raster Render Screen Unit Target [email protected] Dynamic Graphics Project University of Toronto Hardware Graphics Pipeline 8/ 49 Hardware Graphics Pipeline GPU Video Memory CPU Vertex Fragment Processor Processor Raster Render Screen Unit Target [email protected] Dynamic Graphics Project University of Toronto Hardware Graphics Pipeline
    [Show full text]
  • GPGPU in System Simulations
    Lappeenranta-Lahti University of Technology LUT School of Engineering Science Degree Programme in Computational Engineering Mikko Majamaa GPGPU in System Simulations Bachelor’s Thesis 2020 Supervisors: Arto Kaarna, Associate Professor Janne Kurjenniemi, Ph.D. TIIVISTELMA¨ Lappeenrannan-Lahden teknillinen yliopisto LUT School of Engineering Science Laskennallisen tekniikan koulutusohjelma Mikko Majamaa GPGPU in System Simulations Kandidaatintyo¨ 2020 30 sivua, 4 kuvaa, 5 taulukkoa, 2 liitetta¨ Ohjaajat: Arto Kaarna, Tutkijaopettaja Janne Kurjenniemi, Ph.D. Avainsanat: GPGPU; systeemisimulaatio; CUDA; satelliitti; tietoverkko; Systeemisimulointi voi olla laskennallisesti raskas tehtav¨ a.¨ Grafiikkaprosessorin (GPU) avus- tuksella yleisessa¨ laskennassa, voidaan hyvaksik¨ aytt¨ a¨a¨ GPU:iden massiivista rinnakkaistet- tavuutta simulointiaikojen lyhentamiseksi.¨ Tam¨ an¨ kandidaatintyon¨ tavoitteena on kirjal- lisuuskatsauksen avulla saavuttaa perustietamys¨ grafiikkaprosessoreilla tehtav¨ ast¨ a¨ yleises- ta¨ laskennasta (GPGPU). Lisaksi¨ tavoitteena on soveltaa saavutettu perustietamys¨ kayt¨ an-¨ to¨on¨ toteuttamalla GPGPU:n kaytt¨ o¨a¨ Python-pohjaiseen satelliittiverkkosimulaattoriin. Tulokset osoittavat, etta¨ GPGPU:n kayt¨ oll¨ a¨ systeemisimuloinneissa on suuri potentiaali - sen kayt¨ oll¨ a¨ saavutettiin 16.0-kertainen kokonaisnopeutus ja 45.1-kertainen nopeutus linkkibud- jettilaskelmissa peratt¨ aiseen¨ ajoon perustuvaan toteutukseen verrattuna. ABSTRACT Lappeenranta-Lahti University of Technology LUT School of Engineering Science
    [Show full text]
  • An Introduction to GPU Computing
    An Introduction to GPU Computing iVEC Supercomputer Training 5th - 9th November 2012 Introducing the Historical GPU Graphics Processing Unit (GPU) n : A specialised electronic circuit designed to rapidly manipulate and alter memory in such a way as to accelerate the building of images in a frame buffer intended for output to a display. Introducing the Modern GPU Graphics Processing Unit (GPU) n : A general purpose electronic circuit designed to rapidly manipulate and alter memory in such a way as to accelerate computational algorithms that have fine-grained parallelism. GPU Computing Motivation But what about... Central Processing Unit (CPU) n : the portion of a computer system that carries out the instructions of a computer program, to perform the basic arithmetical, logical, and input/output operations of the system GPU Computing Motivation : Arithmetic Performance GPU Computing Motivation How is that possible? - GPUs have less cache and logic, more arithmetic - GPUs execute lots of simple threads - GPUs are physically bigger Nehalem Die (263mm2) Fermi Die (530mm2) GPU Computing Motivation : Power Efficiency GPU Computing Motivation : Memory Bandwidth GPU Computing Motivation : Summary Pros : - high arithmetic performance - high memory bandwidth - power efficient computation Cons : - separated by PCI Express bus - requires fine grain parallelism - requires high arithmetic intensity - requires light weight threads - requires additional software development For the right algorithm, additional time spent on code development can yield significant
    [Show full text]
  • Amd Firestream 9170 Gpgpu Implementation of a Brook+
    AMD FIRESTREAM 9170 GPGPU IMPLEMENTATION OF A BROOK+ PARALLEL ALGORITHM TO SEARCH FOR COUNTEREXAMPLES TO BEAL’S CONJECTURE _______________ A Thesis Presented to the Faculty of San Diego State University _______________ In Partial Fulfillment of the Requirements for the Degree Master of Science in Computer Science _______________ by Nirav Shah Summer 2010 iii Copyright © 2010 by Nirav Shah All Rights Reserved iv DEDICATION I dedicate my work to my parents for their support and encouragement. v ABSTRACT OF THE THESIS AMD Firestream 9170 GPGPU Implementation of a Brook+ Parallel Algorithm to Search for Counterexamples to Beal’s Conjecture by Nirav Shah Master of Science in Computer Science San Diego State University, 2010 Beal’s Conjecture states that if Ax + By = Cz for integers A,B,C > 0 and integers x,y,z > 2, then A, B, and C must share a common factor. Norvig and others have shown that the conjecture holds for A,B,C,x,y,z < 1000, but the truth of the general conjecture remains unresolved. Extending the search for a counterexample to significantly greater values of the conjecture’s six integer parameters is a task ideally suited to the use of an SIMD parallel algorithm implemented on a GPGPU platform. This thesis project encompassed the design, coding, and testing of such an algorithm, implemented in the Brook+ language for execution on the AMD Firestream 9170 GPGPU. vi TABLE OF CONTENTS PAGE ABSTRACT ...............................................................................................................................v LIST
    [Show full text]
  • Graphics Processing Units
    Graphics Processing Units Graphics Processing Units (GPUs) are coprocessors that traditionally perform the rendering of 2-dimensional and 3-dimensional graphics information for dis- play on a screen. In particular computer games request more and more realis- tic real-time rendering of graphics data and so GPUs became more and more powerful highly parallel specialist computing units. It did not take long until programmers realized that this computational power can also be used for tasks other than computer graphics. For example already in 1990 Lengyel, Reichert, Donald, and Greenberg used GPUs for real-time robot motion planning [43]. In 2003 Harris introduced the term general-purpose computations on GPUs (GPGPU) [28] for such non-graphics applications running on GPUs. At that time programming general-purpose computations on GPUs meant expressing all algorithms in terms of operations on graphics data, pixels and vectors. This was feasible for speed-critical small programs and for algorithms that operate on vectors of floating-point values in a similar way as graphics data is typically processed in the rendering pipeline. The programming paradigm shifted when the two main GPU manufactur- ers, NVIDIA and AMD, changed the hardware architecture from a dedicated graphics-rendering pipeline to a multi-core computing platform, implemented shader algorithms of the rendering pipeline in software running on these cores, and explicitly supported general-purpose computations on GPUs by offering programming languages and software-development toolchains. This chapter first gives an introduction to the architectures of these modern GPUs and the tools and languages to program them. Then it highlights several applications of GPUs related to information security with a focus on applications in cryptography and cryptanalysis.
    [Show full text]
  • GPGPU Benchmarking
    AdvancedAdvanced ProgrammingProgramming (GPGPU)(GPGPU) MikeMike HoustonHouston TheThe worldworld changedchanged overover thethe lastlast yearyear…… • Multiple GPGPU initiatives • Courses – Vendors without GPGPU –UIUC –ECE 498 talking about it – Supercomputing 2006 – SIGGRAPH 2006/2007 • A few big apps: – Game physics • Lots of academic research – Folding@Home – Video processing • Actual GPGPU companies – Finance modeling – PeakStream –Biomedical – RapidMind – Real-time image processing –Accelware –… 2 WhatWhat cancan youyou dodo onon GPUsGPUs otherother thanthan graphics?graphics? • Large matrix/vector operations (BLAS) • Protein Folding (Molecular Dynamics) • FFT (SETI, signal processing) • Ray Tracing • Physics Simulation [cloth, fluid, collision] • Sequence Matching (Hidden Markov Models) • Speech Recognition (Hidden Markov Models, Neural nets) • Databases • Sort/Search • Medical Imaging (image segmentation, processing) • And many, many more… http://www.gpgpu.org 3 TaskTask vs.vs. DataData parallelismparallelism • Task parallel – Independent processes with little communication –Easy to use • “Free” on modern operating systems with SMP • Data parallel – Lots of data on which the same computation is being executed – No dependencies between data elements in each step in the computation – Can saturate many ALUs – But often requires redesign of traditional algorithms 4 CPUCPU vs.vs. GPUGPU • CPU – Really fast caches (great for data reuse) – Fine branching granularity – Lots of different processes/threads – High performance on a single thread
    [Show full text]