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
1fa020c5
Unverified
Commit
1fa020c5
authored
Nov 07, 2024
by
Nick Hill
Committed by
GitHub
Nov 07, 2024
Browse files
[V1][BugFix] Fix Generator construction in greedy + seed case (#10097)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
e7b84c39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
vllm/v1/worker/gpu_model_runner.py
vllm/v1/worker/gpu_model_runner.py
+3
-2
No files found.
vllm/v1/worker/gpu_model_runner.py
View file @
1fa020c5
...
@@ -146,7 +146,7 @@ class GPUModelRunner:
...
@@ -146,7 +146,7 @@ class GPUModelRunner:
for
req_data
in
scheduler_output
.
scheduled_new_reqs
:
for
req_data
in
scheduler_output
.
scheduled_new_reqs
:
req_id
=
req_data
.
req_id
req_id
=
req_data
.
req_id
sampling_params
=
req_data
.
sampling_params
sampling_params
=
req_data
.
sampling_params
if
sampling_params
.
s
eed
is
not
None
:
if
sampling_params
.
s
ampling_type
==
SamplingType
.
RANDOM_SEED
:
generator
=
torch
.
Generator
(
device
=
self
.
device
)
generator
=
torch
.
Generator
(
device
=
self
.
device
)
generator
.
manual_seed
(
sampling_params
.
seed
)
generator
.
manual_seed
(
sampling_params
.
seed
)
else
:
else
:
...
@@ -382,7 +382,8 @@ class GPUModelRunner:
...
@@ -382,7 +382,8 @@ class GPUModelRunner:
# Rewind the generator state as if the token was not sampled.
# Rewind the generator state as if the token was not sampled.
generator
=
self
.
input_batch
.
generators
.
get
(
i
)
generator
=
self
.
input_batch
.
generators
.
get
(
i
)
if
generator
is
not
None
:
if
generator
is
not
None
:
generator
.
set_offset
(
generator
.
get_offset
()
-
1
)
# This relies on cuda-specific torch-internal impl details
generator
.
set_offset
(
generator
.
get_offset
()
-
4
)
if
sampler_output
.
logprob_token_ids
is
None
:
if
sampler_output
.
logprob_token_ids
is
None
:
logprob_token_ids
=
None
logprob_token_ids
=
None
...
...
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