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
6806998b
Unverified
Commit
6806998b
authored
Jun 26, 2024
by
Woosuk Kwon
Committed by
GitHub
Jun 26, 2024
Browse files
[Bugfix] Fix embedding to support 2D inputs (#5829)
parent
515080ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
vllm/model_executor/layers/vocab_parallel_embedding.py
vllm/model_executor/layers/vocab_parallel_embedding.py
+2
-2
No files found.
vllm/model_executor/layers/vocab_parallel_embedding.py
View file @
6806998b
...
...
@@ -306,11 +306,11 @@ class VocabParallelEmbedding(torch.nn.Module):
self
.
shard_indices
.
added_vocab_end_index
)
else
:
masked_input
=
input_
# Get the embeddings.
# Get the embeddings.
output_parallel
=
F
.
embedding
(
masked_input
.
long
(),
self
.
weight
)
# Mask the output embedding.
if
self
.
tp_size
>
1
:
output_parallel
.
masked_fill_
(
input_mask
.
unsqueeze
(
1
),
0
)
output_parallel
.
masked_fill_
(
input_mask
.
unsqueeze
(
-
1
),
0
)
# Reduce across all the model parallel GPUs.
output
=
tensor_model_parallel_all_reduce
(
output_parallel
)
return
output
...
...
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