Git Product home page Git Product logo

dependablesystemslab / trident Goto Github PK

View Code? Open in Web Editor NEW
6.0 13.0 7.0 203.43 MB

Trident is a tool to analytically model the Silent-Data Corruption (SDC) rate of a program, to replace expensive fault injection experiments. Please refer to our papers at DSN 2018 for more details (links in the README)

License: MIT License

CMake 0.96% C 1.15% C++ 50.25% Makefile 15.28% Python 1.31% Shell 0.31% LLVM 19.41% M4 0.09% OCaml 0.27% HTML 2.11% CSS 0.02% Roff 0.02% PHP 7.40% Objective-C 0.01% Assembly 1.28% Ada 0.01% Fortran 0.01% Objective-C++ 0.01% Batchfile 0.01% Perl 0.13%
fault injection analytical resilience sdcs

trident's Introduction

Trident Project

Trident analytically predicts the SDC probability of a given program and its instructions without any fault injection. It is implemented as a set of LLVM compiler passes driven by python scripts. These passes are located in ./llvm-2.9/lib/Transforms/.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

  1. The packages and dependencies required by LLFI(v2.9) and LLVM(v2.9)
  2. LLVM-GCC 4.2.1 (LLVM build 2.9)
  3. Python 2.7

Tested on Ubuntu 12.04 and 14.04 LTS

Preparation - Trident

  1. Configure the path for llvm_gcc binary (LLVMGCC) and Trident checkout (ROOT) based on your environment in ./test/Tridnet/config.py and ./inst_count/run_sampling.sh file.

  2. Put the compiled LLVM IR file of the program in the ./test/Trident and ./inst_count folder directories. The instructions should be indexed. For example, using instrument in LLFI. The file name should have following pattern <program_name>-profile_linked.ll

  3. Put the program input file (if any) in ./test/Trident and ./inst_count directories.

  4. Choose the LLVM IR instructions that are considered as the program output in ./test/Trident/getStoreMaskingRate.py (line:297).

  5. Update the paths, indexed LLVM IR file name (<program_name>), input command (<program_input>) and output file name (<output_file>) if any in ./inst-count/run_sampling.sh script according to the program being tested.

Execution - Trident

  1. Profile the dynamic footprint of the instructions of the program. This can be done in ./inst_count folder. Run the command bash run_sampling.sh. A log file called fi_breakdown.txt is generated.

  2. Copy the log file fi_breakdown.txt to the ./test folder. Trident will read and predict the SDC probabilities of the instructions provided in this log file.

  3. To execute Trident, run the command python prepare.py <program_name> "input command" in ./test/Trident folder. For example for blackscholes bench mark use the command python prepare.py blackscholes "1 in_4.txt output.txt".

  4. Trident will aggregate the overall SDC probability of the program based on their profiled dynamic footprint and store the result in ./test/Trident/prediction.results after command completion.

vTrident

vTrident is an extension of Trident. It simplifies the memory dependency sub-model of Trident to identify the variation of the SDC probablity of a given program with multiple program inputs. As a result, vTrident is much faster than either fault injection or Trident to bound the SDC probability of the program with multiple inputs.

Preparation - vTrident

  1. Profile the dynamic footprint of all the instruction of the program for all the inputs following steps provided for Trident. Rename the produced fi_breakdown.txt for each input as input_n-fi.txt where n is 0 and increments for each input.

  2. Place all the produced input_n-fi.txt files in ./test/vTrident/data directory.

  3. Put the compiled LLVM IR file of the program in the ./test/vTrident. The instructions should be indexed. For example, using instrument in LLFI. The file name should have following pattern <program_name>-llfi_index.ll

  4. If there are any program input files that are used in input command, place them in ./test/vTrident and if they have .txt extension, set the input_txt variable to 1 in ./test/vTrident/config.py .

  5. Choose the LLVM IR instructions that are considered as the program output in ./test/vTrident/getStoreMaskingRate.py (line:297).

  6. Configure the path for llvm_gcc binary (LLVMGCC),Trident checkout (ROOT), prgram_name used in step 3 (bmName) and input commands for all the inputs (inputList) in ./test/vTrident/config.py.

Execution - vTrident

To use vTrident execute the file ./test/vTrident/driver.py. After the execution of vTrident is complete, range of SDC and the input that can be used for finding median SDC using FI are provided in console and ./test/vTrident/results/variation.results.

Paper

Modeling Soft Error Propagation in Programs

http://blogs.ubc.ca/karthik/2018/03/04/modeling-soft-error-propagation-in-programs/

Modeling Input Dependent Error Propagation in Programs

http://blogs.ubc.ca/karthik/2018/03/04/modeling-input-dependent-error-propagation-in-programs/

trident's People

Contributors

cclinus avatar karthikp-ubc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trident's Issues

Errors I met when running this code.

I happen to be doing the same research,and found this awesome job.
This code runs very well, but I still met some errors about some test cases, for example, the 'susan' in Mibench.
Now I just make some null check, and dropped the error data, but I don't know if it will affect the analysis result.
The errors I met is as follows:

  1. In file $Trident-master/llvm-2.9/lib/Transforms/CmpProfileValue/Hello.cpp,line 123 and 124:
    // // Convert float to double FPExtInst* convertInst1 = new FPExtInst(cmpInst->getOperand(0), Type::getDoubleTy(appModule->getContext()), "convt1", instPos); FPExtInst* convertInst2 = new FPExtInst(cmpInst->getOperand(1), Type::getDoubleTy(appModule->getContext()), "convt2", instPos);
    fails the assertion " assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");"at some time.

  2. In file $Trident-master/llvm-2.9/lib/Transforms/StaticInstModeling/Hello.cpp, line 143:
    printf("%ld call %s: %.6f, %.6f, %.6f\n", curInstIndex, dyn_cast<CallInst>(curInst)->getCalledFunction()->getName(), curNode->accumPR, curNode->accumMR, curNode->accumCR);
    will report error some times.

How can I make instruction duplication with this work?

I found this code has the ability to make instruction duplication and duplication check.
But when I tried this, I found there may be some check functions used in the DuplicationCheck pass are not defined.
Is it defined in the file "sync_check.ll"? And where should I find it ?

Besides, how can I generate the "select_set_file" needed by the DuplicationCheck pass?
Thanks.

Questions I met when running this code

I'm sorry to say that I don't understand the fourth step in the preparation of Trident.What would I do for choosing the LLVM IR instructions?And when I run the ./test,the log file "fi_breakdown.txt" didnot update the probabilities of SDC,Benign,Crash and breakdown.It just equals to the log file "fi_breakdown.txt" generated in ./inst_count.

Questions I met when running this code

I'm sorry to say that I don't understand the fourth step in the preparation of Trident.What would I do for choosing the LLVM IR instructions?And when I run the ./test,the log file "fi_breakdown.txt" didnot update the probabilities of SDC,Benign,Crash and breakdown.It just equals to the log file "fi_breakdown.txt" generated in ./inst_count.

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.