Skip to content
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

Connect up parameter description class #869

Merged
merged 9 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion model_analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
import logging
import sys
from copy import deepcopy
from typing import List, Optional, Union
from typing import Dict, List, Optional, Union

from model_analyzer.cli.cli import CLI
from model_analyzer.config.generate.base_model_config_generator import (
BaseModelConfigGenerator,
)
from model_analyzer.config.generate.search_parameters import SearchParameters
from model_analyzer.constants import LOGGER_NAME, PA_ERROR_LOG_FILENAME
from model_analyzer.state.analyzer_state_manager import AnalyzerStateManager
from model_analyzer.triton.server.server import TritonServer
Expand Down Expand Up @@ -82,6 +83,8 @@ def __init__(
constraint_manager=self._constraint_manager,
)

self._search_parameters: Dict[str, SearchParameters] = {}

def profile(
self, client: TritonClient, gpus: List[GPUDevice], mode: str, verbose: bool
) -> None:
Expand Down Expand Up @@ -115,6 +118,7 @@ def profile(

self._create_metrics_manager(client, gpus)
self._create_model_manager(client, gpus)
self._populate_search_parameters()

if self._config.triton_launch_mode == "remote":
self._warn_if_other_models_loaded_on_remote_server(client)
Expand Down Expand Up @@ -414,3 +418,9 @@ def _warn_if_other_models_loaded_on_remote_server(self, client):
f"A model not being profiled ({model_name}) is loaded on the remote Tritonserver. "
"This could impact the profile results."
)

def _populate_search_parameters(self):
for model in self._config.profile_models:
self._search_parameters[model.model_name()] = SearchParameters(
self._config, model.parameters(), model.model_config_parameters()
)
100 changes: 0 additions & 100 deletions model_analyzer/config/generate/config_parameters.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from typing import Any, List, Optional


class ParameterType(Enum):
class ParameterUsage(Enum):
MODEL = auto()
RUNTIME = auto()
BUILD = auto()
Expand All @@ -32,17 +32,17 @@ class ParameterCategory(Enum):


@dataclass
class ConfigParameter:
class SearchParameter:
"""
A dataclass that holds information about a configuration parameter
A dataclass that holds information about a configuration's search parameter
"""

ptype: ParameterType
usage: ParameterUsage
category: ParameterCategory

# This is only applicable to LIST category
enumerated_list: Optional[List[Any]] = None

# These are only applicable to INTEGER and EXPONENTIAL categories
min_range: Optional[int] = None
max_range: Optional[int] = None

# This is only applicable to LIST category
enumerated_list: List[Any] = []
Loading
Loading