Skip to content

Commit 583a977

Browse files
authored
[Benchmark] Do not save detailed info to json by default (#14879)
Signed-off-by: simon-mo <[email protected]>
1 parent a73e183 commit 583a977

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

benchmarks/backend_request_func.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
from transformers import (AutoTokenizer, PreTrainedTokenizer,
1515
PreTrainedTokenizerFast)
1616

17-
from vllm.model_executor.model_loader.weight_utils import get_lock
17+
# NOTE(simon): do not import vLLM here so the benchmark script
18+
# can run without vLLM installed.
1819

1920
AIOHTTP_TIMEOUT = aiohttp.ClientTimeout(total=6 * 60 * 60)
2021

@@ -427,6 +428,8 @@ def get_model(pretrained_model_name_or_path: str) -> str:
427428
if os.getenv('VLLM_USE_MODELSCOPE', 'False').lower() == 'true':
428429
from modelscope import snapshot_download
429430

431+
from vllm.model_executor.model_loader.weight_utils import get_lock
432+
430433
# Use file lock to prevent multiple processes from
431434
# downloading the same model weights at the same time.
432435
with get_lock(pretrained_model_name_or_path):

benchmarks/benchmark_serving.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,15 @@ def main(args: argparse.Namespace):
684684
"Invalid metadata format. Please use KEY=VALUE format."
685685
)
686686

687+
if not args.save_detailed:
688+
# Remove fields with too many data points
689+
for field in [
690+
"input_lens", "output_lens", "ttfts", "itls",
691+
"generated_texts", "errors"
692+
]:
693+
if field in result_json:
694+
del result_json[field]
695+
687696
# Traffic
688697
result_json["request_rate"] = (args.request_rate if args.request_rate
689698
< float("inf") else "inf")
@@ -828,6 +837,12 @@ def main(args: argparse.Namespace):
828837
action="store_true",
829838
help="Specify to save benchmark results to a json file",
830839
)
840+
parser.add_argument(
841+
"--save-detailed",
842+
action="store_true",
843+
help="When saving the results, whether to include per request "
844+
"information such as response, error, ttfs, tpots, etc.",
845+
)
831846
parser.add_argument(
832847
"--metadata",
833848
metavar="KEY=VALUE",

0 commit comments

Comments
 (0)