File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -469,7 +469,22 @@ def _inner() -> Callable[..., Any] | object:
469
469
tb_args , unknown_args = tb_parser .parse_known_args (tritonbench_args )
470
470
471
471
# Use tritonbench's _run function which handles arg processing
472
- _run (tb_args , unknown_args )
472
+ result = _run (tb_args , unknown_args )
473
+
474
+ # Check if any errors occurred during benchmarking
475
+ if hasattr (result , "result" ):
476
+ for _ , impl_results in result .result :
477
+ for impl_name , metrics in impl_results .items ():
478
+ # Only sys.exit for Helion kernels.
479
+ # If a Helion kernel crashes in main process after autotuning, re-running it in a new process will usually work.
480
+ # sys.exit(1) here helps the outside script detect the error and re-run it.
481
+ if (
482
+ impl_name .startswith ("helion" )
483
+ and hasattr (metrics , "error_msg" )
484
+ and metrics .error_msg
485
+ ):
486
+ print (f"Error in { impl_name } : { metrics .error_msg } " , file = sys .stderr )
487
+ sys .exit (1 )
473
488
474
489
# Force garbage collection multiple times to ensure memory is freed
475
490
for _ in range (3 ):
You can’t perform that action at this time.
0 commit comments