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
1bc86a3d
Unverified
Commit
1bc86a3d
authored
May 31, 2025
by
Benjamin Chislett
Committed by
GitHub
May 31, 2025
Browse files
[Bugfix] Fix EAGLE3 broken logits (#18909)
Signed-off-by:
Benjamin Chislett
<
benjamin.chislett@centml.ai
>
parent
bbfa0c61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
vllm/model_executor/models/llama_eagle3.py
vllm/model_executor/models/llama_eagle3.py
+12
-11
No files found.
vllm/model_executor/models/llama_eagle3.py
View file @
1bc86a3d
...
...
@@ -215,6 +215,9 @@ class Eagle3LlamaForCausalLM(LlamaForCausalLM):
logits
=
self
.
logits_processor
(
self
.
lm_head
,
hidden_states
,
sampling_metadata
)
if
self
.
draft_id_to_target_id
is
None
:
assert
logits
.
shape
[
1
]
==
self
.
config
.
vocab_size
,
\
"Expected logits to have shape "
\
f
"(*,
{
self
.
config
.
vocab_size
}
), but got
{
logits
.
shape
}
"
return
logits
base
=
torch
.
arange
(
self
.
config
.
draft_vocab_size
,
device
=
logits
.
device
)
...
...
@@ -234,24 +237,22 @@ class Eagle3LlamaForCausalLM(LlamaForCausalLM):
return
self
.
model
.
fc
(
hidden_states
)
def
load_weights
(
self
,
weights
:
Iterable
[
tuple
[
str
,
torch
.
Tensor
]]):
loader
=
AutoWeightsLoader
(
self
,
skip_prefixes
=
None
,
)
model_weights
=
{}
includes_draft_id_mapping
=
False
for
name
,
loaded_weight
in
weights
:
if
"t2d"
in
name
:
continue
if
"d2t"
in
name
:
name
=
name
.
replace
(
"d2t"
,
"draft_id_to_target_id"
)
includes_draft_id_mapping
=
True
elif
"lm_head"
not
in
name
:
name
=
"model."
+
name
model_weights
[
name
]
=
loaded_weight
loaded_weights
=
loader
.
load_weights
(
model_weights
.
items
())
if
'd2t'
not
in
loaded_weights
:
self
.
draft_id_to_target_id
=
None
return
loaded_weights
loader
=
AutoWeightsLoader
(
self
,
skip_prefixes
=
None
,
skip_substrs
=
[
"draft_id_to_target_id"
]
\
if
not
includes_draft_id_mapping
else
None
,
)
loader
.
load_weights
(
model_weights
.
items
())
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