[Paper Review] TensorFI: A Flexible Fault Injection Framework for TensorFlow Applications
TensorFI is a flexible, high-level software fault injection framework for TensorFlow applications that enables runtime injection of hardware and software faults at the operator and graph level without modifying the original code. It achieves low performance overhead (average 1.5x) by using a parallel, instrumented graph in Python, and demonstrates effective resilience evaluation across 12 ML models, including autonomous vehicle DNNs.
As machine learning (ML) has seen increasing adoption in safety-critical domains (e.g., autonomous vehicles), the reliability of ML systems has also grown in importance. While prior studies have proposed techniques to enable efficient error-resilience techniques (e.g., selective instruction duplication), a fundamental requirement for realizing these techniques is a detailed understanding of the application's resilience. In this work, we present TensorFI, a high-level fault injection (FI) framework for TensorFlow-based applications. TensorFI is able to inject both hardware and software faults in general TensorFlow programs. TensorFI is a configurable FI tool that is flexible, easy to use, and portable. It can be integrated into existing TensorFlow programs to assess their resilience for different fault types (e.g., faults in particular operators). We use TensorFI to evaluate the resilience of 12 ML programs, including DNNs used in the autonomous vehicle domain. Our tool is publicly available at https://github.com/DependableSystemsLab/TensorFI.
Motivation & Objective
- Address the growing need to evaluate reliability and fault resilience in safety-critical machine learning systems, especially in autonomous vehicles and aviation.
- Overcome the limitations of existing fault injection tools that operate at low-level code or are not compatible with high-level ML frameworks like TensorFlow.
- Develop a portable, configurable, and performant fault injection framework that operates at the TensorFlow graph and operator level without modifying the original model or runtime behavior.
- Enable developers to systematically assess how different fault types (e.g., bit flips, random value replacement) affect model outputs across diverse ML applications.
- Ensure compatibility with external libraries and maintain high performance during normal execution by isolating fault injection logic in a separate, optional execution path.
Proposed method
- Construct a parallel, instrumented TensorFlow graph (FI graph) that mirrors the original model’s operators but includes configurable fault injection capabilities.
- Implement fault injection operators in Python to ensure portability and ease of configuration, avoiding low-level C++ or assembly modifications.
- Use runtime dispatching to select between original and FI-variant operators based on a configuration flag, ensuring minimal performance impact when faults are disabled.
- Inject faults at the output of TensorFlow operations, supporting multiple fault types: single bit flips, random value replacement, and error rate-based injection.
- Maintain semantic and structural compatibility with the original graph to preserve functionality of third-party libraries relying on TensorFlow’s graph structure.
- Integrate the framework into existing TensorFlow applications with minimal code changes, enabling seamless resilience evaluation.
Experimental results
Research questions
- RQ1How can fault injection be effectively performed at the TensorFlow graph level without modifying the original model or harming performance?
- RQ2What is the performance overhead of integrating a fault injection framework into real-world TensorFlow applications?
- RQ3How do different fault types (e.g., bit flips, random replacements) affect the output of deep neural networks in safety-critical applications?
- RQ4To what extent can TensorFI be used to evaluate the resilience of real-world ML models, including those used in autonomous vehicles?
- RQ5Can the framework be made portable and compatible with third-party libraries that depend on the structure of the original TensorFlow graph?
Key findings
- TensorFI introduces only a 1.5x average performance overhead when fault injection is disabled, meeting the goal of minimal interference during normal execution.
- The fault injection overhead ranges from 21x to 131x due to Python-level emulation of operators, but this is acceptable given the framework’s use case for analysis, not production.
- The most time-consuming experiment (ResNet and Highway CNN) took under 16 hours to complete, with most experiments finishing in 3–4 hours for 10,000 fault injections.
- Faults injected via bit flips produced more bipolar (black-and-white) artifacts in GAN-generated images, while random replacement led to more varied pixel intensities.
- The framework successfully evaluated resilience across 12 diverse models, including AV-relevant DNNs, demonstrating its utility in safety-critical ML system validation.
- TensorFI maintains compatibility with external libraries by not altering the original graph structure, ensuring that dependent tools continue to function correctly.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.