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
d2c919dc
Unverified
Commit
d2c919dc
authored
Dec 13, 2025
by
realliujiaxu
Committed by
GitHub
Dec 12, 2025
Browse files
[bugfix] fix bug when top_logprobs=0 with spec decoding (#30059)
Signed-off-by:
realliujiaxu
<
realliujiaxu@163.com
>
parent
f3237f3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
tests/v1/sample/test_logprobs.py
tests/v1/sample/test_logprobs.py
+3
-1
tests/v1/sample/test_rejection_sampler.py
tests/v1/sample/test_rejection_sampler.py
+1
-1
vllm/v1/sample/rejection_sampler.py
vllm/v1/sample/rejection_sampler.py
+1
-1
No files found.
tests/v1/sample/test_logprobs.py
View file @
d2c919dc
...
@@ -528,9 +528,11 @@ def test_logprobs_mode(logprobs_mode: LogprobsMode):
...
@@ -528,9 +528,11 @@ def test_logprobs_mode(logprobs_mode: LogprobsMode):
),
),
],
],
)
)
@
pytest
.
mark
.
parametrize
(
"top_logprobs"
,
[
0
,
3
])
def
test_spec_decode_logprobs
(
def
test_spec_decode_logprobs
(
logprobs_mode
:
LogprobsMode
,
logprobs_mode
:
LogprobsMode
,
model_setup
:
tuple
[
str
,
str
,
str
],
model_setup
:
tuple
[
str
,
str
,
str
],
top_logprobs
:
int
,
):
):
"""Spec decode logprobs should match those of the base model.
"""Spec decode logprobs should match those of the base model.
...
@@ -543,7 +545,7 @@ def test_spec_decode_logprobs(
...
@@ -543,7 +545,7 @@ def test_spec_decode_logprobs(
prompt
=
"Hello world "
*
50
prompt
=
"Hello world "
*
50
sampling_params
=
SamplingParams
(
sampling_params
=
SamplingParams
(
temperature
=
0
,
logprobs
=
3
,
max_tokens
=
10
,
ignore_eos
=
False
temperature
=
0
,
logprobs
=
top_logprobs
,
max_tokens
=
10
,
ignore_eos
=
False
)
)
method
,
model_name
,
spec_model_name
=
model_setup
method
,
model_name
,
spec_model_name
=
model_setup
max_model_len
=
256
max_model_len
=
256
...
...
tests/v1/sample/test_rejection_sampler.py
View file @
d2c919dc
...
@@ -111,7 +111,7 @@ def create_sampling_metadata(
...
@@ -111,7 +111,7 @@ def create_sampling_metadata(
top_p
=
top_p
,
top_p
=
top_p
,
top_k
=
top_k
,
top_k
=
top_k
,
generators
=
generators
,
generators
=
generators
,
max_num_logprobs
=
0
,
max_num_logprobs
=
None
,
no_penalties
=
no_penalties
,
no_penalties
=
no_penalties
,
prompt_token_ids
=
prompt_token_ids
,
prompt_token_ids
=
prompt_token_ids
,
frequency_penalties
=
frequency_penalties
,
frequency_penalties
=
frequency_penalties
,
...
...
vllm/v1/sample/rejection_sampler.py
View file @
d2c919dc
...
@@ -145,7 +145,7 @@ class RejectionSampler(nn.Module):
...
@@ -145,7 +145,7 @@ class RejectionSampler(nn.Module):
)
)
logprobs_tensors
=
None
logprobs_tensors
=
None
if
sampling_metadata
.
max_num_logprobs
:
if
sampling_metadata
.
max_num_logprobs
is
not
None
:
logprobs_tensors
=
self
.
_get_logprobs_tensors
(
logprobs_tensors
=
self
.
_get_logprobs_tensors
(
sampling_metadata
.
max_num_logprobs
,
sampling_metadata
.
max_num_logprobs
,
metadata
,
metadata
,
...
...
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