File tree Expand file tree Collapse file tree 5 files changed +13
-6
lines changed Expand file tree Collapse file tree 5 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ jobs:
118118 "
119119 mkdir -p benchmark-output
120120 cp -r ".benchmarks/${{ inputs.benchmark_name }}" benchmark-output/${TRITONBENCH_SIDE_A_ENV}
121- rm -rf .benchmarks || true
121+ sudo rm -rf .benchmarks || true
122122 # post-process result.json
123123 latest_result_json=$(find ./benchmark-output/${TRITONBENCH_SIDE_A_ENV} -name "result.json" | sort -r | head -n 1)
124124 python3 ./.ci/test_infra/oss_ci_benchmark_v3.py --json ${latest_result_json} \
@@ -141,7 +141,7 @@ jobs:
141141 "
142142 mkdir -p benchmark-output
143143 cp -r ".benchmarks/${{ inputs.benchmark_name }}" benchmark-output/${TRITONBENCH_SIDE_B_ENV}
144- rm -rf .benchmarks || true
144+ sudo rm -rf .benchmarks || true
145145 # post-process result.json
146146 latest_result_json=$(find ./benchmark-output/${TRITONBENCH_SIDE_B_ENV} -name "result.json" | sort -r | head -n 1)
147147 python3 ./.ci/test_infra/oss_ci_benchmark_v3.py --json ${latest_result_json} \
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ def main() -> None:
119119 from tritonbench .utils .run_utils import run_in_task , setup_output_dir
120120
121121 output_files = []
122- run_timestamp , output_dir = setup_output_dir ("compile_time" )
122+ run_timestamp , output_dir = setup_output_dir ("compile_time" , ci = args . ci )
123123 op_args_list = {}
124124 if args .op :
125125 op_list = [args .op ]
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ def run():
7373 from tritonbench .utils .run_utils import run_in_task , setup_output_dir
7474 from tritonbench .utils .scuba_utils import decorate_benchmark_data , log_benchmark
7575
76- run_timestamp , output_dir = setup_output_dir ("nightly" )
76+ run_timestamp , output_dir = setup_output_dir ("nightly" , ci = args . ci )
7777 # Run each operator
7878 output_files = []
7979 operator_benchmarks = get_operator_benchmarks ()
Original file line number Diff line number Diff line change 44from contextlib import contextmanager
55from typing import Dict , List , Optional
66
7- from tritonbench .utils .env_utils import is_mtia
7+ try :
8+ from tritonbench .utils .env_utils import is_mtia
9+ except ModuleNotFoundError :
10+ # In CI environment, we don't have torch installed at this point
11+ is_mtia = lambda : False
812
913if is_mtia ():
1014 from tritonbench .utils .fb .mtia_utils import MTIA_COMPUTE_SPECS , MTIA_MEMORY_SPECS
Original file line number Diff line number Diff line change @@ -363,8 +363,11 @@ def run_in_task(
363363 sys .exit (1 )
364364
365365
366- def setup_output_dir (bm_name : str ):
366+ def setup_output_dir (bm_name : str , ci : bool = False ):
367367 current_timestamp = datetime .fromtimestamp (time .time ()).strftime ("%Y%m%d%H%M%S" )
368368 output_dir = BENCHMARKS_OUTPUT_DIR .joinpath (bm_name , f"run-{ current_timestamp } " )
369369 Path .mkdir (output_dir , parents = True , exist_ok = True )
370+ # set writable permission for all users (used by the ci env)
371+ if ci :
372+ output_dir .chmod (0o777 )
370373 return current_timestamp , output_dir .absolute ()
You can’t perform that action at this time.
0 commit comments