Skip to content

Commit

Permalink
Add input-data and endpoint options
Browse files Browse the repository at this point in the history
  • Loading branch information
debermudez committed Mar 7, 2024
1 parent 22b4b71 commit 97d43ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
21 changes: 20 additions & 1 deletion src/c++/perf_analyzer/genai-pa/genai_pa/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
from pathlib import Path

import genai_pa.utils as utils
from genai_pa.constants import CNN_DAILY_MAIL, DEFAULT_HTTP_URL, LOGGER_NAME, OPEN_ORCA
from genai_pa.constants import (
CNN_DAILY_MAIL,
DEFAULT_HTTP_URL,
DEFAULT_INPUT_DATA_JSON,
LOGGER_NAME,
OPEN_ORCA,
)
from genai_pa.llm_inputs.llm_inputs import InputType, OutputFormat

logger = logging.getLogger(LOGGER_NAME)
Expand Down Expand Up @@ -124,6 +130,15 @@ def _add_profile_args(parser):
required=False,
help="Sets the concurrency value to benchmark.",
)

profile_group.add_argument(
"--input-data",
type=Path,
default=DEFAULT_INPUT_DATA_JSON,
required=False,
help="Path to the input data json file that contains the list of requests.",
)

profile_group.add_argument(
"--max-threads",
type=int,
Expand Down Expand Up @@ -175,6 +190,10 @@ def _add_profile_args(parser):
def _add_endpoint_args(parser):
endpoint_group = parser.add_argument_group("Endpoint")

endpoint_group.add_argument(
"--endpoint", type=str, required=False, help="Specify an endpoint."
)

endpoint_group.add_argument(
"-i",
type=str.lower,
Expand Down
5 changes: 1 addition & 4 deletions src/c++/perf_analyzer/genai-pa/genai_pa/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ def build_cmd(model, args, extra_args):
if extra_args is not None:
for arg in extra_args:
cmd += f"{arg} "
# TODO: Once the OpenAI endpoint support is in place in PA core,
# update the input-data option arg
# cmd += f"--input-data {DEFAULT_INPUT_DATA_JSON} -p 10000 -s 99"
cmd += f"--input-data ./llm_inputs.json -p 10000 -s 999"
cmd += f" -p 10000 -s 999"
return cmd

@staticmethod
Expand Down

0 comments on commit 97d43ef

Please sign in to comment.