Skip to content

Commit 910e6b9

Browse files
authored
[None][fix] fixed cached model path in test (#8549)
Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
1 parent 40a9c61 commit 910e6b9

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,31 @@
1111
from tensorrt_llm.commands.bench import main
1212

1313

14-
def run_benchmark(model_name: str, dataset_path: str, extra_llm_api_options_path: str):
14+
def run_benchmark(
15+
model_name: str, model_path: str, dataset_path: str, extra_llm_api_options_path: str
16+
):
1517
runner = CliRunner()
1618

1719
args = [
1820
"--model",
1921
model_name,
20-
"throughput",
21-
"--backend",
22-
"_autodeploy",
23-
"--dataset",
24-
dataset_path,
25-
"--extra_llm_api_options",
26-
f"{extra_llm_api_options_path}",
2722
]
23+
24+
# Only pass --model_path if it's a local filesystem path
25+
if model_path.startswith("/"):
26+
args.extend(["--model_path", model_path])
27+
28+
args.extend(
29+
[
30+
"throughput",
31+
"--backend",
32+
"_autodeploy",
33+
"--dataset",
34+
dataset_path,
35+
"--extra_llm_api_options",
36+
f"{extra_llm_api_options_path}",
37+
]
38+
)
2839
result = runner.invoke(main, args, catch_exceptions=False)
2940
assert result.exit_code == 0
3041

@@ -88,4 +99,6 @@ def test_trtllm_bench(llm_root, compile_backend, model_name): # noqa: F811
8899
)
89100

90101
dataset_path = prepare_dataset(llm_root, temp_dir, config["args"]["model"])
91-
run_benchmark(model_name, dataset_path, extra_llm_api_options_path)
102+
run_benchmark(
103+
model_name, str(config["args"]["model"]), dataset_path, extra_llm_api_options_path
104+
)

0 commit comments

Comments
 (0)