Skip to content
Closed
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
1 change: 0 additions & 1 deletion genai-perf/genai_perf/config/generate/genai_perf_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from argparse import Namespace
from copy import deepcopy
from dataclasses import dataclass

Expand Down
20 changes: 10 additions & 10 deletions genai-perf/genai_perf/config/generate/perf_analyzer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from dataclasses import dataclass
from enum import Enum, auto
from pathlib import Path
from typing import Any, List, Optional
from typing import List, Optional

from genai_perf.config.generate.search_parameter import SearchUsage
from genai_perf.config.input.config_command import ConfigCommand
Expand Down Expand Up @@ -137,9 +137,9 @@ def _set_profile_export_file(
###########################################################################
def _get_artifact_paths(self) -> List[str]:
artifact_paths = [
f"--input-data",
"--input-data",
f"{self._artifact_directory / DEFAULT_INPUT_DATA_JSON}",
f"--profile-export-file",
"--profile-export-file",
f"{self._profile_export_file}",
]

Expand Down Expand Up @@ -195,7 +195,7 @@ def _get_artifact_stimulus_based_on_config(
) -> Optional[List[str]]:
if (
config.input.prompt_source == PromptSource.PAYLOAD
and not "session_concurrency" in config.perf_analyzer.stimulus
and "session_concurrency" not in config.perf_analyzer.stimulus
):
stimulus = None
elif "concurrency" in config.perf_analyzer.stimulus:
Expand All @@ -208,7 +208,7 @@ def _get_artifact_stimulus_based_on_config(
session_concurrency = config.perf_analyzer.stimulus["session_concurrency"]
stimulus = [f"session_concurrency{session_concurrency}"]
else:
raise GenAIPerfException(f"Stimulus type not found in config")
raise GenAIPerfException("Stimulus type not found in config")

return stimulus

Expand Down Expand Up @@ -239,7 +239,7 @@ def _add_required_args(self, config: ConfigCommand) -> List[str]:
required_args = [f"{config.perf_analyzer.path}"]

if config.endpoint.service_kind != "dynamic_grpc":
required_args += [f"-m", f"{config.model_names[0]}", f"--async"]
required_args += ["-m", f"{config.model_names[0]}", "--async"]

return required_args

Expand All @@ -248,9 +248,9 @@ def _add_perf_analyzer_args(self, config: ConfigCommand) -> List[str]:

if config.input.prompt_source != PromptSource.PAYLOAD:
perf_analyzer_args += [
f"--stability-percentage",
"--stability-percentage",
f"{config.perf_analyzer.stability_percentage}",
f"--warmup-request-count",
"--warmup-request-count",
f"{config.perf_analyzer.warmup_request_count}",
]

Expand All @@ -262,7 +262,7 @@ def _add_perf_analyzer_args(self, config: ConfigCommand) -> List[str]:
]
elif mode == PerfAnalyzerMeasurementMode.INTERVAL:
perf_analyzer_args += [
f"--measurement-interval",
"--measurement-interval",
f"{config.perf_analyzer.measurement.num}",
]

Expand Down Expand Up @@ -338,7 +338,7 @@ def _add_prompt_source_args(self, config: ConfigCommand) -> List[str]:
prompt_source_args = []
if (
config.input.prompt_source == PromptSource.PAYLOAD
and not "session_concurrency" in config.perf_analyzer.stimulus
and "session_concurrency" not in config.perf_analyzer.stimulus
):
prompt_source_args += ["--fixed-schedule"]

Expand Down
10 changes: 5 additions & 5 deletions genai-perf/genai_perf/config/generate/search_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,13 @@ def _check_for_illegal_input(
else:
if min_range is None or max_range is None:
raise GenAIPerfException(
f"Both min_range and max_range must be specified"
"Both min_range and max_range must be specified"
)

if min_range and max_range:
if min_range > max_range:
raise GenAIPerfException(
f"min_range cannot be larger than max_range"
"min_range cannot be larger than max_range"
)

def _check_for_illegal_list_input(
Expand All @@ -281,13 +281,13 @@ def _check_for_illegal_list_input(
) -> None:
if not enumerated_list:
raise GenAIPerfException(
f"enumerated_list must be specified for a SearchCategory.LIST"
"enumerated_list must be specified for a SearchCategory.LIST"
)
elif min_range is not None:
raise GenAIPerfException(
f"min_range cannot be specified for a SearchCategory.LIST"
"min_range cannot be specified for a SearchCategory.LIST"
)
elif max_range is not None:
raise GenAIPerfException(
f"max_range cannot be specified for a SearchCategory.LIST"
"max_range cannot be specified for a SearchCategory.LIST"
)
2 changes: 1 addition & 1 deletion genai-perf/genai_perf/config/input/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __getattr__(self, name):
elif name in self._children:
return self._children[name]
else:
if not name in self._fields:
if name not in self._fields:
raise AttributeError(f"{name} not found in ConfigFields")

if self._fields[name].is_set_by_user:
Expand Down
5 changes: 2 additions & 3 deletions genai-perf/genai_perf/config/input/config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, Optional

Expand Down Expand Up @@ -209,15 +208,15 @@ def _check_payload_input(self) -> None:

if self.perf_analyzer.get_field("warmup_request_count").is_set_by_user:
raise ValueError(
f"User Config: perf_analyzer.warmup_request_count is not supported with the payload input source."
"User Config: perf_analyzer.warmup_request_count is not supported with the payload input source."
)
if (
self.perf_analyzer.measurement.get_field("mode").is_set_by_user
and self.perf_analyzer.measurement.mode
== PerfAnalyzerMeasurementMode.REQUEST_COUNT
):
raise ValueError(
f"User Config: perf_analyzer.measurement.mode of request_count is not supported with the payload input source."
"User Config: perf_analyzer.measurement.mode of request_count is not supported with the payload input source."
)

###########################################################################
Expand Down
2 changes: 1 addition & 1 deletion genai-perf/genai_perf/config/input/config_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,5 @@ def _check_inferred_backend(self) -> None:
return
else:
raise ValueError(
f"The backend should only be used with the following combination: 'service_kind: triton' & 'type: kserve'"
"The backend should only be used with the following combination: 'service_kind: triton' & 'type: kserve'"
)
2 changes: 0 additions & 2 deletions genai-perf/genai_perf/export_data/exporter_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


import argparse as args
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Dict

from genai_perf.config.generate.perf_analyzer_config import PerfAnalyzerConfig
Expand Down
1 change: 0 additions & 1 deletion genai-perf/genai_perf/export_data/json_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import json
import os
from enum import Enum
from typing import Dict, Union

import genai_perf.logging as logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from typing import Dict, List, Optional, Union
from typing import Dict, List, Optional

import genai_perf.logging as logging
from genai_perf.goodput_calculator.goodput_calculator import GoodputCalculator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def check_config(self) -> None:
)
if self.config.input.file == "":
raise GenAIPerfException(
f"The dynamic GRPC converter only supports the input file path."
"The dynamic GRPC converter only supports the input file path."
)

def convert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def _encode_with_chat_template(self, prompt: str) -> List[int]:
"""
Apply the default TRT-LLM engine chat template to the prompt
"""
import jinja2

default_template = self._construct_default_template(prompt)
return self.tokenizer.encode(
Expand Down
2 changes: 1 addition & 1 deletion genai-perf/genai_perf/inputs/input_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from enum import Enum, auto
from enum import Enum


class Subcommand(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

import base64
import io
from enum import Enum, auto
from typing import List

import numpy as np
import soundfile as sf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import glob
import random
from enum import Enum, auto
from pathlib import Path
from typing import Optional

Expand Down
Loading