File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
userbenchmark/dynamo/dynamobench Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,11 @@ def process_hf_reformer_output(out):
106106# on A100 GPUs - 40 GB.
107107BATCH_SIZE_KNOWN_MODELS = {}
108108
109+ # Run only this selected group of models, leave this empty to run everything
110+ TORCHBENCH_ONLY_MODELS = [
111+ m .strip () for m in os .getenv ("TORCHBENCH_ONLY_MODELS" , "" ).split ("," ) if m .strip ()
112+ ]
113+
109114
110115# TODO(sdym): use batch-size-file parameter of common.main, like torchbench.py
111
10A75
116 # Get the list of models and their batch sizes
@@ -116,6 +121,8 @@ def process_hf_reformer_output(out):
116121 lines = [line .rstrip () for line in lines ]
117122 for line in lines :
118123 model_name , batch_size = line .split ("," )
124+ if TORCHBENCH_ONLY_MODELS and model_name not in TORCHBENCH_ONLY_MODELS :
125+ continue
119126 batch_size = int (batch_size )
120127 BATCH_SIZE_KNOWN_MODELS [model_name ] = batch_size
121128assert len (BATCH_SIZE_KNOWN_MODELS )
Original file line number Diff line number Diff line change @@ -39,13 +39,20 @@ def pip_install(package):
3939 from timm .models import create_model
4040
4141TIMM_MODELS = {}
42- filename = os .path .join (os .path .dirname (__file__ ), "timm_models_list.txt" )
4342
43+ # Run only this selected group of models, leave this empty to run everything
44+ TORCHBENCH_ONLY_MODELS = [
45+ m .strip () for m in os .getenv ("TORCHBENCH_ONLY_MODELS" , "" ).split ("," ) if m .strip ()
46+ ]
47+
48+ filename = os .path .join (os .path .dirname (__file__ ), "timm_models_list.txt" )
4449with open (filename ) as fh :
4550 lines = fh .readlines ()
4651 lines = [line .rstrip () for line in lines ]
4752 for line in lines :
4853 model_name , batch_size = line .split (" " )
54+ if TORCHBENCH_ONLY_MODELS and model_name not in TORCHBENCH_ONLY_MODELS :
55+ continue
4956 TIMM_MODELS [model_name ] = int (batch_size )
5057
5158
You can’t perform that action at this time.
0 commit comments