diff --git a/python/sglang/test/test_utils.py b/python/sglang/test/test_utils.py index 6022f602c..6abe16079 100644 --- a/python/sglang/test/test_utils.py +++ b/python/sglang/test/test_utils.py @@ -1129,12 +1129,26 @@ def run_bench_serving( other_args=other_server_args, ) + # Resolve tokenizer to local snapshot path when available, so the benchmark + # client's AutoTokenizer.from_pretrained uses the local path directly instead + # of calling the HF Hub API (which can stall for minutes in CI). + bench_tokenizer = tokenizer + if bench_tokenizer is None: + try: + from sglang.srt.utils import find_local_repo_dir + + local_dir = find_local_repo_dir(model, revision=None) + if local_dir and os.path.isdir(local_dir): + bench_tokenizer = local_dir + except Exception: + pass + # Run benchmark args = get_benchmark_args( base_url=base_url, dataset_name=dataset_name, dataset_path=dataset_path, - tokenizer=tokenizer, + tokenizer=bench_tokenizer, num_prompts=num_prompts, random_input_len=random_input_len, random_output_len=random_output_len, diff --git a/test/registered/perf/test_bench_serving_1gpu_part1.py b/test/registered/perf/test_bench_serving_1gpu_part1.py index f97c6e706..a6ca1d336 100644 --- a/test/registered/perf/test_bench_serving_1gpu_part1.py +++ b/test/registered/perf/test_bench_serving_1gpu_part1.py @@ -141,7 +141,7 @@ class TestBenchServing1GPUPart1(CustomTestCase): self.assertLess(res["median_ttft_ms"], 86) self.assertLess(res["median_itl_ms"], 10) - def test_lora_online_latency(self): + def test_online_lora_latency(self): if is_in_amd_ci(): pass @@ -149,14 +149,14 @@ class TestBenchServing1GPUPart1(CustomTestCase): if is_in_ci(): write_github_step_summary( - f"### test_lora_online_latency\n" + f"### test_online_lora_latency\n" f"median_e2e_latency_ms: {res['median_e2e_latency_ms']:.2f} ms\n" f"median_ttft_ms: {res['median_ttft_ms']:.2f} ms\n" ) self.assertLess(res["median_e2e_latency_ms"], 2400) self.assertLess(res["median_ttft_ms"], 58) - def test_lora_online_latency_with_concurrent_adapter_updates(self): + def test_online_lora_latency_with_concurrent_adapter_updates(self): if is_in_amd_ci(): pass @@ -164,7 +164,7 @@ class TestBenchServing1GPUPart1(CustomTestCase): if is_in_ci(): write_github_step_summary( - f"### test_lora_online_latency\n" + f"### test_online_lora_latency_with_concurrent_adapter_updates\n" f"median_e2e_latency_ms: {res['median_e2e_latency_ms']:.2f} ms\n" f"median_ttft_ms: {res['median_ttft_ms']:.2f} ms\n" )