Skip to content

Commit a7be1b2

Browse files
authored
Rebuilding heaps after profile completes (#514)
* Redoing heaps after profile completes. Fixing incorrect config usage * Adding story number
1 parent 30cbbfe commit a7be1b2

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

model_analyzer/analyzer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def profile(self, client: TritonClient, gpus: List[GPUDevice], mode: str,
113113
logger.info("")
114114

115115
if not self._config.skip_summary_reports:
116+
self._result_manager.add_results_to_heaps()
116117
self._create_summary_tables(verbose)
117118
self._create_summary_reports(mode)
118119
logger.info(self._get_report_command_help_string())

model_analyzer/config/generate/quick_plus_concurrency_sweep_run_config_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _create_quick_run_config_generator(self) -> QuickRunConfigGenerator:
106106

107107
def _sweep_concurrency_over_top_results(self):
108108
top_results = self._result_manager.top_n_results(
109-
n=self._config.num_top_model_configs)
109+
n=self._config.num_configs_per_model)
110110

111111
for count, result in enumerate(top_results):
112112
new_config = self._create_new_config_command_profile(result)

model_analyzer/result/result_manager.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,16 @@ def _update_stats(statistics, result_heap, stats_key):
233233

234234
return result_stats
235235

236+
# TODO: TMA-898 This is the big hammer to fix the issues that arise because we
237+
# can create new measurements inside existing RCR's after the heaps have been
238+
# created either when re-profiling or running quick + brute w/ concurrency sweep
239+
def add_results_to_heaps(self):
240+
# Delete the current heaps
241+
self._per_model_sorted_results = defaultdict(ResultHeap)
242+
self._across_model_sorted_results = ResultHeap()
243+
244+
self._add_results_to_heaps()
245+
236246
def _init_state(self):
237247
"""
238248
Sets ResultManager object managed

0 commit comments

Comments
 (0)