Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
23583ee2
Unverified
Commit
23583ee2
authored
Oct 16, 2025
by
Wentao Ye
Committed by
GitHub
Oct 16, 2025
Browse files
[Bug] Add Assertion for `random-input-len` / `random-output-len` (#26834)
Signed-off-by:
yewentao256
<
zhyanwentao@126.com
>
parent
01c977e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
vllm/benchmarks/datasets.py
vllm/benchmarks/datasets.py
+16
-0
No files found.
vllm/benchmarks/datasets.py
View file @
23583ee2
...
...
@@ -478,6 +478,22 @@ class RandomDataset(BenchmarkDataset):
batchsize
:
int
=
1
,
**
kwargs
,
)
->
list
[
SampleRequest
]:
# validate total input tokens (prefix + sampled) is at least 1.
num_special
=
int
(
tokenizer
.
num_special_tokens_to_add
())
real_input_len
=
max
(
0
,
int
(
input_len
)
-
num_special
)
min_sampled_input
=
math
.
floor
(
real_input_len
*
(
1.0
-
float
(
range_ratio
)))
min_total_input
=
int
(
prefix_len
)
+
min_sampled_input
if
min_total_input
<
1
:
raise
ValueError
(
"--random-input-len is too small: with tokenizer special "
f
"tokens
{
num_special
}
and --random-range-ratio
{
range_ratio
}
, "
"the minimum possible total input tokens (prefix + sampled) is "
f
"
{
min_total_input
}
. Increase --random-input-len and/or "
"--random-prefix-len, or decrease --random-range-ratio so that "
"prefix_len + floor(max(0, random_input_len - num_special)) "
"* (1 - range_ratio) >= 1."
)
input_lens
,
output_lens
,
offsets
=
self
.
get_sampling_params
(
num_requests
,
range_ratio
,
input_len
,
output_len
,
tokenizer
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment