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
2ce90e5b
Unverified
Commit
2ce90e5b
authored
Jul 25, 2025
by
Yuxuan Zhang
Committed by
GitHub
Jul 24, 2025
Browse files
Fix GLM-4 PP Missing Layer When using with PP. (#21531)
Signed-off-by:
zRzRzRzRzRzRzR
<
2448370773@qq.com
>
parent
633f6e80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
vllm/model_executor/models/glm4_moe.py
vllm/model_executor/models/glm4_moe.py
+9
-3
No files found.
vllm/model_executor/models/glm4_moe.py
View file @
2ce90e5b
...
...
@@ -612,14 +612,20 @@ class Glm4MoeForCausalLM(nn.Module, SupportsPP):
self
.
num_expert_groups
=
config
.
n_group
self
.
moe_layers
:
list
[
FusedMoE
]
=
[]
example_moe
=
None
for
layer
in
self
.
model
.
layers
:
if
isinstance
(
layer
,
PPMissingLayer
):
continue
assert
isinstance
(
layer
,
Glm4MoeDecoderLayer
)
if
isinstance
(
layer
.
mlp
,
Glm4MoE
):
# Pick last one layer since the first ones may be dense layers.
example_moe
=
layer
.
mlp
self
.
moe_layers
.
append
(
layer
.
mlp
.
experts
)
# Pick last one layer since the first ones may be dense layers.
example_moe
=
typing
.
cast
(
Glm4MoE
,
self
.
model
.
layers
[
config
.
num_hidden_layers
-
1
].
mlp
)
if
example_moe
is
None
:
raise
RuntimeError
(
"No Glm4MoE layer found in model.layers."
)
self
.
num_logical_experts
=
example_moe
.
n_logical_experts
self
.
num_physical_experts
=
example_moe
.
n_physical_experts
self
.
num_local_physical_experts
=
example_moe
.
n_local_physical_experts
...
...
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