Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
77cf771e
Unverified
Commit
77cf771e
authored
Mar 25, 2025
by
Ke Bao
Committed by
GitHub
Mar 24, 2025
Browse files
Fix EAGLE3 for llama3.3 70b (#4716)
parent
8154de5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
python/sglang/srt/models/llama.py
python/sglang/srt/models/llama.py
+6
-0
python/sglang/srt/models/llama_eagle3.py
python/sglang/srt/models/llama_eagle3.py
+4
-1
No files found.
python/sglang/srt/models/llama.py
View file @
77cf771e
...
...
@@ -610,6 +610,12 @@ class LlamaForCausalLM(nn.Module):
return
self
.
model
.
embed_tokens
.
weight
def
set_embed
(
self
,
embed
):
# NOTE: If draft hidden size != target hidden size, the embed weight cannot be shared for EAGLE3
if
(
hasattr
(
self
.
config
,
"target_hidden_size"
)
and
self
.
config
.
target_hidden_size
!=
self
.
config
.
hidden_size
):
return
del
self
.
model
.
embed_tokens
.
weight
self
.
model
.
embed_tokens
.
weight
=
embed
torch
.
cuda
.
empty_cache
()
...
...
python/sglang/srt/models/llama_eagle3.py
View file @
77cf771e
...
...
@@ -105,7 +105,10 @@ class LlamaModel(nn.Module):
prefix
=
add_prefix
(
"embed_tokens"
,
prefix
),
)
self
.
midlayer
=
LlamaDecoderLayer
(
config
,
0
,
quant_config
,
prefix
)
self
.
fc
=
torch
.
nn
.
Linear
(
config
.
hidden_size
*
3
,
config
.
hidden_size
)
if
hasattr
(
config
,
"target_hidden_size"
):
self
.
fc
=
torch
.
nn
.
Linear
(
config
.
target_hidden_size
*
3
,
config
.
hidden_size
)
else
:
self
.
fc
=
torch
.
nn
.
Linear
(
config
.
hidden_size
*
3
,
config
.
hidden_size
)
self
.
norm
=
RMSNorm
(
config
.
hidden_size
,
eps
=
config
.
rms_norm_eps
)
...
...
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