Skip to content

Commit 85e1c9a

Browse files
authored
[SOT] Always use dummy_guard when fallback error occurred (#72194)
1 parent f0674dd commit 85e1c9a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

python/paddle/jit/sot/opcode_translator/executor/executor_cache.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,21 +292,16 @@ def start_translate(
292292
raise InnerError(
293293
f"{simulator.vframe.code.co_name} should not fallback, but got '{e}'"
294294
)
295-
# if disable_eval_frame is True, it means we want fallback to speedup rather than error occurred
296-
if is_strict_mode() and e.disable_eval_frame is False:
295+
if is_strict_mode():
297296
raise
298297
log(
299298
2,
300299
f"Unsupported Frame is {frame.f_code}, error message is: \n"
301300
+ "".join(traceback.format_exception(type(e), e, e.__traceback__)),
302301
)
303-
# simulation not complete, not sure whether this code has sir, set disable_eval_frame = False
304-
guard_fn = (
305-
dummy_guard if e.disable_eval_frame is False else simulator.guard_fn
306-
)
307302
return (
308303
CustomCode(None, e.disable_eval_frame),
309-
guard_fn,
304+
dummy_guard,
310305
)
311306
except Exception as e:
312307
raise InnerError(OpcodeExecutorBase.error_message_summary(e)) from e

0 commit comments

Comments
 (0)