From 485bbe1c6fb97d66cce7483120c043206f26a410 Mon Sep 17 00:00:00 2001 From: fxmarty-amd Date: Mon, 22 Jun 2026 02:46:49 +0200 Subject: [PATCH] [CI] Fix missing `tp_size` attribute on `RoutedExperts` (#46163) Signed-off-by: Felix Marty Co-authored-by: Andreas Karatzas --- vllm/model_executor/layers/quantization/moe_wna16.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vllm/model_executor/layers/quantization/moe_wna16.py b/vllm/model_executor/layers/quantization/moe_wna16.py index 2dabfd436f..3f332c86e8 100644 --- a/vllm/model_executor/layers/quantization/moe_wna16.py +++ b/vllm/model_executor/layers/quantization/moe_wna16.py @@ -426,6 +426,7 @@ class MoeWNA16Method(FusedMoEMethodBase): device = get_tp_group().device tp_rank = get_tensor_model_parallel_rank() + tp_size = layer.moe_config.moe_parallel_config.tp_size loaded_weight = loaded_weight.to(device) shard_size = layer.intermediate_size_per_partition @@ -464,9 +465,7 @@ class MoeWNA16Method(FusedMoEMethodBase): ) if "w13_qzeros" in weight_name: - tensor = loaded_weight.view(layer.tp_size, -1, loaded_weight.size(1))[ - tp_rank - ] + tensor = loaded_weight.view(tp_size, -1, loaded_weight.size(1))[tp_rank] if shard_id == "w1": param.data[expert_id, : shard_size // 2] = tensor else: @@ -474,7 +473,7 @@ class MoeWNA16Method(FusedMoEMethodBase): return True if return_success else None elif "w2_qzeros" in weight_name: param.data[expert_id] = loaded_weight.view( - loaded_weight.size(0), layer.tp_size, -1 + loaded_weight.size(0), tp_size, -1 )[:, tp_rank] return True if return_success else None else: