|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | from typing import List, Union, Optional |
16 | | -import os, sys |
| 16 | +import sys |
17 | 17 | from model_analyzer.constants import LOGGER_NAME, PA_ERROR_LOG_FILENAME |
18 | 18 | from .model_manager import ModelManager |
19 | 19 | from .result.result_manager import ResultManager |
@@ -126,9 +126,17 @@ def profile(self, client: TritonClient, gpus: List[GPUDevice], mode: str, |
126 | 126 | if not self._config.skip_summary_reports: |
127 | 127 | self._create_summary_tables(verbose) |
128 | 128 | self._create_summary_reports(mode) |
129 | | - self._create_detailed_reports() |
130 | 129 |
|
131 | | - self._check_for_perf_analyzer_errors() |
| 130 | + # TODO-TMA-650: Detailed reporting not supported for multi-model |
| 131 | + if not self._config.run_config_profile_models_concurrently_enable: |
| 132 | + for model in self._config.profile_models: |
| 133 | + logger.info( |
| 134 | + self._get_report_command_help_string( |
| 135 | + model.model_name())) |
| 136 | + |
| 137 | + if self._metrics_manager.encountered_perf_analyzer_error(): |
| 138 | + logger.warning(f"Perf Analyzer encountered an error when profiling one or more configurations. " \ |
| 139 | + f"See {self._config.export_path}/{PA_ERROR_LOG_FILENAME} for further details.\n") |
132 | 140 |
|
133 | 141 | def report(self, mode: str) -> None: |
134 | 142 | """ |
@@ -272,28 +280,18 @@ def _get_num_profiled_configs(self): |
272 | 280 | ]) |
273 | 281 |
|
274 | 282 | def _get_report_command_help_string(self, model_name: str) -> str: |
275 | | - top_n_model_config_names = self._get_top_n_model_config_names( |
276 | | - n=self._config.num_configs_per_model, model_name=model_name) |
| 283 | + top_3_model_config_names = self._get_top_n_model_config_names( |
| 284 | + n=3, model_name=model_name) |
277 | 285 | return ( |
278 | 286 | f'To generate detailed reports for the ' |
279 | | - f'{len(top_n_model_config_names)} best {model_name} configurations, run ' |
280 | | - f'`{self._get_report_command_string(top_n_model_config_names)}`') |
281 | | - |
282 | | - def _run_report_command(self, model_name: str) -> None: |
283 | | - top_n_model_config_names = self._get_top_n_model_config_names( |
284 | | - n=self._config.num_configs_per_model, model_name=model_name) |
285 | | - top_n_string = ','.join(top_n_model_config_names) |
286 | | - logger.info( |
287 | | - f'Generating detailed reports for the best configurations {top_n_string}:' |
288 | | - ) |
289 | | - os.system( |
290 | | - f'{self._get_report_command_string(top_n_model_config_names)}') |
| 287 | + f'{len(top_3_model_config_names)} best {model_name} configurations, run ' |
| 288 | + f'`{self._get_report_command_string(top_3_model_config_names)}`') |
291 | 289 |
|
292 | 290 | def _get_report_command_string(self, |
293 | | - top_n_model_config_names: List[str]) -> str: |
| 291 | + top_3_model_config_names: List[str]) -> str: |
294 | 292 | report_command_string = (f'model-analyzer report ' |
295 | 293 | f'--report-model-configs ' |
296 | | - f'{",".join(top_n_model_config_names)}') |
| 294 | + f'{",".join(top_3_model_config_names)}') |
297 | 295 |
|
298 | 296 | if self._config.export_path is not None: |
299 | 297 | report_command_string += (f' --export-path ' |
@@ -338,19 +336,3 @@ def _multiple_models_in_report_model_config(self) -> bool: |
338 | 336 | ] |
339 | 337 |
|
340 | 338 | return len(set(model_names)) > 1 |
341 | | - |
342 | | - def _check_for_perf_analyzer_errors(self) -> None: |
343 | | - if self._metrics_manager.encountered_perf_analyzer_error(): |
344 | | - logger.warning(f"Perf Analyzer encountered an error when profiling one or more configurations. " \ |
345 | | - f"See {self._config.export_path}/{PA_ERROR_LOG_FILENAME} for further details.\n") |
346 | | - |
347 | | - def _create_detailed_reports(self) -> None: |
348 | | - # TODO-TMA-650: Detailed reporting not supported for multi-model |
349 | | - if not self._config.run_config_profile_models_concurrently_enable: |
350 | | - for model in self._config.profile_models: |
351 | | - if not self._config.skip_detailed_reports: |
352 | | - self._run_report_command(model.model_name()) |
353 | | - else: |
354 | | - logger.info( |
355 | | - self._get_report_command_help_string( |
356 | | - model.model_name())) |
0 commit comments