Skip to content
/ BinFPE Public

Detects floating-point exceptions using binary instrumentation

License

Notifications You must be signed in to change notification settings

LLNL/BinFPE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BinFPE

BinFPE is a tool that detects floating-point exceptions (NaN, infinity, and subnormal quantities) in NVIDIA GPU applications using binary instrumentation. It requires no re-compilation of the application and can analyze libraries. The tool extends NVBit, which is provided by NVIDIA Labs to analyze binaries. We provide a patch to NVBit to build BinFPE.

How to Build

We provide a Makefile to build the tool. It downloads NVBit and patches an NVBit tool to create BinFPE. The patch is provided in binfpe-nvbit.patch.

To build BinFPE, simply run make. It will build the following shared library:

./nvbit_release/tools/detect_fp_exceptions/detect_fp_exceptions.so

How to Use it

Simply preload the shared library detect_fp_exceptions.so before running the application using the Linux LD_PRELOAD variable method:

$ LD_PRELOAD=/path/detect_fp_exceptions.so ./application input

You should see the following output:

#FPCHECKER: Initializing...
#FPCHECKER: kernel void RAJA::internal::CudaKernelLauncherFixed...
#FPCHECKER: kernel...

Error Reports

If a calculation that results in a NaN or infinity is found, you should see the following output:

#FPCHECKER: NaN found @ /tests/my_code/dot_product.cu:18
#FPCHECKER: INF found @ /tests/my_code/mult_matrix.cu:26

Requirements

The GPU code must be compiled with the --generate-line-info flag (see the nvcc options here).

Other requirements:

  • SM compute capability: >= 3.5 && <= 8.6
  • GCC version: >= 5.3.0
  • CUDA version: >= 8.0 && <= 11.x
  • nvcc version for tool compilation >= 10.2

Contact

For questions, contact Ignacio Laguna [email protected].

To cite BinFPE please use

@inproceedings{soap22-binfpe,
author = {Ignacio Laguna and Xinyi Li and Ganesh Gopalakrishnan},
title = {{BinFPE: Accurate Floating-Point Exception Detection for GPU Applications}},
booktitle = {{11th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis (SOAP)}},
howpublished = {{\url{https://pldi22.sigplan.org/home/SOAP-2022#event-overview}}},
year = 2022
}

License

BinFPE is distributed under the terms of the MIT license.

See LICENSE and NOTICE for details.

LLNL-CODE-833790

About

Detects floating-point exceptions using binary instrumentation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published