105
105
"timm_efficientdet" : 1 ,
106
106
}
107
107
108
+ # These benchmarks took >600s on an i9-11900K CPU
109
+ VERY_SLOW_BENCHMARKS = {
110
+ "hf_BigBird" , # 3339s
111
+ "hf_Longformer" , # 3062s
112
+ "hf_T5" , # 930s
113
+ }
114
+
115
+ # These benchmarks took >60s on an i9-11900K CPU
116
+ SLOW_BENCHMARKS = {
117
+ * {
118
+ "BERT_pytorch" , # 137s
119
+ "demucs" , # 116s
120
+ "fastNLP_Bert" , # 242s
121
+ "hf_Albert" , # 221s
122
+ "hf_Bart" , # 400s
123
+ "hf_Bert" , # 334s
124
+ "hf_DistilBert" , # 187s
125
+ "hf_GPT2" , # 470s
126
+ "hf_Reformer" , # 141s
127
+ "speech_transformer" , # 317s
128
+ "vision_maskrcnn" , # 99s
129
+ },
130
+ * VERY_SLOW_BENCHMARKS ,
131
+ }
132
+
133
+
108
134
current_name = ""
109
135
current_device = ""
110
136
output_filename = None
@@ -646,6 +672,9 @@ def main():
646
672
parser .add_argument ("--float16" , action = "store_true" , help = "cast model to fp16" )
647
673
parser .add_argument ("--float32" , action = "store_true" , help = "cast model to fp32" )
648
674
parser .add_argument ("--cosine" , action = "store_true" , help = "use cosine similarity" )
675
+ parser .add_argument (
676
+ "--fast" , "-f" , action = "store_true" , help = "skip slow benchmarks"
677
+ )
649
678
parser .add_argument ("--only" , help = "used by --isolate to run just one model" )
650
679
parser .add_argument (
651
680
"--minimum-call-count" , type = int , help = "filter out graphs with too few ops"
@@ -808,9 +837,6 @@ def main():
808
837
}
809
838
)
810
839
811
- if args .no_skip :
812
- SKIP .clear ()
813
-
814
840
if args .nvfuser :
815
841
torch ._C ._jit_override_can_fuse_on_cpu (False )
816
842
torch ._C ._jit_override_can_fuse_on_gpu (False )
@@ -835,6 +861,12 @@ def main():
835
861
else :
836
862
model_iter_fn = forward_pass
837
863
864
+ if args .fast :
865
+ SKIP .update (SLOW_BENCHMARKS )
866
+
867
+ if args .devices == ["cpu" ]:
868
+ SKIP .update (VERY_SLOW_BENCHMARKS )
869
+
838
870
if args .no_skip :
839
871
SKIP .clear ()
840
872
@@ -1173,7 +1205,7 @@ def run_one_model(
1173
1205
1174
1206
if output_filename and "coverage" in output_filename :
1175
1207
results .append (
1176
- f"{ ok :3} /{ total :3} +{ frames_third_pass } frames { time .perf_counter ()- t0 :.0f} s"
1208
+ f"{ ok :3} /{ total :3} +{ frames_third_pass } frames { time .perf_counter ()- t0 :3 .0f} s"
1177
1209
)
1178
1210
1179
1211
results .append (experiment (model , example_inputs ))
0 commit comments