[CI] Fix missing `tp_size` attribute on `RoutedExperts` (#46163)
Signed-off-by: Felix Marty <Felix.Marty@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
fxmarty-amd committed
Jun 22, 2026 at 02:46 UTC
485bbe1c6fb97d66cce7483120c043206f26a410
1 file changed
+3
-4
vllm/model_executor/layers/quantization/moe_wna16.py
+3
-4
@@ -426,6 +426,7 @@ class MoeWNA16Method(FusedMoEMethodBase):
426
427
device = get_tp_group().device
428
tp_rank = get_tensor_model_parallel_rank()
429
+ tp_size = layer.moe_config.moe_parallel_config.tp_size
430
loaded_weight = loaded_weight.to(device)
431
shard_size = layer.intermediate_size_per_partition
432
@@ -464,9 +465,7 @@ class MoeWNA16Method(FusedMoEMethodBase):
465
)
466
467
if "w13_qzeros" in weight_name:
467
- tensor = loaded_weight.view(layer.tp_size, -1, loaded_weight.size(1))[
468
- tp_rank
469
- ]
468
+ tensor = loaded_weight.view(tp_size, -1, loaded_weight.size(1))[tp_rank]
469
if shard_id == "w1":
470
param.data[expert_id, : shard_size // 2] = tensor
471
else:
@@ -474,7 +473,7 @@ class MoeWNA16Method(FusedMoEMethodBase):
473
return True if return_success else None
474
elif "w2_qzeros" in weight_name:
475
param.data[expert_id] = loaded_weight.view(
477
- loaded_weight.size(0), layer.tp_size, -1
476
+ loaded_weight.size(0), tp_size, -1
477
)[:, tp_rank]
478
return True if return_success else None
479
else: