Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
f04908ca
Unverified
Commit
f04908ca
authored
Sep 13, 2023
by
Zhuohan Li
Committed by
GitHub
Sep 13, 2023
Browse files
[FIX] Minor bug fixes (#1035)
* [FIX] Minor bug fixes * Address review comments
parent
ab019eea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
vllm/model_executor/layers/sampler.py
vllm/model_executor/layers/sampler.py
+3
-2
vllm/sequence.py
vllm/sequence.py
+1
-1
No files found.
vllm/model_executor/layers/sampler.py
View file @
f04908ca
...
...
@@ -82,8 +82,9 @@ class Sampler(nn.Module):
# We use float32 for probabilities and log probabilities.
# Compute the probabilities.
probs
=
torch
.
softmax
(
logits
,
dim
=-
1
,
dtype
=
torch
.
float
)
# Compute the log probabilities (before applying top-p and top-k).
logprobs
=
torch
.
log
(
probs
)
# Compute the log probabilities.
# Use log_softmax to ensure numerical stability.
logprobs
=
torch
.
log_softmax
(
logits
,
dim
=-
1
,
dtype
=
torch
.
float
)
# Sample the next tokens.
return
_sample
(
probs
,
logprobs
,
input_metadata
)
...
...
vllm/sequence.py
View file @
f04908ca
...
...
@@ -350,7 +350,7 @@ class SequenceOutputs:
def
__eq__
(
self
,
other
:
object
)
->
bool
:
if
not
isinstance
(
other
,
SequenceOutputs
):
r
eturn
NotImplementedError
()
r
aise
NotImplementedError
()
return
(
self
.
parent_seq_id
==
other
.
parent_seq_id
and
self
.
output_token
==
other
.
output_token
and
self
.
logprobs
==
other
.
logprobs
)
...
...
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