From 40f277ab6cac06c6a73e21174d3747845336af9d Mon Sep 17 00:00:00 2001 From: Brian Raf Date: Thu, 16 May 2024 19:15:50 +0000 Subject: [PATCH] Removing client from quick/optuna RCGs --- ..._plus_concurrency_sweep_run_config_generator.py | 5 ----- .../config/generate/optuna_run_config_generator.py | 6 +----- ..._plus_concurrency_sweep_run_config_generator.py | 5 ----- .../config/generate/quick_run_config_generator.py | 4 ---- .../generate/run_config_generator_factory.py | 6 ------ tests/test_optuna_run_config_generator.py | 1 - tests/test_quick_run_config_generator.py | 14 +------------- 7 files changed, 2 insertions(+), 39 deletions(-) diff --git a/model_analyzer/config/generate/optuna_plus_concurrency_sweep_run_config_generator.py b/model_analyzer/config/generate/optuna_plus_concurrency_sweep_run_config_generator.py index 7dfc621eb..49dc4ce2e 100755 --- a/model_analyzer/config/generate/optuna_plus_concurrency_sweep_run_config_generator.py +++ b/model_analyzer/config/generate/optuna_plus_concurrency_sweep_run_config_generator.py @@ -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 @@ -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, @@ -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 @@ -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 @@ -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, ) diff --git a/model_analyzer/config/generate/optuna_run_config_generator.py b/model_analyzer/config/generate/optuna_run_config_generator.py index 5a0947bcc..9df1a4fbc 100755 --- a/model_analyzer/config/generate/optuna_run_config_generator.py +++ b/model_analyzer/config/generate/optuna_run_config_generator.py @@ -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 @@ -49,7 +48,7 @@ class OptunaRunConfigGenerator(ConfigGeneratorInterface): """ - Hill climbing algorithm to create RunConfigs + Use Optuna algorithm to create RunConfigs """ def __init__( @@ -57,7 +56,6 @@ def __init__( config: ConfigCommandProfile, gpus: List[GPUDevice], models: List[ModelProfileSpec], - client: TritonClient, model_variant_name_manager: ModelVariantNameManager, search_parameters: SearchParameters, seed: Optional[int] = 0, @@ -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 diff --git a/model_analyzer/config/generate/quick_plus_concurrency_sweep_run_config_generator.py b/model_analyzer/config/generate/quick_plus_concurrency_sweep_run_config_generator.py index b7adbef97..74f7c4a3f 100755 --- a/model_analyzer/config/generate/quick_plus_concurrency_sweep_run_config_generator.py +++ b/model_analyzer/config/generate/quick_plus_concurrency_sweep_run_config_generator.py @@ -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 @@ -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, ): @@ -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 @@ -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 @@ -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, ) diff --git a/model_analyzer/config/generate/quick_run_config_generator.py b/model_analyzer/config/generate/quick_run_config_generator.py index 1704d03ee..4dd00547e 100755 --- a/model_analyzer/config/generate/quick_run_config_generator.py +++ b/model_analyzer/config/generate/quick_run_config_generator.py @@ -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 @@ -63,7 +62,6 @@ def __init__( gpus: List[GPUDevice], models: List[ModelProfileSpec], composing_models: List[ModelProfileSpec], - client: TritonClient, model_variant_name_manager: ModelVariantNameManager, ): """ @@ -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 diff --git a/model_analyzer/config/generate/run_config_generator_factory.py b/model_analyzer/config/generate/run_config_generator_factory.py index dce8322f9..cb8bf20a2 100755 --- a/model_analyzer/config/generate/run_config_generator_factory.py +++ b/model_analyzer/config/generate/run_config_generator_factory.py @@ -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, @@ -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, ) @@ -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, @@ -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, @@ -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: @@ -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, ) diff --git a/tests/test_optuna_run_config_generator.py b/tests/test_optuna_run_config_generator.py index e041822dc..5eecf9243 100755 --- a/tests/test_optuna_run_config_generator.py +++ b/tests/test_optuna_run_config_generator.py @@ -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, diff --git a/tests/test_quick_run_config_generator.py b/tests/test_quick_run_config_generator.py index 7eef2514f..fae61e49f 100755 --- a/tests/test_quick_run_config_generator.py +++ b/tests/test_quick_run_config_generator.py @@ -186,7 +186,6 @@ def setUp(self): MagicMock(), self._mock_models, {}, - MagicMock(), ModelVariantNameManager(), ) @@ -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])) @@ -276,7 +274,6 @@ def test_get_next_run_config(self): MagicMock(), mock_models, {}, - MagicMock(), ModelVariantNameManager(), ) @@ -448,7 +445,6 @@ def test_get_next_run_config_multi_model(self): MagicMock(), mock_models, {}, - MagicMock(), ModelVariantNameManager(), ) @@ -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() @@ -599,7 +595,6 @@ def test_default_ensemble_config_generation(self): MagicMock(), models, ensemble_composing_models, - MagicMock(), ModelVariantNameManager(), ) @@ -681,7 +676,6 @@ def test_default_bls_config_generation(self): MagicMock(), models, bls_composing_models, - MagicMock(), ModelVariantNameManager(), ) @@ -759,7 +753,6 @@ def test_get_next_run_config_max_batch_size(self): MagicMock(), self._mock_models, {}, - MagicMock(), ModelVariantNameManager(), ) @@ -812,7 +805,6 @@ def test_get_next_run_config_max_instance_count(self): MagicMock(), self._mock_models, {}, - MagicMock(), ModelVariantNameManager(), ) @@ -865,7 +857,6 @@ def test_get_next_run_config_min_batch_size(self): MagicMock(), self._mock_models, {}, - MagicMock(), ModelVariantNameManager(), ) @@ -918,7 +909,6 @@ def test_get_next_run_config_min_instance_count(self): MagicMock(), self._mock_models, {}, - MagicMock(), ModelVariantNameManager(), ) @@ -1093,7 +1083,6 @@ def _get_next_run_config_ensemble(self, max_concurrency=0, min_concurrency=0): MagicMock(), models, ensemble_composing_models, - MagicMock(), ModelVariantNameManager(), ) @@ -1283,7 +1272,6 @@ def _get_next_run_config_bls(self, max_concurrency=0, min_concurrency=0): MagicMock(), models, bls_composing_models, - MagicMock(), ModelVariantNameManager(), )