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
c17574bd
Commit
c17574bd
authored
Aug 06, 2025
by
zhuwenwen
Browse files
Revert "Revert "[feat]优化mtp相关函数返回类型""
This reverts commit
c34fa0bf
.
parent
467490e6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
vllm/v1/spec_decode/eagle.py
vllm/v1/spec_decode/eagle.py
+2
-2
vllm/v1/worker/gpu_model_runner.py
vllm/v1/worker/gpu_model_runner.py
+2
-1
No files found.
vllm/v1/spec_decode/eagle.py
View file @
c17574bd
...
@@ -98,7 +98,7 @@ class EagleProposer:
...
@@ -98,7 +98,7 @@ class EagleProposer:
next_token_ids
:
torch
.
Tensor
,
next_token_ids
:
torch
.
Tensor
,
common_attn_metadata
:
CommonAttentionMetadata
,
common_attn_metadata
:
CommonAttentionMetadata
,
sampling_metadata
:
SamplingMetadata
,
sampling_metadata
:
SamplingMetadata
,
)
->
torch
.
Tensor
:
)
->
tuple
[
torch
.
Tensor
,
torch
.
Tensor
]
:
num_tokens
=
target_token_ids
.
shape
[
0
]
num_tokens
=
target_token_ids
.
shape
[
0
]
batch_size
=
next_token_ids
.
shape
[
0
]
batch_size
=
next_token_ids
.
shape
[
0
]
last_token_indices
=
common_attn_metadata
.
query_start_loc
[
1
:]
-
1
last_token_indices
=
common_attn_metadata
.
query_start_loc
[
1
:]
-
1
...
@@ -194,7 +194,7 @@ class EagleProposer:
...
@@ -194,7 +194,7 @@ class EagleProposer:
# Early exit if there is only one draft token to be generated.
# Early exit if there is only one draft token to be generated.
if
self
.
num_speculative_tokens
==
1
:
if
self
.
num_speculative_tokens
==
1
:
# [batch_size, 1]
# [batch_size, 1]
return
draft_token_ids
.
view
(
-
1
,
1
),
draft_prob
s_list
return
draft_token_ids
.
view
(
-
1
,
1
),
draft_prob
.
view
(
-
1
,
1
,
draft_prob
.
shape
[
-
1
])
# TODO: Currently, MTP module released by deepseek only has
# TODO: Currently, MTP module released by deepseek only has
# one layer. Adapt this code to support multiple layers once
# one layer. Adapt this code to support multiple layers once
...
...
vllm/v1/worker/gpu_model_runner.py
View file @
c17574bd
...
@@ -1687,7 +1687,8 @@ class GPUModelRunner(LoRAModelRunnerMixin):
...
@@ -1687,7 +1687,8 @@ class GPUModelRunner(LoRAModelRunnerMixin):
aux_hidden_states
:
Optional
[
torch
.
Tensor
],
aux_hidden_states
:
Optional
[
torch
.
Tensor
],
spec_decode_metadata
:
Optional
[
SpecDecodeMetadata
],
spec_decode_metadata
:
Optional
[
SpecDecodeMetadata
],
common_attn_metadata
:
CommonAttentionMetadata
,
common_attn_metadata
:
CommonAttentionMetadata
,
)
->
list
[
list
[
int
]]:
)
->
tuple
[
list
[
list
[
int
]],
torch
.
Tensor
]:
draft_probs
=
None
num_scheduled_tokens
=
scheduler_output
.
total_num_scheduled_tokens
num_scheduled_tokens
=
scheduler_output
.
total_num_scheduled_tokens
if
self
.
speculative_config
.
method
==
"ngram"
:
if
self
.
speculative_config
.
method
==
"ngram"
:
assert
isinstance
(
self
.
drafter
,
NgramProposer
)
assert
isinstance
(
self
.
drafter
,
NgramProposer
)
...
...
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