Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying GPU-Accelerated Computing with Python 3 and CUDA
  • Table Of Contents Toc
GPU-Accelerated Computing with Python 3 and CUDA

GPU-Accelerated Computing with Python 3 and CUDA

By : Niels Cautaerts, Hossein Ghorbanfekr
close
close
GPU-Accelerated Computing with Python 3 and CUDA

GPU-Accelerated Computing with Python 3 and CUDA

By: Niels Cautaerts, Hossein Ghorbanfekr

Overview of this book

Writing high-performance Python code doesn’t have to mean switching to C++. This book shows you how to accelerate Python applications using NVIDIA’s CUDA platform and a modern ecosystem of Python tools and libraries. Aimed at researchers, engineers, and data scientists, it offers a practical yet deep understanding of GPU programming and how to fully exploit modern GPU hardware. You’ll begin with the fundamentals of CUDA programming in Python using Numba-CUDA, learning how GPUs work and how to write, execute, and debug custom GPU kernels. Building on this foundation, the book explores memory access optimization, asynchronous execution with CUDA streams, and multi-GPU scaling using Dask-CUDA. Performance analysis and tuning are emphasized throughout, using NVIDIA Nsight profilers. You’ll also learn to use high-level GPU libraries such as JAX, CuPy, and RAPIDS to accelerate numerical Python workflows with minimal code changes. These techniques are applied to real-world examples, including PDE solvers, image processing, physical simulations, and transformer models. Written by experienced GPU practitioners, this hands-on guide emphasizes reproducible workflows using Python 3.10+, CUDA 12.3+, and tools like the Pixi package manager. By the end, you’ll have future-ready skills for building scalable GPU applications in Python.
Table of Contents (24 chapters)
close
close
1
Part 1: Fundamentals of GPU programming with CUDA in Python 3
6
Part 2: Performance Optimization and Advanced CUDA Topics
10
Part 3: Using High-Level Python Libraries for GPU Computation
14
Part 4: Real-World Example Applications
19
Part 5: Beyond This Book
23
Index

1

Why GPU Programming with CUDA in Python 3?

What do blockchain and artificial intelligence (AI) have in common?

At a surface level, both technologies have, in recent years, garnered a lot of media attention and investment and formed the basis for many start-ups. But beneath these applications lies a common technological foundation: general-purpose computing on graphics processing units (GPGPUs) to accelerate massively parallel computations. While the long-term impact of AI and blockchain is yet to be felt, GPGPU has already demonstrated its immense value across a multitude of fields and application areas, despite receiving significantly less public attention.

GPU programming is traditionally taught through low-level programming languages such as C or C++. This book takes a different approach and teaches GPGPU through various libraries available in Python 3. This makes the subject more accessible to our target audience: data scientists and researchers who primarily use Python and seek to accelerate computationally intensive code. This book focuses entirely on the CUDA platform, which is the most popular GPU programming framework that runs exclusively on NVIDIA hardware.

In this chapter, we will learn what GPGPU and CUDA are and how to recognize scenarios that benefit from GPGPU. We will also learn how to estimate and measure the benefits of accelerating our computations using GPGPU. We will also review the limitations of GPGPU, because unfortunately, it is not a magic bullet that can speed up any computation:

  • Understand the benefits, application areas, and limitations of GPU computing
  • Calculate the theoretical compute capacity of devices
  • Identify which types of problems benefit from massive parallelization, and estimate performance gains with Amdahl's law
  • Recognize additional factors, such as data transfers, that influence computing performance
  • Use cProfile and Scalene to discover bottlenecks in Python code

Your purchase includes a free PDF copy + exclusive extras

Your purchase includes a DRM-free PDF copy of this book, 7-day trial to the Packt+ library (no credit card required), and additional exclusive extras. See the Free benefits with your book section in the Preface to unlock them instantly and maximize your learning.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
GPU-Accelerated Computing with Python 3 and CUDA
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon