Book description
Explore the capabilities of GPUs for solving high performance computational problems
Key Features
- Understand effective synchronization strategies for faster processing using GPUs
- Write parallel processing scripts with PyCuda and PyOpenCL
- Learn to use CUDA libraries such as CuDNN for deep learning on GPUs
Book Description
GPUs are proving to be excellent general purpose-parallel computing solutions for high-performance tasks such as deep learning and scientific computing.
This book will be your guide to getting started with GPU computing. It begins by introducing GPU computing and explaining the GPU architecture and programming models. You will learn, by example, how to perform GPU programming with Python, and look at using integrations such as PyCUDA, PyOpenCL, CuPy, and Numba with Anaconda for various tasks such as machine learning and data mining. In addition to this, you will get to grips with GPU workflows, management, and deployment using modern containerization solutions. Toward the end of the book, you will get familiar with the principles of distributed computing for training machine learning models and enhancing efficiency and performance.
By the end of this book, you will be able to set up a GPU ecosystem for running complex applications and data models that demand great processing capabilities, and be able to efficiently manage memory to compute your application effectively and quickly.
What you will learn
- Utilize Python libraries and frameworks for GPU acceleration
- Set up a GPU-enabled programmable machine learning environment on your system with Anaconda
- Deploy your machine learning system on cloud containers with illustrated examples
- Explore PyCUDA and PyOpenCL and compare them with platforms such as CUDA, OpenCL, and ROCm.
- Perform data mining tasks with machine learning models on GPUs
- Extend your knowledge of GPU computing in scientific applications
Who this book is for
Data scientists, machine learning enthusiasts, or professionals who want to get started with GPU computation and perform the complex tasks with low-latency will find this book useful. Intermediate knowledge of Python programming is assumed.
Table of contents
- Title Page
- Copyright and Credits
- Dedication
- About Packt
- Contributors
- Preface
- Section 1: Computing with GPUs Introduction, Fundamental Concepts, and Hardware
-
Introducing GPU Computing
- The world of GPU computing beyond PC gaming
- Conventional CPU computing – before the advent of GPUs
- How the gaming industry made GPU computing affordable for individuals
- The emergence of full-fledged GPU computing
-
The simplicity of Python code and the power of GPUs –  a dual advantage
- The C language – a short prologue
- From C to Python
- The simplicity of Python as a programming language – why many researchers and scientists prefer it
- The power of GPUs
- Latest GPUs at the time of writing this book (can be subject to change)
- Significance of FP64 in GPU computing
- The dual advantage – Python and GPUs, a powerful combination
-
How GPUs empower science and AI in current times
- Bioinformatics workflow management
- Magnetic Resonance Imaging (MRI) reconstruction techniques
- Digital-signal processing for communication receivers
- Studies on the brain – neuroscience research
- Large-scale molecular dynamics simulations
- GPU-powered AI and self-driving cars
- Research work posited by AI scientists
- The social impact of GPUs
- Summary
- Further reading
-
Designing a GPU Computing Strategy
- Getting started with the hardware
- Building your first GPU-enabled parallel computer – minimum system requirements
- Liquid cooling – should you consider it?
- Branded GPU-enabled PCs
-
Why not DIY?
- GPU
- CPU
- Motherboard
- RAM
- Storage
- PSU
- Uninterrupted power supply (UPS)
- Thermal paste
- Heat sink
- Radiator
- Types of cooling fans
- Bottlenecking
- Estimating the build and performing compatibility checks
- Purpose
- Feasibility
- Upgradeability
- Refining an effective budget
- Warranty for individual components
- DIY solutions in liquid cooling
- Assembling your system
- Connecting all the power and case cables in place
- Installing CUDA on a fresh Ubuntu installation
- Entry-level budget
- Mid-range budget
- High-end budget
- Summary
- Further reading
- Setting Up a GPU Computing Platform with NVIDIA and AMD
- Section 2: Hands-On Development with GPU Programming
- Fundamentals of GPU Programming
- Setting Up Your Environment for GPU Programming
-
Working with CUDA and PyCUDA
- Technical requirements
- Understanding how CUDA-C/C++ works via a simple example
- Installing PyCUDA for Python within an existing CUDA environment
- Configuring PyCUDA on your Python IDE
- How computing in PyCUDA works on Python
- Comparing PyCUDA to CUDA – an introductory perspective on reduction
- Writing your first PyCUDA programs to compute a general-purpose solution
- Useful exercise on computational problem solving
- Summary
- Further reading
-
Working with ROCm and PyOpenCL
- Technical requirements
- Understanding how ROCm-C/C++ works with hipify, HIP, and OpenCL
- Installing PyOpenCL for Python (AMD and NVIDIA)
- Configuring PyOpenCL on your Python IDE
- How computing in PyOpenCL works on Python
- Comparing PyOpenCL to HIP and OpenCL – revisiting the reduction perspective
- Writing your first PyOpenCL programs to compute a general-purpose solution
- Useful exercise on computational problem solving
- Summary
- Further reading
-
Working with Anaconda, CuPy, and Numba for GPUs
- Technical requirements
- Understanding how Anaconda works with CuPy and Numba
- Installing CuPy and Numba for Python within an existing Anaconda environment
- Configuring CuPy on your Python IDE
- How computing in CuPy works on Python
- Configuring Numba on your Python IDE
- How computing in Numba works on Python
- Writing your first CuPy and Numba enabled accelerated programs to compute GPGPU solutions
- Interoperability between CuPy and Numba within a single Python program
- Comparing CuPy to NumPy and CUDA
- Comparing Numba to NumPy, ROCm, and CUDA
- Useful exercise on computational problem solving
- Summary
- Further reading
- Section 3: Containerization and Machine Learning with GPU-Powered Python
- Containerization on GPU-Enabled Platforms
-
Accelerated Machine Learning on GPUs
- Technical requirements
- The significance of Python in AI – the dual advantage
- Exploring machine learning training modules
- Introducing machine learning frameworks
- Introducing TensorFlow
- Introducing PyTorch
- Installing TensorFlow and PyTorch for GPUs
- Configuring TensorFlow on PyCharm and Google Colab
- Configuring PyTorch on PyCharm and Google Colab
- Machine learning with TensorFlow and PyTorch
- Writing your first GPU-accelerated machine learning programs
- Revisiting our computational exercises with a machine learning approach
- Summary
- Further reading
- GPU Acceleration for Scientific Applications Using DeepChem
- Appendix A
- Other Books You May Enjoy
Product information
- Title: Hands-On GPU Computing with Python
- Author(s):
- Release date: May 2019
- Publisher(s): Packt Publishing
- ISBN: 9781789341072
You might also like
book
Hands-On GPU Programming with Python and CUDA
Build real-world applications with Python 2.7, CUDA 9, and CUDA 10. We suggest the use of …
video
Python GPU Programming in 5 Minutes
Learn to do GPU programming in Python in Five Minutes
book
Advanced Deep Learning with Python
Gain expertise in advanced deep learning domains such as neural networks, meta-learning, graph neural networks, and …
book
CUDA by Example: An Introduction to General-Purpose GPU Programming
“This book is required reading for anyone working with accelerator-based computing systems.” –From the Foreword by …