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
88491c1b
Unverified
Commit
88491c1b
authored
Aug 22, 2025
by
PapaGoose
Committed by
GitHub
Aug 22, 2025
Browse files
[Speculators][Speculative Decoding] Fix Qwen 2 Eagle3 Support (#23337)
parent
613a23b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
vllm/model_executor/models/qwen2.py
vllm/model_executor/models/qwen2.py
+9
-2
No files found.
vllm/model_executor/models/qwen2.py
View file @
88491c1b
...
@@ -52,7 +52,7 @@ from vllm.model_executor.sampling_metadata import SamplingMetadata
...
@@ -52,7 +52,7 @@ from vllm.model_executor.sampling_metadata import SamplingMetadata
from
vllm.sequence
import
IntermediateTensors
from
vllm.sequence
import
IntermediateTensors
from
vllm.transformers_utils.config
import
is_interleaved
from
vllm.transformers_utils.config
import
is_interleaved
from
.interfaces
import
SupportsLoRA
,
SupportsPP
from
.interfaces
import
SupportsEagle3
,
SupportsLoRA
,
SupportsPP
from
.utils
import
(
AutoWeightsLoader
,
PPMissingLayer
,
extract_layer_index
,
from
.utils
import
(
AutoWeightsLoader
,
PPMissingLayer
,
extract_layer_index
,
is_pp_missing_parameter
,
is_pp_missing_parameter
,
make_empty_intermediate_tensors_factory
,
make_layers
,
make_empty_intermediate_tensors_factory
,
make_layers
,
...
@@ -442,7 +442,7 @@ class Qwen2Model(nn.Module):
...
@@ -442,7 +442,7 @@ class Qwen2Model(nn.Module):
return
loaded_params
return
loaded_params
class
Qwen2ForCausalLM
(
nn
.
Module
,
SupportsLoRA
,
SupportsPP
):
class
Qwen2ForCausalLM
(
nn
.
Module
,
SupportsLoRA
,
SupportsPP
,
SupportsEagle3
):
packed_modules_mapping
=
{
packed_modules_mapping
=
{
"qkv_proj"
:
[
"qkv_proj"
:
[
"q_proj"
,
"q_proj"
,
...
@@ -488,6 +488,13 @@ class Qwen2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
...
@@ -488,6 +488,13 @@ class Qwen2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
def
get_input_embeddings
(
self
,
input_ids
:
torch
.
Tensor
)
->
torch
.
Tensor
:
def
get_input_embeddings
(
self
,
input_ids
:
torch
.
Tensor
)
->
torch
.
Tensor
:
return
self
.
model
.
get_input_embeddings
(
input_ids
)
return
self
.
model
.
get_input_embeddings
(
input_ids
)
def
set_aux_hidden_state_layers
(
self
,
layers
:
tuple
[
int
])
->
None
:
self
.
model
.
aux_hidden_state_layers
=
layers
def
get_eagle3_aux_hidden_state_layers
(
self
)
->
tuple
[
int
]:
num_layers
=
len
(
self
.
model
.
layers
)
return
(
2
,
num_layers
//
2
,
num_layers
-
3
)
def
forward
(
def
forward
(
self
,
self
,
input_ids
:
torch
.
Tensor
,
input_ids
:
torch
.
Tensor
,
...
...
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