Skip to content

Commit

Permalink
Fix codeQL, plus misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-braf committed Aug 9, 2023
1 parent 27e5b0b commit 6c02a1e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions model_analyzer/config/generate/base_model_config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ def make_model_config_variant(
model_name, model_config_dict, param_combo
)

model_config_dict["name"] = variant_name
logger.info("")
if variant_found:
logger.info(f"Found existing model config: {variant_name}")
else:
Expand All @@ -213,6 +211,7 @@ def make_model_config_variant(
logger.info(str)
logger.info("")

model_config_dict["name"] = variant_name
model_config = ModelConfig.create_from_dictionary(model_config_dict)
model_config.set_cpu_only(model.cpu_only())

Expand All @@ -226,7 +225,8 @@ def make_ensemble_model_config_variant(
param_combo: Dict = {},
) -> ModelConfigVariant:
"""
Loads the ensemble model spec from the model repository
Loads the ensemble model spec from the model repository, and then mutates
the names to match the ensemble composing models
Parameters
----------
Expand Down Expand Up @@ -258,15 +258,14 @@ def make_ensemble_model_config_variant(
model_name, ensemble_key
)

model_config_dict["name"] = variant_name
logger.info("")
if variant_found:
logger.info(f"Found existing ensemble model config: {variant_name}")
else:
logger.info(f"Creating ensemble model config: {variant_name}")
for str in logger_str:
logger.info(str)

model_config_dict["name"] = variant_name
model_config = ModelConfig.create_from_dictionary(model_config_dict)

return ModelConfigVariant(model_config, variant_name)
Expand Down
4 changes: 2 additions & 2 deletions model_analyzer/config/run/model_run_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def from_dict(cls, model_run_config_dict):
model_run_config_dict["_perf_config"]
)

# FIXME: This is for backward compatibility with older checkpoints used in unit tests
# TODO: TMA-1332: This is for backward compatibility with older checkpoints used in unit tests
if "_model_config" in model_run_config_dict:
model_config = ModelConfig.from_dict(model_run_config_dict["_model_config"])
model_run_config._model_config_variant = ModelConfigVariant(
Expand All @@ -311,7 +311,7 @@ def from_dict(cls, model_run_config_dict):
]
]

# FIXME: This is for backward compatibility with older checkpoints used in unit tests
# TODO: TMA-1332: This is for backward compatibility with older checkpoints used in unit tests
if "_composing_configs" in model_run_config_dict:
composing_configs = [
ModelConfig.from_dict(composing_config_dict)
Expand Down
2 changes: 1 addition & 1 deletion model_analyzer/record/metrics_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def _load_model_variants(self, run_config):
for composing_config_variant in mrc.composing_configs():
original_composing_config = (
BaseModelConfigGenerator.create_original_config_from_variant(
composing_config
composing_config_variant
)
)
if not self._load_model_variant(
Expand Down
1 change: 0 additions & 1 deletion model_analyzer/triton/model/model_config_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

from dataclasses import dataclass
from typing import List

from model_analyzer.triton.model.model_config import ModelConfig

Expand Down

0 comments on commit 6c02a1e

Please sign in to comment.