Skip to content

Commit 6938569

Browse files
authored
Add --exit-on-exception to exit process on any exception (meta-pytorch#460)
1 parent c6c6962 commit 6938569

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tritonbench/utils/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ def get_parser(args=None):
154154
"--keep-going",
155155
action="store_true",
156156
)
157+
parser.add_argument(
158+
"--exit-on-exception",
159+
action="store_true",
160+
default=False,
161+
help="Immediately terminate the process if any operator run raises an exception.",
162+
)
157163
parser.add_argument(
158164
"--input-id",
159165
type=int,

tritonbench/utils/triton_op.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,8 @@ def _reduce_benchmarks(acc, bm_name: str):
994994
"Caught exception, terminating early with partial results",
995995
exc_info=True,
996996
)
997+
if self.tb_args.exit_on_exception:
998+
os._exit(1)
997999
raise
9981000
finally:
9991001
self.output = BenchmarkOperatorResult(

0 commit comments

Comments
 (0)