From aaf9a535bd91c0ee005bafd98e7dafeeffdd1559 Mon Sep 17 00:00:00 2001 From: Anushree Bannadabhavi Date: Sat, 23 Jul 2022 05:41:39 -0700 Subject: [PATCH] Fault injection minor fix (#21) * Minor fix in fault injection for newer ML models --- llvm_passes/CustomTensorOperatorInstSelector.cpp | 5 ++++- runtime_lib/FaultInjectionLib.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/llvm_passes/CustomTensorOperatorInstSelector.cpp b/llvm_passes/CustomTensorOperatorInstSelector.cpp index 2adc9284..9b512773 100644 --- a/llvm_passes/CustomTensorOperatorInstSelector.cpp +++ b/llvm_passes/CustomTensorOperatorInstSelector.cpp @@ -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()) diff --git a/runtime_lib/FaultInjectionLib.c b/runtime_lib/FaultInjectionLib.c index c67ca3ec..32543944 100755 --- a/runtime_lib/FaultInjectionLib.c +++ b/runtime_lib/FaultInjectionLib.c @@ -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)