diff --git a/python/sglang/bench_one_batch_server.py b/python/sglang/bench_one_batch_server.py index 8495c110e..0db18aa4a 100644 --- a/python/sglang/bench_one_batch_server.py +++ b/python/sglang/bench_one_batch_server.py @@ -377,6 +377,7 @@ def run_benchmark(server_args: ServerArgs, bench_args: BenchArgs): run_name=bench_args.run_name, result_filename=bench_args.result_filename, tokenizer=tokenizer, + dataset_path=bench_args.dataset_path, ) ) @@ -402,6 +403,7 @@ def run_benchmark(server_args: ServerArgs, bench_args: BenchArgs): profile=bench_args.profile, profile_steps=bench_args.profile_steps, profile_by_stage=bench_args.profile_by_stage, + dataset_path=bench_args.dataset_path, )[-1], ) ) diff --git a/python/sglang/profiler.py b/python/sglang/profiler.py index d872ca320..531c61fbd 100644 --- a/python/sglang/profiler.py +++ b/python/sglang/profiler.py @@ -15,7 +15,7 @@ from typing import List, Optional import requests -PARENT_FOLDER = "/tmp/sglang-profile" +PROFILER_DIR = os.getenv("SGLANG_TORCH_PROFILER_DIR", "/tmp") def _run_profile( @@ -27,7 +27,7 @@ def _run_profile( profile_by_stage: bool = False, ) -> str: if output_dir is None: - output_dir = PARENT_FOLDER + output_dir = PROFILER_DIR output_dir = os.path.normpath(output_dir) output_dir = os.path.abspath(output_dir)