[Bugfix][MoE] Filter packed expert weights during EP loading (#49558)
Signed-off-by: aoshen02 <aoshen02@users.noreply.github.com> Signed-off-by: aoshen02 <aoshen@inferact.ai> Co-authored-by: aoshen02 <aoshen02@users.noreply.github.com>
This commit is contained in:
@@ -185,6 +185,21 @@ class TestShouldSkipWeight:
|
||||
"model.layers.0.mlp.experts.200.gate_proj.weight", self.local_ids
|
||||
)
|
||||
|
||||
def test_local_packed_expert_not_skipped(self):
|
||||
assert not should_skip_weight(
|
||||
"model.layers.0.mlp.experts.10.gate_proj.weight_packed", self.local_ids
|
||||
)
|
||||
|
||||
def test_remote_packed_expert_skipped(self):
|
||||
assert should_skip_weight(
|
||||
"model.layers.0.mlp.experts.200.gate_proj.weight_packed", self.local_ids
|
||||
)
|
||||
|
||||
def test_remote_expert_scale_not_skipped(self):
|
||||
assert not should_skip_weight(
|
||||
"model.layers.0.mlp.experts.200.gate_proj.weight_scale", self.local_ids
|
||||
)
|
||||
|
||||
def test_boundary_expert(self):
|
||||
# Expert 47 is local (last one), 48 is not
|
||||
assert not should_skip_weight(
|
||||
|
||||
@@ -76,6 +76,6 @@ def should_skip_weight(
|
||||
# Only skip heavy weight tensors, never scale/metadata tensors.
|
||||
# Scale tensors are tiny and some backends need them from ALL experts
|
||||
# (e.g. FlashInfer NVFP4 computes a global max of activation scales).
|
||||
if not weight_name.endswith(".weight"):
|
||||
if not weight_name.endswith((".weight", ".weight_packed")):
|
||||
return False
|
||||
return eid not in local_expert_ids
|
||||
|
||||
Reference in New Issue
Block a user