Git Product home page Git Product logo

dependablesystemslab / tensorfi-binaryfi Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 11.67 MB

A binary fault Injector based on TensorFI fault injector. For more details, please refer to our paper

Home Page: http://blogs.ubc.ca/karthik/2019/06/16/binfi-an-efficient-fault-injector-for-safety-critical-machine-learning-systems/

License: MIT License

Python 99.12% Shell 0.88%
fault injeciton machine learning tensorflow

tensorfi-binaryfi's Introduction

BinFI: A binary fault injector for TensorFlow applications based on TensorFI (https://github.com/DependableSystemsLab/TensorFI)

This repo is based on TensorFI, a fault injector for TensorFlow applications written in Python. It provides a faster fault injection method - binary fault injection. Unlike conventional random FI, BinFI performs a binary-search like FI and it is able to efficiently identify SDC-causing bits, that is, the bits lead to SDCs(e.g., image misclassification) if flipped. We also provide exhaustive fault injection to inject faults into the whole state space to evaluate the efficacy of BinFI.

How to run

The major difference of this repo with TensorFI is that we provide binary injection mode (in /TensorFI/faultTypes.py). You can use this feature by configuring the config file accordingly. The installation and step to run the tool is the same as that for TensorFI. You can install TensorFI-BinaryFI by running the Install.sh (which will install TensorFI-BinaryFI in a virtual environment) OR by pip install (pip install TensorFI-BinaryFI).

We provide a detailed example in /BinFI-benchmarks/LeNet-4/ (with instructions), where you can try running binary FI and exhaustive FI respectively. NOTE: Running these two FI approaches require modification to the TF program and config file. You can modify your own program following the LeNet example. A general way for using BinFI is as follows:

  1. Configure the TF program and config file for binary FI (e.g., see line 380 to the end in LeNet-binFI.py). And then performing FI and collecting the stats, i.e., num of critical bits identified for each data; the data to be injected.

  2. Configure the TF program for exhaustive FI (e.g., see line 380 to the end in LeNet-allFI.py), it will collect the FI result on each state space.

  3. Examine the results by binary FI and exhaustive FI. The script for the examination is provided in /BinFI-benchmarks/LeNet-4/examineReesult.py.

Prerequisite

To apply BinFI on a ML model, you need to ensure that the computations within the ML model exhibit monotonicity property (i.e., for the same data point, larger value will result in larger outcome in the output; a typical example will be a MLP model). Please see our SC19 paper for more details on how to analyze the monotonicity property of the ML computations

Paper

Zitao Chen, Guanpeng Li, Karthik Pattabiraman, and Nathan DeBardeleben. 2019. BinFI: An Efficient Fault Injector for Safety-Critical Machine Learning Systems . In The International Conference for High Performance Computing, Networking, Storage, and Analysis (SC ’19), November 17–22, 2019, Denver, CO, USA. ACM, New York, NY, USA, 14 pages. https://doi.org/10.1145/3295500.3356177

tensorfi-binaryfi's People

Contributors

cclinus avatar zitaoc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mehrdad-moradi

tensorfi-binaryfi's Issues

Ops&Instances in the YAML file

Hi,

If I want to perform binary fault injection with the InjectMode 'oneFaultPerRun', should I find all the operators in my own ML program and specify them in Ops & Instances fields? If so, I'm also confused about how to find these operators. Take BinFI-benchmarks/LeNet-mnist/LeNet-binFI.py as an example, I observed the code and also with tensorboard, but I get a different number & order of these operations from that in LeNet-mnist/confFiles/default.yaml. Thanks,

Output csv files

Hi,

Take lenet-binEach.csv as an example, it is with 4 rows and 20 columns. Does the number of rows represent the number of injected operands in the operators defined in YAML file? Then what does the number of columns mean? Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.