Skip to content

Commit 8ba6b55

Browse files
authored
Explicitly fail if data missing in analyze/report steps (#337)
1 parent 3cd8d8a commit 8ba6b55

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

model_analyzer/result/result_manager.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,10 @@ def compile_and_sort_results(self):
308308
]
309309
for model_name in analysis_model_names:
310310
if model_name not in results:
311-
logger.warning(
311+
raise TritonModelAnalyzerException(
312312
f"Model {model_name} requested for analysis but no results were found. "
313-
"Ensure that this model was actually profiled.")
313+
"Double check the name and ensure that this model was actually profiled."
314+
)
314315
else:
315316
result_dict = results[model_name]
316317
for (model_config, measurements) in result_dict.values():
@@ -351,9 +352,10 @@ def get_model_config_measurements(self, model_config_name):
351352

352353
if model_name not in results or model_config_name not in results[
353354
model_name]:
354-
logger.error(
355-
f'No results found for model config: {model_config_name}')
356-
return (None, [])
355+
raise TritonModelAnalyzerException(
356+
f"Model Config {model_config_name} requested for report step but no results were found. "
357+
"Double check the name and ensure that this model config was actually profiled."
358+
)
357359
else:
358360
model_config_data = results[model_name][model_config_name]
359361
return model_config_data[0], list(model_config_data[1].values())

0 commit comments

Comments
 (0)