arXiv:2611.05121cs.SENov 2026

Manuscript Offprint

arXiv:2611.05121

An Investigation on Numerical Bugs in GPU Programs Towards Automated Bug Detection

Ravishka Rathnasuriya, Nidhi Majoju, Zihe Song, Wei Yang

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

RAVISHKA RATHNASURIYA, University of Texas at Dallas, USA

NIDHI MAJOJU, University of Texas at Dallas, USA

ZIHE SONG, University of Texas at Dallas, USA

WEI YANG, University of Texas at Dallas, USA

General-purpose graphics processing unit (GPU) computing has emerged as a leading parallel computing paradigm, offering significant performance gains in various domains such as scientific computing and deep learning. However, GPU programs are susceptible to numerical bugs, which can lead to incorrect results or crashes. These bugs are difficult to detect, debug, and fix due to their dependence on specific input values or types and the absence of reliable error-checking mechanisms and oracles. Additionally, the unique programming conventions of GPUs complicate identifying the root causes of bugs, while fixing them requires domain-specific knowledge of GPU computing and numerical libraries. Therefore, understanding the characteristics of GPU numerical bugs (GPU-NBs) is crucial for developing effective solutions.

In this paper, we conduct a comprehensive study of GPU-NBs by analyzing 397 real-world bug samples from GitHub. We identify common root causes, symptoms, input patterns, test oracles that trigger these bugs and the strategies used to fix them. We also present GPU-NBDetect, a preliminary tool designed to detect numerical bugs across six distinct bug categories. GPU-NBDetect detected a total of 226 bugs across 186 mathematical functions in four libraries, with 60 of the bugs confirmed by developers. Our findings lay the groundwork for developing detection and prevention techniques for GPU-NBs and offer insights for building more effective debugging and auto-repair tool.

CCS Concepts: • Software and its engineering → Software testing and debugging; Empirical software validation.

Additional Key Words and Phrases: CUDA programming, fault localization, numerical bugs, floating-point errors, bug detection

ACM Reference Format:

Ravishka Rathnasuriya, Nidhi Majoju, Zihe Song, and Wei Yang. 2025. An Investigation on Numerical Bugs in GPU Programs Towards Automated Bug Detection. Proc. ACM Softw. Eng. 2, ISSTA, Article ISSTA073 (July 2025), 24 pages. https://doi.org/10.1145/3728950

1 Introduction

Numerical applications heavily depend on floating-point arithmetic, which approximates real numbers across varying precision levels, including half, single, and double precision [7]. GPUs are engineered to efficiently execute floating-point operations, offering substantial improvements in computational performance. Notably, NVIDIA GPUs [52] have progressively advanced with each hardware generation. Early NVIDIA architectures supported only single precision, but modern architectures now fully implement IEEE standards for half, single, and double precision, along with

Authors' Contact Information: Ravishka Rathnasuriya, University of Texas at Dallas, Richardson, USA, rsr200002@utdallas.edu; Nidhi Majoju, University of Texas at Dallas, Richardson, USA, nidhi.majoju@utdallas.edu; Zihe Song, University of Texas at Dallas, Richardson, USA, zihe.song@utdallas.edu; Wei Yang, University of Texas at Dallas, Richardson, USA, wei.yang@utdallas.edu.

Figure

This work is licensed under a Creative Commons Attribution 4.0 International License.

© 2025 Copyright held by the owner/author(s).

ACM 2994-970X/2025/7-ARTISSTA073

https://doi.org/10.1145/3728950

ISSTA073:2

Ravishka Rathnasuriya, Nidhi Majoju, Zihe Song, and Wei Yang

Fused-Multiply-Add (FMA) operations introduced in the Fermi [36] and Kepler [37] architectures. These advancements have introduced distinct characteristics in GPU computations compared to CPU computations, including unique rounding mechanisms, specialized mathematical libraries, and differing numerical capabilities (e.g., compute capability versions 2.0, 3.0, 6.x).

There are numerous studies on non-numerical bugs in GPU programs and numerical bugs in CPU programs, but none specifically address GPU numerical bugs (GPU-NBs). Existing research in the GPU domain has primarily focused on detecting synchronization bugs [4, 6, 9, 30, 76], memory bugs [6, 23, 30, 58], and compiler bugs [24]. However, GPU-NBs represent a distinct category arising from the finite approximation of real numbers in computing systems. These bugs can occur due to violations of mathematical properties, numerical operator implementation errors, insufficient data type support, or floating-point representation errors such as round-off and truncation errors. While both numerical and non-numerical bugs can produce similar symptoms, their causes differ. For instance, synchronization bugs result from misuse of barrier APIs [76] causing thread misbehavior, whereas numerical bugs stem from floating-point representation errors.

Despite the substantial body of research on CPU numerical bugs, a dedicated study of GPU-NBs is necessary due to critical distinctions in their manifestation, detection, debugging and repair [3, 8, 11, 60, 71, 72, 78, 80, 82–84]. First, GPU and CPU architectures differ fundamentally [74], affecting how numerical bugs emerge and are triggered. For instance, unlike CPUs, GPUs lack automated fault tolerance mechanisms such as exception flags and exception status registers [28, 50], which forces developers to use manual techniques (e.g., insert conditional statements) to identify and diagnose errors. Second, CPUs often perform floating-point calculations using an 80-bit “extended” precision mode, whereas GPUs typically use 32-bit and 64-bit for single and double precision operations, respectively [10]. This disparity in precision impacts how rounding-off errors develop, making testing approaches for CPU numerical bugs ineffective for GPUs, which round more frequently [75] and often lack the hardware-level rounding controls [73] available in CPUs. Third, CPUs typically process operations sequentially, facilitating precise tracking of error accumulation, whereas GPUs run thousands of threads concurrently, leading to complex error patterns that require different debugging and detection approaches. Due to these differences, CPU numerical bug detection strategies [3, 8, 11, 34, 57, 60, 71, 72, 80, 82–84] cannot be directly applied or work effectively in GPU-NB detection. Additionally, CPU strategies for numerical bug fixes often involve simple precision adjustments, but GPU fixes demand custom kernel strategies and precision tuning to maintain performance under parallel execution. Lastly, the proprietary nature of accelerated libraries used in GPU programs [38–45] restricts access to source code, preventing the use of tools like Clang/LLVM for instrumentation [28]. These factors underscore the need for a focused study on GPU-NBs, examining their symptoms, root causes, and fixing strategies. Such research can improve developers' understanding, and guide future efforts in automated bug detection for GPUs.

Numerical bugs in GPU programs and deep learning (DL) applications originate from different sources. DL numerical issues arise from flaws in the design and logic of algorithms, such as unstable optimization methods or improper weight initialization strategies, affecting prediction accuracy at the application level [25, 53, 56, 71, 77, 82]. In contrast, GPU-NBs stem from how data types and numerical operations are handled during execution, leading to errors at the hardware level. Rather than analyzing entire applications, our focus is on the numerical correctness of core GPU computations and library implementations.

DL-based detection approaches rely on whole-application testing methods, such as metamorphic and differential testing [71, 77], which perturb models and compare outputs to detect inconsistencies. However, these methods fail to isolate hardware-level numerical errors, as they would require exhaustive exploration of vast model and parameter spaces for whole-application testing. The absence of hardware-level detection techniques leaves a critical gap, as GPU-NBs introduce hidden

ISSTA073:3

computation errors without immediate failure signals, making them undetectable through DL-based detection methods.

The purpose of our study is to investigate GPU-NBs, focusing on common issues and solutions related to floating-point operations. We analyzed bug reports from both NVIDIA's open-source and closed-source numerical libraries, manually examining 906 GPU bug samples, of which 397 were identified as numerical issues. Based on these findings, we categorized numerical bugs into four main types: precision bugs, special-value bugs, device-specific bugs, and data type and operator bugs. We discuss the characteristics of each category, including their symptoms, test input patterns, oracles that trigger the bugs, and the strategies used to fix these numerical issues in GPU programs.

Our study offers findings and insights that pave the way for future researchers to develop a systematic framework for addressing GPU-NBs. The framework begins with bug detection (Section 5), encompassing test input generation and the selection of test oracles. Based on symptoms identified during detection, the framework advances to debugging (Section 4) by mapping symptoms to potential root causes (Fig. 2). Once the root causes are identified, the framework applies corresponding fixing strategies (Fig. 2) to repair the program (Section 6). We propose a preliminary tool, GPU-NBDetect, for detecting GPU-NBs (Section 5.3). GPU-NBDetect employs seven mutation rules to generate floating-point inputs and detects numerical bugs across six categories. GPU-NBDetect identified 226 bugs across 186 mathematical functions in four libraries, with 60 confirmed by developers, outperforming four existing bug detectors and two input generation methods.

Our main contributions of this study are:

  • Summarizing patterns of the symptoms, the root causes, and the fixing strategies of numerical bugs in GPU programs.
  • Providing guidance for creating reliable and stable GPU program test inputs and test oracles for detecting numerical bugs.
  • Outlining common fix strategies for numerical issues, helping developers reproduce and resolve bugs efficiently, thus conserving development resources.
  • Offering insights into the automated detection, debugging, and fixing of GPU-NBs.
  • Introducing GPU-NBDetect, a preliminary tool featuring input generation and test oracle selection to detect GPU-NBs.

References (30)