@@ -166,14 +166,14 @@ def compile_gemm(
166
166
with Pool (num_cpus ) as pool :
167
167
compilation_results = list (tqdm (pool .starmap (compile_gemm , list (compile_args ))))
168
168
169
- error_count = 0
169
+ compile_error_count = 0
170
170
for tag , config , mlir_file , vmfb_file in compilation_results :
171
171
if vmfb_file :
172
172
vmfb_dict [vmfb_file ] = (tag , config )
173
173
else :
174
- error_count += 1
174
+ compile_error_count += 1
175
175
print (
176
- f"{ len (configs ) - error_count } Success, { error_count } Failed out of { len (configs )} configs"
176
+ f"{ len (configs ) - compile_error_count } Success, { compile_error_count } Failed out of { len (configs )} configs"
177
177
)
178
178
179
179
print ("Compilation process completed." )
@@ -190,6 +190,7 @@ def compile_gemm(
190
190
if not os .path .exists (csv_dir ):
191
191
os .makedirs (csv_dir )
192
192
193
+ run_error_count = 0
193
194
for vmfb_filename , value in vmfb_dict .items ():
194
195
tag , config = value
195
196
vmfb_hash = generate_md5_hex (vmfb_filename )
@@ -218,6 +219,8 @@ def compile_gemm(
218
219
# iree benchmark kernels
219
220
ret_value , cmd_out , cmd_err = run_iree_command (exec_args )
220
221
ok = ret_value == 0
222
+ if not ok :
223
+ run_error_count += 1
221
224
benchmark_gemm_mean_time_ms = bench_summary_process (ret_value , cmd_out )
222
225
benchmark_gemm_mean_time_us = benchmark_gemm_mean_time_ms * 1000
223
226
@@ -266,3 +269,8 @@ def compile_gemm(
266
269
267
270
write_results_to_csv (results , output_csv , fieldnames )
268
271
print (f"Results written to { output_csv } " )
272
+
273
+ if compile_error_count != 0 or run_error_count != 0 :
274
+ exit (1 )
275
+ else :
276
+ exit (0 )
0 commit comments