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
1cf0719e
Unverified
Commit
1cf0719e
authored
Apr 25, 2025
by
Woosuk Kwon
Committed by
GitHub
Apr 25, 2025
Browse files
[Minor][Spec Decode] Add use_eagle to SpeculativeConfig (#17213)
Signed-off-by:
Woosuk Kwon
<
woosuk.kwon@berkeley.edu
>
parent
537d5ee0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
vllm/config.py
vllm/config.py
+3
-0
vllm/v1/core/sched/scheduler.py
vllm/v1/core/sched/scheduler.py
+1
-1
vllm/v1/worker/gpu_model_runner.py
vllm/v1/worker/gpu_model_runner.py
+2
-4
No files found.
vllm/config.py
View file @
1cf0719e
...
...
@@ -2566,6 +2566,9 @@ class SpeculativeConfig:
"""
return
self
.
num_speculative_tokens
def
use_eagle
(
self
)
->
bool
:
return
self
.
method
in
(
"eagle"
,
"eagle3"
)
def
__repr__
(
self
)
->
str
:
method
=
self
.
method
model
=
None
if
method
==
"ngram"
else
self
.
draft_model_config
.
model
...
...
vllm/v1/core/sched/scheduler.py
View file @
1cf0719e
...
...
@@ -126,7 +126,7 @@ class Scheduler(SchedulerInterface):
self
.
num_spec_tokens
=
self
.
num_lookahead_tokens
=
0
if
speculative_config
:
self
.
num_spec_tokens
=
speculative_config
.
num_speculative_tokens
if
speculative_config
.
method
in
(
"eagle"
,
"
eagle
3"
):
if
speculative_config
.
use_
eagle
(
):
self
.
num_lookahead_tokens
=
self
.
num_spec_tokens
def
schedule
(
self
)
->
SchedulerOutput
:
...
...
vllm/v1/worker/gpu_model_runner.py
View file @
1cf0719e
...
...
@@ -171,8 +171,7 @@ class GPUModelRunner(LoRAModelRunnerMixin):
if
get_pp_group
().
is_last_rank
:
if
self
.
speculative_config
.
method
==
"ngram"
:
self
.
drafter
=
NgramProposer
(
self
.
vllm_config
)
elif
self
.
speculative_config
.
method
==
"eagle"
or
\
self
.
speculative_config
.
method
==
"eagle3"
:
elif
self
.
speculative_config
.
use_eagle
():
self
.
drafter
=
EagleProposer
(
self
.
vllm_config
,
self
.
device
)
# type: ignore
if
self
.
speculative_config
.
method
==
"eagle3"
:
...
...
@@ -1192,8 +1191,7 @@ class GPUModelRunner(LoRAModelRunnerMixin):
assert
isinstance
(
self
.
drafter
,
NgramProposer
)
spec_token_ids
=
self
.
generate_draft_token_ids
(
valid_sampled_token_ids
,
sampling_metadata
)
elif
self
.
speculative_config
.
method
==
"eagle"
or
\
self
.
speculative_config
.
method
==
"eagle3"
:
elif
self
.
speculative_config
.
use_eagle
():
assert
isinstance
(
self
.
drafter
,
EagleProposer
)
# TODO(woosuk): Refactor the loop.
next_token_ids
:
list
[
int
]
=
[]
...
...
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