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
dc45efc8
Unverified
Commit
dc45efc8
authored
Nov 20, 2025
by
Dezhan
Committed by
GitHub
Nov 20, 2025
Browse files
[BugFix] Fix Llama4 Pipeline Parallelism Assert Error (#28577)
Co-authored-by:
Dezhan Tu
<
dztu@meta.com
>
parent
fb8851f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
vllm/model_executor/models/llama4.py
vllm/model_executor/models/llama4.py
+7
-0
No files found.
vllm/model_executor/models/llama4.py
View file @
dc45efc8
...
@@ -53,6 +53,7 @@ from vllm.model_executor.models.utils import sequence_parallel_chunk
...
@@ -53,6 +53,7 @@ from vllm.model_executor.models.utils import sequence_parallel_chunk
from
.llama
import
LlamaForCausalLM
,
LlamaMLP
,
LlamaModel
from
.llama
import
LlamaForCausalLM
,
LlamaMLP
,
LlamaModel
from
.utils
import
(
from
.utils
import
(
AutoWeightsLoader
,
AutoWeightsLoader
,
PPMissingLayer
,
extract_layer_index
,
extract_layer_index
,
fast_topk
,
fast_topk
,
is_pp_missing_parameter
,
is_pp_missing_parameter
,
...
@@ -729,6 +730,9 @@ class Llama4ForCausalLM(LlamaForCausalLM, MixtureOfExperts):
...
@@ -729,6 +730,9 @@ class Llama4ForCausalLM(LlamaForCausalLM, MixtureOfExperts):
self
.
moe_layers
=
[]
self
.
moe_layers
=
[]
example_moe
=
None
example_moe
=
None
for
layer
in
self
.
model
.
layers
:
for
layer
in
self
.
model
.
layers
:
if
isinstance
(
layer
,
PPMissingLayer
):
continue
assert
isinstance
(
layer
,
Llama4DecoderLayer
)
assert
isinstance
(
layer
,
Llama4DecoderLayer
)
if
isinstance
(
layer
.
feed_forward
,
Llama4MoE
):
if
isinstance
(
layer
.
feed_forward
,
Llama4MoE
):
# Pick last one layer since the first ones may be dense layers.
# Pick last one layer since the first ones may be dense layers.
...
@@ -765,6 +769,9 @@ class Llama4ForCausalLM(LlamaForCausalLM, MixtureOfExperts):
...
@@ -765,6 +769,9 @@ class Llama4ForCausalLM(LlamaForCausalLM, MixtureOfExperts):
self
.
num_local_physical_experts
=
num_local_physical_experts
self
.
num_local_physical_experts
=
num_local_physical_experts
self
.
num_redundant_experts
=
num_physical_experts
-
self
.
num_logical_experts
self
.
num_redundant_experts
=
num_physical_experts
-
self
.
num_logical_experts
for
layer
in
self
.
model
.
layers
:
for
layer
in
self
.
model
.
layers
:
if
isinstance
(
layer
,
PPMissingLayer
):
continue
if
isinstance
(
layer
.
feed_forward
,
Llama4MoE
):
if
isinstance
(
layer
.
feed_forward
,
Llama4MoE
):
moe
=
layer
.
feed_forward
moe
=
layer
.
feed_forward
moe
.
n_local_physical_experts
=
num_local_physical_experts
moe
.
n_local_physical_experts
=
num_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