diff --git a/src/c++/perf_analyzer/genai-pa/genai_pa/parser.py b/src/c++/perf_analyzer/genai-pa/genai_pa/parser.py index 1037d5444..76cf3f459 100644 --- a/src/c++/perf_analyzer/genai-pa/genai_pa/parser.py +++ b/src/c++/perf_analyzer/genai-pa/genai_pa/parser.py @@ -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.", ) diff --git a/src/c++/perf_analyzer/genai-pa/genai_pa/utils.py b/src/c++/perf_analyzer/genai-pa/genai_pa/utils.py index 558f24da3..7f2fd8f82 100644 --- a/src/c++/perf_analyzer/genai-pa/genai_pa/utils.py +++ b/src/c++/perf_analyzer/genai-pa/genai_pa/utils.py @@ -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("_", "-") diff --git a/src/c++/perf_analyzer/genai-pa/genai_pa/wrapper.py b/src/c++/perf_analyzer/genai-pa/genai_pa/wrapper.py index 2dfdf49ad..49ca35aef 100644 --- a/src/c++/perf_analyzer/genai-pa/genai_pa/wrapper.py +++ b/src/c++/perf_analyzer/genai-pa/genai_pa/wrapper.py @@ -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)