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
10042057
Unverified
Commit
10042057
authored
Oct 31, 2025
by
Mengqing Cao
Committed by
GitHub
Oct 30, 2025
Browse files
[MTP] Refactor mtp predictor to avoid d2h operation (#27643)
Signed-off-by:
MengqingCao
<
cmq0113@163.com
>
parent
ba33e883
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
vllm/model_executor/models/deepseek_mtp.py
vllm/model_executor/models/deepseek_mtp.py
+1
-1
No files found.
vllm/model_executor/models/deepseek_mtp.py
View file @
10042057
...
@@ -97,7 +97,7 @@ class DeepSeekMultiTokenPredictorLayer(nn.Module):
...
@@ -97,7 +97,7 @@ class DeepSeekMultiTokenPredictorLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
assert
inputs_embeds
is
not
None
assert
inputs_embeds
is
not
None
# masking inputs at position 0, as not needed by MTP
# masking inputs at position 0, as not needed by MTP
inputs_embeds
[
positions
==
0
]
=
0
inputs_embeds
=
torch
.
where
(
positions
.
unsqueeze
(
-
1
)
==
0
,
0
,
inputs_embeds
)
inputs_embeds
=
self
.
enorm
(
inputs_embeds
)
inputs_embeds
=
self
.
enorm
(
inputs_embeds
)
previous_hidden_states
=
self
.
hnorm
(
previous_hidden_states
)
previous_hidden_states
=
self
.
hnorm
(
previous_hidden_states
)
...
...
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