Skip to content

Commit

Permalink
Fault injection minor fix (#21)
Browse files Browse the repository at this point in the history
* Minor fix in fault injection for newer ML models
  • Loading branch information
AnushreeBannadabhavi authored Jul 23, 2022
1 parent c3ce575 commit aaf9a53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion llvm_passes/CustomTensorOperatorInstSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ class CustomTensorOperatorInstSelector : public HardwareFIInstSelector {
{"matmul", 119251066446157},
{"add", 6579265},
{"avgpool", 30521821365761601},
{"softmax", 33884119937478483}
{"softmax", 33884119937478483},
{"loop", 1886351180},
{"nonmaxs", 23494782373228366},
{"unsqueeze", 28540527736745557}
};

if (ONNXOperatorId.find(opname) == ONNXOperatorId.end())
Expand Down
5 changes: 3 additions & 2 deletions runtime_lib/FaultInjectionLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ void initInjections() {

bool preFunc(long llfi_index, unsigned opcode, unsigned my_reg_index,
unsigned total_reg_target_num) {
assert(opcodecyclearray[opcode] >= 0 &&
"opcode does not exist, need to update instructions.def");
if (opcodecyclearray[opcode] < 0 &&
"opcode does not exist, need to update instructions.def")
return false;

if (! fiFlag) return false;
if (my_reg_index == 0)
Expand Down

0 comments on commit aaf9a53

Please sign in to comment.