Skip to content

Commit

Permalink
Removing client from quick/optuna RCGs
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-braf committed May 16, 2024
1 parent cb67953 commit 40f277a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from model_analyzer.result.parameter_search import ParameterSearch
from model_analyzer.result.result_manager import ResultManager
from model_analyzer.result.run_config_measurement import RunConfigMeasurement
from model_analyzer.triton.client.client import TritonClient

from .config_generator_interface import ConfigGeneratorInterface

Expand All @@ -52,7 +51,6 @@ def __init__(
config: ConfigCommandProfile,
gpus: List[GPUDevice],
models: List[ModelProfileSpec],
client: TritonClient,
result_manager: ResultManager,
model_variant_name_manager: ModelVariantNameManager,
search_parameters: SearchParameters,
Expand All @@ -65,7 +63,6 @@ def __init__(
gpus: List of GPUDevices
models: List of ModelProfileSpec
List of models to profile
client: TritonClient
result_manager: ResultManager
The object that handles storing and sorting the results from the perf analyzer
model_variant_name_manager: ModelVariantNameManager
Expand All @@ -76,7 +73,6 @@ def __init__(
self._config = config
self._gpus = gpus
self._models = models
self._client = client
self._result_manager = result_manager
self._model_variant_name_manager = model_variant_name_manager
self._search_parameters = search_parameters
Expand Down Expand Up @@ -119,7 +115,6 @@ def _create_optuna_run_config_generator(self) -> OptunaRunConfigGenerator:
config=self._config,
gpus=self._gpus,
models=self._models,
client=self._client,
model_variant_name_manager=self._model_variant_name_manager,
search_parameters=self._search_parameters,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from model_analyzer.device.gpu_device import GPUDevice
from model_analyzer.perf_analyzer.perf_config import PerfAnalyzerConfig
from model_analyzer.result.run_config_measurement import RunConfigMeasurement
from model_analyzer.triton.client.client import TritonClient
from model_analyzer.triton.model.model_config import ModelConfig
from model_analyzer.triton.model.model_config_variant import ModelConfigVariant

Expand All @@ -49,15 +48,14 @@

class OptunaRunConfigGenerator(ConfigGeneratorInterface):
"""
Hill climbing algorithm to create RunConfigs
Use Optuna algorithm to create RunConfigs
"""

def __init__(
self,
config: ConfigCommandProfile,
gpus: List[GPUDevice],
models: List[ModelProfileSpec],
client: TritonClient,
model_variant_name_manager: ModelVariantNameManager,
search_parameters: SearchParameters,
seed: Optional[int] = 0,
Expand All @@ -70,13 +68,11 @@ def __init__(
gpus: List of GPUDevices
models: List of ModelProfileSpec
List of models to profile
client: TritonClient
model_variant_name_manager: ModelVariantNameManager
search_parameters: SearchParameters
The object that handles the users configuration search parameters
"""
self._config = config
self._client = client
self._gpus = gpus
self._models = models
self._search_parameters = search_parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from model_analyzer.result.parameter_search import ParameterSearch
from model_analyzer.result.result_manager import ResultManager
from model_analyzer.result.run_config_measurement import RunConfigMeasurement
from model_analyzer.triton.client.client import TritonClient

from .config_generator_interface import ConfigGeneratorInterface

Expand All @@ -54,7 +53,6 @@ def __init__(
gpus: List[GPUDevice],
models: List[ModelProfileSpec],
composing_models: List[ModelProfileSpec],
client: TritonClient,
result_manager: ResultManager,
model_variant_name_manager: ModelVariantNameManager,
):
Expand All @@ -70,7 +68,6 @@ def __init__(
List of models to profile
composing_models: List of ModelProfileSpec
List of composing models that exist inside of the supplied models
client: TritonClient
result_manager: ResultManager
The object that handles storing and sorting the results from the perf analyzer
model_variant_name_manager: ModelVariantNameManager
Expand All @@ -81,7 +78,6 @@ def __init__(
self._gpus = gpus
self._models = models
self._composing_models = composing_models
self._client = client
self._result_manager = result_manager
self._model_variant_name_manager = model_variant_name_manager

Expand Down Expand Up @@ -125,7 +121,6 @@ def _create_quick_run_config_generator(self) -> QuickRunConfigGenerator:
gpus=self._gpus,
models=self._models,
composing_models=self._composing_models,
client=self._client,
model_variant_name_manager=self._model_variant_name_manager,
)

Expand Down
4 changes: 0 additions & 4 deletions model_analyzer/config/generate/quick_run_config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from model_analyzer.device.gpu_device import GPUDevice
from model_analyzer.perf_analyzer.perf_config import PerfAnalyzerConfig
from model_analyzer.result.run_config_measurement import RunConfigMeasurement
from model_analyzer.triton.client.client import TritonClient
from model_analyzer.triton.model.model_config import ModelConfig
from model_analyzer.triton.model.model_config_variant import ModelConfigVariant

Expand All @@ -63,7 +62,6 @@ def __init__(
gpus: List[GPUDevice],
models: List[ModelProfileSpec],
composing_models: List[ModelProfileSpec],
client: TritonClient,
model_variant_name_manager: ModelVariantNameManager,
):
"""
Expand All @@ -78,12 +76,10 @@ def __init__(
List of models to profile
composing_models: List of ModelProfileSpec
List of composing model profiles
client: TritonClient
model_variant_name_manager: ModelVariantNameManager
"""
self._search_config = search_config
self._config = config
self._client = client
self._gpus = gpus
self._models = models
self._composing_models = composing_models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def create_run_config_generator(
command_config=command_config,
gpus=gpus,
models=new_models,
client=client,
result_manager=result_manager,
search_parameters=search_parameters,
model_variant_name_manager=model_variant_name_manager,
Expand All @@ -108,7 +107,6 @@ def create_run_config_generator(
gpus=gpus,
models=new_models,
composing_models=composing_models,
client=client,
result_manager=result_manager,
model_variant_name_manager=model_variant_name_manager,
)
Expand Down Expand Up @@ -149,7 +147,6 @@ def _create_optuna_plus_concurrency_sweep_run_config_generator(
command_config: ConfigCommandProfile,
gpus: List[GPUDevice],
models: List[ModelProfileSpec],
client: TritonClient,
result_manager: ResultManager,
model_variant_name_manager: ModelVariantNameManager,
search_parameters: SearchParameters,
Expand All @@ -158,7 +155,6 @@ def _create_optuna_plus_concurrency_sweep_run_config_generator(
config=command_config,
gpus=gpus,
models=models,
client=client,
result_manager=result_manager,
model_variant_name_manager=model_variant_name_manager,
search_parameters=search_parameters,
Expand All @@ -170,7 +166,6 @@ def _create_quick_plus_concurrency_sweep_run_config_generator(
gpus: List[GPUDevice],
models: List[ModelProfileSpec],
composing_models: List[ModelProfileSpec],
client: TritonClient,
result_manager: ResultManager,
model_variant_name_manager: ModelVariantNameManager,
) -> ConfigGeneratorInterface:
Expand All @@ -183,7 +178,6 @@ def _create_quick_plus_concurrency_sweep_run_config_generator(
gpus=gpus,
models=models,
composing_models=composing_models,
client=client,
result_manager=result_manager,
model_variant_name_manager=model_variant_name_manager,
)
Expand Down
1 change: 0 additions & 1 deletion tests/test_optuna_run_config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def setUp(self):
config=config,
gpus=[GPUDevice("TEST_DEVICE_NAME", 0, "TEST_BUS_ID0", "TEST_UUID0")],
models=self._mock_models,
client=MagicMock(),
model_variant_name_manager=ModelVariantNameManager(),
search_parameters=MagicMock(),
seed=100,
Expand Down
14 changes: 1 addition & 13 deletions tests/test_quick_run_config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def setUp(self):
MagicMock(),
self._mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)

Expand All @@ -207,7 +206,6 @@ def test_get_starting_coordinate(self):
MagicMock(),
self._mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)
self.assertEqual(qrcg._get_starting_coordinate(), Coordinate([2, 1, 3]))
Expand Down Expand Up @@ -276,7 +274,6 @@ def test_get_next_run_config(self):
MagicMock(),
mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -448,7 +445,6 @@ def test_get_next_run_config_multi_model(self):
MagicMock(),
mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -533,7 +529,7 @@ def test_default_config_generation(self):

sc = SearchConfig(dimensions=dims, radius=5, min_initialized=2)
qrcg = QuickRunConfigGenerator(
sc, config, ["GPU0"], models, {}, MagicMock(), ModelVariantNameManager()
sc, config, ["GPU0"], models, {}, ModelVariantNameManager()
)

default_run_config = qrcg._create_default_run_config()
Expand Down Expand Up @@ -599,7 +595,6 @@ def test_default_ensemble_config_generation(self):
MagicMock(),
models,
ensemble_composing_models,
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -681,7 +676,6 @@ def test_default_bls_config_generation(self):
MagicMock(),
models,
bls_composing_models,
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -759,7 +753,6 @@ def test_get_next_run_config_max_batch_size(self):
MagicMock(),
self._mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -812,7 +805,6 @@ def test_get_next_run_config_max_instance_count(self):
MagicMock(),
self._mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -865,7 +857,6 @@ def test_get_next_run_config_min_batch_size(self):
MagicMock(),
self._mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -918,7 +909,6 @@ def test_get_next_run_config_min_instance_count(self):
MagicMock(),
self._mock_models,
{},
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -1093,7 +1083,6 @@ def _get_next_run_config_ensemble(self, max_concurrency=0, min_concurrency=0):
MagicMock(),
models,
ensemble_composing_models,
MagicMock(),
ModelVariantNameManager(),
)

Expand Down Expand Up @@ -1283,7 +1272,6 @@ def _get_next_run_config_bls(self, max_concurrency=0, min_concurrency=0):
MagicMock(),
models,
bls_composing_models,
MagicMock(),
ModelVariantNameManager(),
)

Expand Down

0 comments on commit 40f277a

Please sign in to comment.