From 16c00dd48fcc9efdde916b36222445307d2b4fbd Mon Sep 17 00:00:00 2001 From: Michael Goin Date: Tue, 1 Mar 2022 09:31:24 -0500 Subject: [PATCH] Validate that deepsparse.benchmark has recorded samples (#275) * Validate that deepsparse.benchmark has recorded samples * quality --- src/deepsparse/benchmark_model/stream_benchmark.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/deepsparse/benchmark_model/stream_benchmark.py b/src/deepsparse/benchmark_model/stream_benchmark.py index 5d24a5cd65..26cdd1de26 100644 --- a/src/deepsparse/benchmark_model/stream_benchmark.py +++ b/src/deepsparse/benchmark_model/stream_benchmark.py @@ -115,6 +115,11 @@ def model_stream_benchmark( else: raise Exception(f"Unknown scenario '{scenario}'") + if len(batch_times) == 0: + raise Exception( + "Generated no batch timings, try extending benchmark time with '--time'" + ) + # Convert times to milliseconds batch_times_ms = [ (batch_time[1] - batch_time[0]) * 1000 for batch_time in batch_times