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
343041c4
Unverified
Commit
343041c4
authored
Nov 20, 2024
by
Sky Lee
Committed by
GitHub
Nov 20, 2024
Browse files
[model] Reduce medusa weight (#10454)
Signed-off-by:
skylee-01
<
497627264@qq.com
>
parent
ed701ca9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
vllm/model_executor/models/medusa.py
vllm/model_executor/models/medusa.py
+18
-4
No files found.
vllm/model_executor/models/medusa.py
View file @
343041c4
...
...
@@ -61,6 +61,17 @@ class Medusa(nn.Module):
self
.
truncated_vocab_size
=
config
.
truncated_vocab_size
self
.
unpadded_vocab_size
=
self
.
truncated_vocab_size
if
getattr
(
config
,
"original_lm_head"
,
False
):
self
.
lm_head
=
ParallelLMHead
(
self
.
unpadded_vocab_size
,
config
.
hidden_size
,
org_num_embeddings
=
self
.
truncated_vocab_size
,
padding_size
=
DEFAULT_VOCAB_PADDING_SIZE
,
)
self
.
lm_heads
=
[
self
.
lm_head
for
_
in
range
(
self
.
config
.
num_heads
)
]
else
:
self
.
lm_heads
=
nn
.
ModuleList
([
ParallelLMHead
(
self
.
unpadded_vocab_size
,
...
...
@@ -172,6 +183,9 @@ class Medusa(nn.Module):
requires_grad
=
False
)
elif
name
in
params_dict
:
weights_map
[
name
]
=
loaded_weight
elif
(
getattr
(
self
.
config
,
"original_lm_head"
,
False
)
and
name
==
"lm_heads.0.weight"
):
weights_map
[
"lm_head.weight"
]
=
loaded_weight
for
name
,
loaded_weight
in
weights_map
.
items
():
if
"lm_head"
in
name
and
self
.
token_map
is
not
None
and
\
...
...
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