Skip to content

Commit 6c5a319

Browse files
aarnphmrussellb
andauthored
[Misc][Benchmark] Add support for different tokenizer_mode (#15040)
Signed-off-by: Aaron Pham <[email protected]> Signed-off-by: Russell Bryant <[email protected]> Co-authored-by: Russell Bryant <[email protected]>
1 parent 073d1ed commit 6c5a319

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

benchmarks/benchmark_serving_structured_output.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,11 @@ def main(args: argparse.Namespace):
732732
api_url = f"http://{args.host}:{args.port}{args.endpoint}"
733733
base_url = f"http://{args.host}:{args.port}"
734734

735-
tokenizer = get_tokenizer(tokenizer_id,
736-
trust_remote_code=args.trust_remote_code)
735+
tokenizer = get_tokenizer(
736+
tokenizer_id,
737+
trust_remote_code=args.trust_remote_code,
738+
tokenizer_mode=args.tokenizer_mode,
739+
)
737740

738741
if args.dataset == 'grammar':
739742
args.structure_type = 'guided_grammar'
@@ -876,6 +879,13 @@ def main(args: argparse.Namespace):
876879
help=
877880
"Name or path of the tokenizer, if not using the default tokenizer.", # noqa: E501
878881
)
882+
parser.add_argument(
883+
"--tokenizer-mode",
884+
type=str,
885+
default="auto",
886+
help=
887+
"Name or path of the tokenizer, if not using the default tokenizer.", # noqa: E501
888+
)
879889
parser.add_argument(
880890
"--num-prompts",
881891
type=int,

benchmarks/run_structured_output_benchmark.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ for qps in "${QPS_VALUES[@]}"; do
5454
python "$SCRIPT_DIR/benchmark_serving_structured_output.py" $COMMON_PARAMS \
5555
--request-rate $qps \
5656
--result-filename "$FILENAME" \
57+
--tokenizer-mode ${TOKENIZER_MODE:-"auto"} \
5758
--port ${PORT:-8000}
5859

5960
echo "Completed benchmark with QPS: $qps"

0 commit comments

Comments
 (0)