-
Notifications
You must be signed in to change notification settings - Fork 78
Add support for custom intervals #814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d92cfba
8c0c70e
0ebae08
71e7a90
6b3a199
57735dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
|
||
import logging | ||
from copy import deepcopy | ||
from typing import Generator, List, Optional | ||
from typing import Dict, Generator, List, Optional | ||
|
||
from model_analyzer.config.generate.model_profile_spec import ModelProfileSpec | ||
from model_analyzer.config.generate.model_variant_name_manager import ( | ||
|
@@ -139,7 +139,10 @@ def _sweep_concurrency_over_top_results(self) -> Generator[RunConfig, None, None | |
|
||
for result in top_results: | ||
run_config = deepcopy(result.run_config()) | ||
parameter_search = ParameterSearch(self._config) | ||
perf_analyzer_flags = self._get_model_perf_analyzer_flags(model_name) | ||
parameter_search = ParameterSearch( | ||
self._config, perf_analyzer_flags=perf_analyzer_flags | ||
) | ||
for concurrency in parameter_search.search_parameters(): | ||
run_config = self._set_concurrency(run_config, concurrency) | ||
yield run_config | ||
|
@@ -151,3 +154,9 @@ def _set_concurrency(self, run_config: RunConfig, concurrency: int) -> RunConfig | |
perf_config.update_config({"concurrency-range": concurrency}) | ||
|
||
return run_config | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method is duplicated (also in brute search). Maybe this should be a static method in ModelProfileSpec? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is still duplicated. I didn't clean it up yet. Both classes implement ConfigGeneratorInterface. You could create a base class with common code if you want. |
||
def _get_model_perf_analyzer_flags(self, model_name: str) -> Dict: | ||
|
||
for model in self._models: | ||
if model_name == model.model_name(): | ||
return model.perf_analyzer_flags() | ||
return {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -512,10 +512,10 @@ def _get_next_perf_analyzer_config( | |
|
||
perf_analyzer_config.update_config_from_profile_config(model_name, self._config) | ||
|
||
concurrency = self._calculate_concurrency(dimension_values) | ||
|
||
perf_config_params = {"batch-size": 1, "concurrency-range": concurrency} | ||
perf_analyzer_config.update_config(perf_config_params) | ||
if not model.is_load_specified(): | ||
concurrency = self._calculate_concurrency(dimension_values) | ||
perf_config_params = {"concurrency-range": concurrency} | ||
perf_analyzer_config.update_config(perf_config_params) | ||
|
||
perf_analyzer_config.update_config(model.perf_analyzer_flags()) | ||
return perf_analyzer_config | ||
|
@@ -705,13 +705,10 @@ def _create_default_perf_analyzer_config( | |
model_config.get_field("name"), self._config | ||
) | ||
|
||
default_concurrency = self._calculate_default_concurrency(model_config) | ||
|
||
perf_config_params = { | ||
"batch-size": DEFAULT_BATCH_SIZES, | ||
"concurrency-range": default_concurrency, | ||
} | ||
default_perf_analyzer_config.update_config(perf_config_params) | ||
if not "request-intervals" in model.perf_analyzer_flags(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing a self-review: I'm wondering if this should be |
||
default_concurrency = self._calculate_default_concurrency(model_config) | ||
perf_config_params = {"concurrency-range": default_concurrency} | ||
default_perf_analyzer_config.update_config(perf_config_params) | ||
|
||
default_perf_analyzer_config.update_config(model.perf_analyzer_flags()) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.