Skip to content

[feat]: Allow for a settable end-of-sequence/padding token in max throughput benchmark. #3776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 1, 2025
41 changes: 27 additions & 14 deletions tensorrt_llm/bench/benchmark/throughput.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@
required=False,
help="Pass in a dataset file for parsing instead of stdin.",
)
@optgroup.option(
"--eos_id",
type=int,
default=-1,
required=False,
help=
"Set the end-of-sequence token for the benchmark. Set to -1 to disable EOS.",
)
@optgroup.option(
"--modality",
type=click.Choice(["image", "video"]),
Expand Down Expand Up @@ -122,6 +130,22 @@
default=2,
help="Number of requests warm up benchmark.",
)
@optgroup.option(
"--target_input_len",
default=None,
type=click.IntRange(min=1),
help="Target (average) input length for tuning heuristics.",
)
@optgroup.option(
"--target_output_len",
default=None,
type=click.IntRange(min=1),
help="Target (average) sequence length for tuning heuristics.",
)
@optgroup.group(
"World Configuration",
help="Options for configuring the backend multi-GPU world.",
)
@optgroup.option(
"--tp",
type=int,
Expand All @@ -146,18 +170,6 @@
default=None,
help="expert cluster parallelism size",
)
@optgroup.option(
"--target_input_len",
default=None,
type=click.IntRange(min=1),
help="Target (average) input length for tuning heuristics.",
)
@optgroup.option(
"--target_output_len",
default=None,
type=click.IntRange(min=1),
help="Target (average) sequence length for tuning heuristics.",
)
@optgroup.group("Request Load Control Options",
cls=MutuallyExclusiveOptionGroup,
help="Limits how requests are loaded.")
Expand Down Expand Up @@ -218,6 +230,7 @@ def throughput_command(
# Parameters from CLI
# Model, experiment, and engine params
dataset_path: Path = params.pop("dataset")
eos_id: int = params.pop("eos_id")
warmup: int = params.get("warmup")
num_requests: int = params.pop("num_requests")
max_seq_len: int = params.pop("max_seq_len")
Expand Down Expand Up @@ -329,8 +342,8 @@ def throughput_command(
else:
llm = LLM(**kwargs)

sampling_params = SamplingParams(end_id=-1,
pad_id=-1,
sampling_params = SamplingParams(end_id=eos_id,
pad_id=eos_id,
beam_width=beam_width)

# Perform warmup if requested.
Expand Down