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
3f1fc742
Unverified
Commit
3f1fc742
authored
Jan 27, 2025
by
Woosuk Kwon
Committed by
GitHub
Jan 27, 2025
Browse files
[V1][CI/Test] Do basic test for top-p & top-k sampling (#12469)
Signed-off-by:
Woosuk Kwon
<
woosuk.kwon@berkeley.edu
>
parent
01ba9270
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
tests/v1/engine/test_engine_core.py
tests/v1/engine/test_engine_core.py
+20
-8
No files found.
tests/v1/engine/test_engine_core.py
View file @
3f1fc742
...
...
@@ -144,7 +144,7 @@ def test_engine_core(monkeypatch):
def
test_engine_core_advanced_sampling
(
monkeypatch
):
"""
A basic end-to-end test to verify that the engine functions correctly
when additional sampling parameters, such as min_tokens and
when additional sampling parameters, such as
top_p,
min_tokens
,
and
presence_penalty, are set.
"""
with
monkeypatch
.
context
()
as
m
:
...
...
@@ -167,11 +167,23 @@ def test_engine_core_advanced_sampling(monkeypatch):
stop_token_ids
=
[
1001
,
1002
],
)
engine_core
.
add_request
(
request
)
def
_check_engine_state
():
assert
len
(
engine_core
.
scheduler
.
waiting
)
==
1
assert
len
(
engine_core
.
scheduler
.
running
)
==
0
# Loop through until they are all done.
while
len
(
engine_core
.
step
().
outputs
)
>
0
:
pass
assert
len
(
engine_core
.
scheduler
.
waiting
)
==
0
assert
len
(
engine_core
.
scheduler
.
running
)
==
0
_check_engine_state
()
# Second request.
request2
=
make_request
()
request2
.
sampling_params
=
SamplingParams
(
top_p
=
0.99
,
top_k
=
50
,
)
engine_core
.
add_request
(
request2
)
_check_engine_state
()
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