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
f50cc221
Unverified
Commit
f50cc221
authored
Oct 17, 2025
by
Wentao Ye
Committed by
GitHub
Oct 17, 2025
Browse files
[Test] Make `test_failure` more stable for batch invariance (#27054)
parent
acedc74b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
tests/v1/generation/test_batch_invariance.py
tests/v1/generation/test_batch_invariance.py
+20
-5
No files found.
tests/v1/generation/test_batch_invariance.py
View file @
f50cc221
...
...
@@ -59,12 +59,15 @@ def _random_prompt(min_words: int = 1024, max_words: int = 1024 * 2) -> str:
# Pick a random template
base_prompt
=
random
.
choice
(
prompt_templates
)
# Add some padding to vary the length if needed
if
min_words
>
50
:
if
max_words
<
min_words
:
max_words
=
min_words
target_words
=
random
.
randint
(
min_words
,
max_words
)
if
target_words
>
50
:
# For longer prompts, repeat context
padding_text
=
(
" This is an interesting topic that deserves more explanation. "
*
(
min
_words
//
50
)
*
(
target
_words
//
50
)
)
base_prompt
=
base_prompt
+
padding_text
...
...
@@ -516,8 +519,20 @@ def test_logprobs_WITHOUT_batch_invariance_should_FAIL(backend):
dtype
=
"bfloat16"
,
)
# Use more realistic prompts for better token generation
prompts
=
[
_random_prompt
(
10
,
50
)
for
i
in
range
(
32
)]
# build ragged prompts to change shapes significantly across BS=1 vs BS=N
long_min
=
int
(
os
.
getenv
(
"VLLM_MIN_PROMPT"
,
"768"
))
long_max
=
int
(
os
.
getenv
(
"VLLM_MAX_PROMPT"
,
"2048"
))
prompts
:
list
[
str
]
=
[]
options
=
[
(
max
(
long_min
,
1536
),
max
(
long_max
,
3072
)),
# very long
(
max
(
1024
,
long_min
),
max
(
2048
,
long_max
)),
# long
(
256
,
512
),
# mid
(
10
,
20
),
# short
]
for
_
in
range
(
32
):
lo
,
hi
=
random
.
choice
(
options
)
prompts
.
append
(
_random_prompt
(
lo
,
hi
))
sp
=
SamplingParams
(
temperature
=
0.6
,
...
...
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