arXiv:2609.07912cs.DCSep 2026

Manuscript Offprint

arXiv:2609.07912

Interactive Debugger for Performance Portable Python HPC Kernels

Ivan Grigorik, Gabriel Kosmacher, George Biros, Milos Gligoric

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Ivan Grigorik

The University of Texas at Austin

Austin, Texas, USA

grigorik@utexas.edu

Gabriel Kosmacher

The University of Texas at Austin

Austin, Texas, USA

gkosmacher@utexas.edu

George Biros

The University of Texas at Austin

Austin, Texas, USA

gbiros@acm.org

Milos Gligoric

The University of Texas at Austin

Austin, Texas, USA

gligoric@utexas.edu

Abstract—We propose PKDB, the first interactive debugger for GPU and multithreaded low-level kernels written in Python. Python is widely used in high performance computing (HPC), with frameworks such as PyKokkos translating Python-embedded domain-specific languages to native code that runs across OpenMP-threaded CPUs and various GPUs. Yet interactive debugging support for such code is absent: developers resort to print statements, framework-specific assertions, or CPU-only execution, the last of which requires altering the program or its data and can mask device-specific bugs. PKDB enables standard interactive debugging like breakpoints, stepping, and variable inspection while preserving actual on-device execution without source modification. Beyond these fundamentals, PKDB introduces two advanced capabilities that exploit the dynamic nature of Python and PyKokkos: (i) Live code evaluation, which lets developers execute arbitrary Python expressions or entire kernels in the middle of a paused kernel without restarting the process; (ii) Kernel call site substitution, which allows an actively running kernel to be updated and reloaded on the fly, so only the kernel is recompiled and re-executed without restarting the application. Our performance evaluation on Intel, AMD, and NVIDIA CPUs and NVIDIA and AMD GPUs shows that PKDB introduces limited overhead and is practical for everyday use while introducing critical debugging features to the Python HPC ecosystem.

Index Terms—High Performance Computing, Python, Debugging, Performance Portability.

I. INTRODUCTION

The rapid diversification of high performance computing (HPC) hardware platforms, from OpenMP-threaded CPUs to GPUs and specialized accelerators, makes it increasingly challenging to develop HPC applications that run efficiently across different devices. Performance-portable frameworks such as Kokkos [1] address this by enabling developers to write code once and deploy it across different architectures without manual porting. While such frameworks were traditionally implemented in statically typed languages like C++, the growing need for rapid prototyping and seamless integration with machine learning workflows has driven the development of equivalent Python-based frameworks. These frameworks compile Python kernels just-in-time to C++ or other lower-level formats; PyKokkos [2], for instance, translates Python-embedded domain-specific language (eDSL) kernels directly to Kokkos C++, enabling developers to harness performance-portable HPC without leaving the Python ecosystem.

Despite substantial progress on frameworks covering new hardware backends, language features, and compilation pipelines, there has been minimal effort to provide tools that assist the development process itself. We designed and developed PKDB, the first interactive debugger for GPU and multithreaded low-level kernels written in Python, targeting PyKokkos kernels in particular.

The current state-of-practice for debugging Python eDSLs is embedded print statements [3, 4] or assertions [5, 6, 7]; a small subset of the debugging capabilities available to device-native kernel developers provided by CUDA-GDB [8] or ROCgdb [9]. As an alternative, developers may choose to execute the program serially on the CPU without translation [2, 10] or with partial translation; for complex workloads, this approach forces the developer to alter the program or its data to keep execution time manageable and may fail to expose corrupted behavior specific to parallel execution on the target device. Building a proper interactive debugger for this setting is itself non-trivial: it must bridge the Python host with JIT-compiled device kernels, map Python-level source concepts to dynamically generated device code, and unify distinct low-level debugging protocols for GPU (CUDA-GDB/ROCgdb) and OpenMP-threaded CPU targets.

PKDB is designed to be fully familiar to Python developers by mirroring the interface of pdb [11], integrating naturally into existing development workflows. At the same time, its architecture supports debugging application kernels executing on a device (e.g., a GPU), preserving actual on-device execution and performance, without source modification.

Beyond standard interactive debugging features such as breakpoints, stepping, continuation, and variable inspection, PKDB introduces two novel capabilities that exploit the dynamic nature of Python and PyKokkos: (1) Live code evaluation, which lets developers execute arbitrary Python expres-

SC26, November 15-20, 2026, Chicago, Illinois, USA 979-8-3195-4789-7/26/$31.00 ©2026 IEEE sions or entire kernels in the middle of a paused kernel without restarting the process, enabling inspection or modification of program state at any point during debugging. To reduce the latency of live evaluation, PKDB can execute multiple kernel versions concurrently rather than sequentially. (2) Kernel call site substitution, which allows an actively running kernel to be updated and reloaded on the fly, so only the kernel is recom-piled and re-executed without restarting the entire application. Due to its modular design, PKDB currently supports Intel, AMD and NVIDIA CPUs and NVIDIA and AMD GPUs; adding a new platform requires only implementing a platform-specific protocol without changes to the rest of the framework. The key contributions of this paper include:

  • Conceptualization. We present PKDB, the first interactive debugger for GPU and multithreaded low-level Python kernels. PKDB enables on-device debugging without source modification and integrates seamlessly into the familiar pdb interface, supporting context switching between Python and generated device code, and across heterogeneous accelerator types (e.g., CUDA and OpenMP), within a single session.

  • Live code evaluation. PKDB enables execution of arbitrary code—on the Python host or directly on the device—in the middle of a paused kernel session, giving developers the ability to inspect and modify program state at any point without restarting the application.

  • Kernel call site substitution. PKDB supports in-flight kernel changes, allowing developers to fix and continue kernel execution within the same debugger session without a full application restart.

  • Performance evaluation. We evaluate PKDB on representative PyKokkos workloads: ExaMiniMD, a Boltzmann-kinetics solver, and a periodic Ewald sum for the Stokes potential. We quantify end-to-end debugging over PKDB supported on Intel, NVIDIA and AMD CPUs and NVIDIA and AMD GPUs, compare against baseline debugging workflows, and measure the time saved by call site substitution versus a full application restart.

In doing so, PKDB brings long-overdue, first-class debugging support to developers of performance-portable Python HPC kernels. PKDB is publicly available at https://github.com/EngineeringSoftware/pkdb.

References (52)