@@ -218,7 +218,9 @@ def compile_cuda_script( # # noqa: C901
218218 )
219219
220220
221- def run_program (args : list [str ], seed : Optional [int ], timeout : int , multi_gpu : bool = False ) -> RunResult :
221+ def run_program (
222+ args : list [str ], seed : Optional [int ], timeout : int , multi_gpu : bool = False
223+ ) -> RunResult :
222224 print ("[Running]" )
223225 # set up a pipe so the tester can communicate its verdict with us
224226 env = os .environ .copy ()
@@ -229,6 +231,7 @@ def run_program(args: list[str], seed: Optional[int], timeout: int, multi_gpu: b
229231
230232 if multi_gpu :
231233 import torch
234+
232235 env ["POPCORN_GPUS" ] = str (torch .cuda .device_count ())
233236
234237 execution_start_time = time .perf_counter ()
@@ -302,7 +305,9 @@ def run_single_evaluation(
302305 with tempfile .NamedTemporaryFile ("w" ) as tests_file :
303306 tests_file .write (tests )
304307 tests_file .flush ()
305- return run_program (call + [mode , tests_file .name ], seed = seed , timeout = test_timeout , multi_gpu = multi_gpu )
308+ return run_program (
309+ call + [mode , tests_file .name ], seed = seed , timeout = test_timeout , multi_gpu = multi_gpu
310+ )
306311 elif mode in ["benchmark" , "profile" , "leaderboard" ]:
307312 timeout = ranked_timeout if mode == "leaderboard" else benchmark_timeout
308313 with tempfile .NamedTemporaryFile ("w" ) as bench_file :
@@ -311,7 +316,9 @@ def run_single_evaluation(
311316 else :
312317 bench_file .write (benchmarks )
313318 bench_file .flush ()
314- return run_program (call + [mode , bench_file .name ], seed = seed , timeout = timeout , multi_gpu = multi_gpu )
319+ return run_program (
320+ call + [mode , bench_file .name ], seed = seed , timeout = timeout , multi_gpu = multi_gpu
321+ )
315322 else :
316323 raise ValueError (f"Invalid mode { mode } " )
317324
0 commit comments