1717from  history  import  BenchmarkHistory 
1818from  utils .utils  import  prepare_workdir 
1919from  utils .compute_runtime  import  * 
20- from  presets  import  preset_get_by_name , presets 
20+ from  presets  import  enabled_suites , presets 
2121
2222import  argparse 
2323import  re 
@@ -164,7 +164,7 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
164164    failures  =  {}
165165
166166    for  s  in  suites :
167-         if  s .name () not  in   options .preset . suites ( ):
167+         if  s .name () not  in   enabled_suites ( options .preset ):
168168            continue 
169169
170170        suite_benchmarks  =  s .benchmarks ()
@@ -242,7 +242,10 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
242242    if  not  options .dry_run :
243243        chart_data  =  {this_name : results }
244244
245-     history  =  BenchmarkHistory (directory )
245+     results_dir  =  directory 
246+     if  options .custom_results_dir :
247+         results_dir  =  Path (options .custom_results_dir )
248+     history  =  BenchmarkHistory (results_dir )
246249    # limit how many files we load. 
247250    # should this be configurable? 
248251    history .load (1000 )
@@ -440,9 +443,15 @@ def validate_and_parse_env_args(env_args):
440443    parser .add_argument (
441444        "--preset" ,
442445        type = str ,
443-         choices = [p . name ()  for  p  in  presets ],
446+         choices = [p  for  p  in  presets . keys () ],
444447        help = "Benchmark preset to run." ,
445-         default = options .preset .name (),
448+         default = options .preset ,
449+     )
450+     parser .add_argument (
451+         "--results-dir" ,
452+         type = str ,
453+         help = "Specify a custom results directory" ,
454+         default = options .custom_results_dir ,
446455    )
447456
448457    args  =  parser .parse_args ()
@@ -469,7 +478,8 @@ def validate_and_parse_env_args(env_args):
469478    options .current_run_name  =  args .relative_perf 
470479    options .cudnn_directory  =  args .cudnn_directory 
471480    options .cublas_directory  =  args .cublas_directory 
472-     options .preset  =  preset_get_by_name (args .preset )
481+     options .preset  =  args .preset 
482+     options .custom_results_dir  =  args .results_dir 
473483
474484    if  args .build_igc  and  args .compute_runtime  is  None :
475485        parser .error ("--build-igc requires --compute-runtime to be set" )
0 commit comments