Skip to content

Commit

Permalink
Merge branch 'dbermudez-cli-parser' into dyas-pa-llm-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dyastremsky authored Feb 28, 2024
2 parents b4ccd5e + 0ef76e9 commit d12ddbf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/c++/perf_analyzer/genai-pa/genai_pa/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def add_endpoint_args(parser):
type=str,
default="localhost:8001",
required=False,
dest="u",
metavar="URL",
help="URL of the endpoint to target for benchmarking.",
)

Expand Down
4 changes: 4 additions & 0 deletions src/c++/perf_analyzer/genai-pa/genai_pa/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
def remove_file(file: Path):
if file.is_file():
file.unlink()


def convert_option_name(name: str) -> str:
return name.replace("_", "-")
11 changes: 6 additions & 5 deletions src/c++/perf_analyzer/genai-pa/genai_pa/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ def run(model, args=None):
pass
elif value is True:
cmd += f"--{arg} "
elif arg == "url":
cmd += f"-u {value} "
elif arg == "batch-size":
elif arg == "batch_size":
cmd += f"-b {value} "
else:
cmd += f"--{arg} {value} "
cmd += f"\n"
if len(arg) == 1:
cmd += f"-{arg} {value}"
else:
arg = utils.convert_option_name(arg)
cmd += f"--{arg} {value} "
logger.info(f"Running Perf Analyzer : '{cmd}'")
subprocess.run(cmd, shell=True)

0 comments on commit d12ddbf

Please sign in to comment.