@@ -40,7 +40,12 @@ def read_series(csv_path: Path) -> Dict[str, List[float]]:
4040
4141
4242def _run_pt_benchmarks (
43- datasets : List [str ], algos : List [str ], steps : int , batch_size : int , seeds : List [int ], threads : int | None = None
43+ datasets : List [str ],
44+ algos : List [str ],
45+ steps : int ,
46+ batch_size : int ,
47+ seeds : List [int ],
48+ threads : int | None = None ,
4449) -> None :
4550 import os
4651 import subprocess
@@ -71,12 +76,14 @@ def _run_pt_benchmarks(
7176 env = dict (** os .environ )
7277 if threads and threads > 0 :
7378 t = str (threads )
74- env .update ({
75- "OMP_NUM_THREADS" : t ,
76- "MKL_NUM_THREADS" : t ,
77- "OPENBLAS_NUM_THREADS" : t ,
78- "NUMEXPR_NUM_THREADS" : t ,
79- })
79+ env .update (
80+ {
81+ "OMP_NUM_THREADS" : t ,
82+ "MKL_NUM_THREADS" : t ,
83+ "OPENBLAS_NUM_THREADS" : t ,
84+ "NUMEXPR_NUM_THREADS" : t ,
85+ }
86+ )
8087 cmd += ["--threads" , t ]
8188 subprocess .run (cmd , check = True , env = env )
8289
@@ -122,8 +129,12 @@ def main() -> None:
122129 parser .add_argument (
123130 "--output" , type = str , default = "docs/assets/benchmarks-{framework}-{dataset}.svg"
124131 )
125- parser .add_argument ("--threads" , type = int , default = 0 , help = "CPU threads to use for benchmarks (0=auto)" )
126- parser .add_argument ("--debug" , action = "store_true" , help = "Print debug info and write averaged CSVs" )
132+ parser .add_argument (
133+ "--threads" , type = int , default = 0 , help = "CPU threads to use for benchmarks (0=auto)"
134+ )
135+ parser .add_argument (
136+ "--debug" , action = "store_true" , help = "Print debug info and write averaged CSVs"
137+ )
127138 args = parser .parse_args ()
128139
129140 import matplotlib
@@ -199,7 +210,9 @@ def main() -> None:
199210 out_avg .parent .mkdir (parents = True , exist_ok = True )
200211 with out_avg .open ("w" , newline = "" ) as f :
201212 writer = csv .writer (f )
202- writer .writerow (["step" , "loss" , "metric" , "algo" , "dataset" , "framework" ]) # header
213+ writer .writerow (
214+ ["step" , "loss" , "metric" , "algo" , "dataset" , "framework" ]
215+ ) # header
203216 for s , loss_val , metric_val in zip (steps , avg_loss , avg_acc ):
204217 writer .writerow ([s , loss_val , label2 , algo , dataset , framework ])
205218
0 commit comments