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
c34fa0bf
Commit
c34fa0bf
authored
Aug 06, 2025
by
zhuwenwen
Browse files
Revert "[feat]优化mtp相关函数返回类型"
This reverts commit
edc45625
.
parent
edc45625
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
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
+1
-2
No files found.
vllm/v1/spec_decode/eagle.py
View file @
c34fa0bf
...
@@ -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
,
)
->
tuple
[
torch
.
Tensor
,
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
.
view
(
-
1
,
1
,
draft_prob
.
shape
[
-
1
])
return
draft_token_ids
.
view
(
-
1
,
1
),
draft_prob
s_list
# 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 @
c34fa0bf
...
@@ -1687,8 +1687,7 @@ class GPUModelRunner(LoRAModelRunnerMixin):
...
@@ -1687,8 +1687,7 @@ 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
,
)
->
tuple
[
list
[
list
[
int
]],
torch
.
Tensor
]:
)
->
list
[
list
[
int
]]:
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