Skip to content

Commit 4cf87d3

Browse files
authored
Fix live quick search (#513)
* Fix issue with not sweeping concurrencies * Fix CPU vs GPU kind * Fix issue with an error being printed out when it shouldn't
1 parent a7be1b2 commit 4cf87d3

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

model_analyzer/config/generate/quick_plus_concurrency_sweep_run_config_generator.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,20 @@ def get_configs(self) -> Generator[RunConfig, None, None]:
8787
RunConfig
8888
The next RunConfig generated by this class
8989
"""
90+
91+
logger.info("")
92+
logger.info("Starting quick mode search to find optimal configs")
93+
logger.info("")
9094
yield from self._execute_quick_search()
95+
logger.info("")
96+
logger.info(
97+
"Done with quick mode search. Gathering concurrency sweep measurements for reports"
98+
)
99+
logger.info("")
91100
yield from self._sweep_concurrency_over_top_results()
101+
logger.info("")
102+
logger.info("Done gathering concurrency sweep measurements for reports")
103+
logger.info("")
92104

93105
def _execute_quick_search(self):
94106
self._rcg = self._create_quick_run_config_generator()

model_analyzer/config/generate/quick_run_config_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,14 @@ def _get_next_model_config(self, model_num: int) -> ModelConfig:
286286
dimension_values = self._get_coordinate_values(
287287
self._coordinate_to_measure, model_num)
288288

289+
kind = "KIND_CPU" if self._models[model_num].cpu_only() else "KIND_GPU"
289290
param_combo = {
290291
'dynamic_batching': {},
291292
'max_batch_size':
292293
dimension_values['max_batch_size'],
293294
'instance_group': [{
294295
'count': dimension_values['instance_count'],
295-
'kind': "KIND_GPU",
296+
'kind': kind,
296297
}]
297298
}
298299

model_analyzer/result/result_manager.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def _complete_profile_setup(self):
279279
else:
280280
self._setup_for_sequential_analysis()
281281

282-
self._add_results_to_heaps()
282+
self._add_results_to_heaps(suppress_warnings=True)
283283

284284
def _complete_analyze_setup(self):
285285
self._create_concurrent_analysis_model_name()
@@ -290,7 +290,7 @@ def _complete_analyze_setup(self):
290290
self._setup_for_sequential_analysis()
291291

292292
self._check_for_models_in_checkpoint()
293-
self._add_results_to_heaps()
293+
self._add_results_to_heaps(suppress_warnings=False)
294294

295295
def _create_concurrent_analysis_model_name(self):
296296
analysis_model_names = [
@@ -383,7 +383,7 @@ def _check_for_models_in_checkpoint(self):
383383
f"The model {model_name} was not found in the loaded checkpoint."
384384
)
385385

386-
def _add_results_to_heaps(self):
386+
def _add_results_to_heaps(self, suppress_warnings=False):
387387
"""
388388
Construct and add results to individual result heaps
389389
as well as global result heap
@@ -392,7 +392,8 @@ def _add_results_to_heaps(self):
392392
'ResultManager.results')
393393

394394
for model_name in self._analysis_model_names:
395-
model_measurements = results.get_model_measurements_dict(model_name)
395+
model_measurements = results.get_model_measurements_dict(
396+
model_name, suppress_warnings)
396397

397398
# Only add in models that exist in the checkpoint
398399
if not model_measurements:

0 commit comments

Comments
 (0)