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
73a484ca
Unverified
Commit
73a484ca
authored
Dec 10, 2025
by
Tsukasa OI
Committed by
GitHub
Dec 09, 2025
Browse files
[Model][Quantization] Fix / Add GGUF support for Qwen2 MoE models (#30307)
Signed-off-by:
Tsukasa OI
<
floss_llm@irq.a4lg.com
>
parent
b37bf51e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
vllm/model_executor/models/qwen2_moe.py
vllm/model_executor/models/qwen2_moe.py
+8
-0
No files found.
vllm/model_executor/models/qwen2_moe.py
View file @
73a484ca
...
@@ -367,6 +367,8 @@ class Qwen2MoeModel(nn.Module):
...
@@ -367,6 +367,8 @@ class Qwen2MoeModel(nn.Module):
self
.
embed_tokens
=
VocabParallelEmbedding
(
self
.
embed_tokens
=
VocabParallelEmbedding
(
config
.
vocab_size
,
config
.
vocab_size
,
config
.
hidden_size
,
config
.
hidden_size
,
quant_config
=
quant_config
,
prefix
=
f
"
{
prefix
}
.embed_tokens"
,
)
)
self
.
start_layer
,
self
.
end_layer
,
self
.
layers
=
make_layers
(
self
.
start_layer
,
self
.
end_layer
,
self
.
layers
=
make_layers
(
config
.
num_hidden_layers
,
config
.
num_hidden_layers
,
...
@@ -512,6 +514,12 @@ class Qwen2MoeModel(nn.Module):
...
@@ -512,6 +514,12 @@ class Qwen2MoeModel(nn.Module):
continue
continue
else
:
else
:
name
=
remapped_kv_scale_name
name
=
remapped_kv_scale_name
# GGUF: make sure that shared_expert_gate is a 2D tensor.
if
(
"mlp.shared_expert_gate"
in
name
and
len
(
loaded_weight
.
shape
)
==
1
):
loaded_weight
=
loaded_weight
[
None
,
:]
param
=
params_dict
[
name
]
param
=
params_dict
[
name
]
weight_loader
=
getattr
(
weight_loader
=
getattr
(
param
,
"weight_loader"
,
default_weight_loader
param
,
"weight_loader"
,
default_weight_loader
...
...
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