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
6faec545
Unverified
Commit
6faec545
authored
Dec 09, 2024
by
Woosuk Kwon
Committed by
GitHub
Dec 09, 2024
Browse files
[V1] Do not store `None` in self.generators (#11038)
Signed-off-by:
Woosuk Kwon
<
woosuk.kwon@berkeley.edu
>
parent
5ed5d5f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
vllm/v1/worker/gpu_input_batch.py
vllm/v1/worker/gpu_input_batch.py
+6
-1
No files found.
vllm/v1/worker/gpu_input_batch.py
View file @
6faec545
...
@@ -102,6 +102,8 @@ class InputBatch:
...
@@ -102,6 +102,8 @@ class InputBatch:
self
.
top_k_reqs
:
Set
[
str
]
=
set
()
self
.
top_k_reqs
:
Set
[
str
]
=
set
()
# req_index -> generator
# req_index -> generator
# NOTE(woosuk): The indices of the requests that do not have their own
# generator should not be included in the dictionary.
self
.
generators
:
Dict
[
int
,
torch
.
Generator
]
=
{}
self
.
generators
:
Dict
[
int
,
torch
.
Generator
]
=
{}
self
.
num_logprobs
:
Dict
[
str
,
int
]
=
{}
self
.
num_logprobs
:
Dict
[
str
,
int
]
=
{}
...
@@ -147,7 +149,10 @@ class InputBatch:
...
@@ -147,7 +149,10 @@ class InputBatch:
if
sampling_params
.
top_k
>
0
:
if
sampling_params
.
top_k
>
0
:
self
.
top_k_reqs
.
add
(
req_id
)
self
.
top_k_reqs
.
add
(
req_id
)
self
.
generators
[
req_index
]
=
request
.
generator
# NOTE(woosuk): self.generators should not include the requests that
# do not have their own generator.
if
request
.
generator
is
not
None
:
self
.
generators
[
req_index
]
=
request
.
generator
num_logprobs
=
sampling_params
.
logprobs
num_logprobs
=
sampling_params
.
logprobs
if
num_logprobs
is
not
None
and
num_logprobs
>
0
:
if
num_logprobs
is
not
None
and
num_logprobs
>
0
:
...
...
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