[Bugfix] Fix GraniteMoeShared weight loading broken by #41184 (#47031)

Signed-off-by: <Michal Ganczarenko> <michal.ganczarenko@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>

Michał Ganczarenko committed Jul 1, 2026 at 17:39 UTC 63fcce4de1563309ea5195ba98d0a2e1ba4f5831
1 file changed +3 -3
vllm/model_executor/models/granitemoeshared.py
+3 -3
@@ -214,11 +214,11 @@ class GraniteMoeSharedModel(nn.Module):
214 for e in range(p.size(0)):
215 w1_name = n.replace(
216 ".block_sparse_moe.input_linear.weight",
217 - f".block_sparse_moe.experts.routed_experts.{e}.w1.weight",
217 + f".block_sparse_moe.experts.{e}.w1.weight",
218 )
219 w3_name = n.replace(
220 ".block_sparse_moe.input_linear.weight",
221 - f".block_sparse_moe.experts.routed_experts.{e}.w3.weight",
221 + f".block_sparse_moe.experts.{e}.w3.weight",
222 )
223 w1_param, w3_param = p[e].chunk(2, dim=0)
224 assert w1_name not in new_weights
@@ -229,7 +229,7 @@ class GraniteMoeSharedModel(nn.Module):
229 for e in range(p.size(0)):
230 w2_name = n.replace(
231 ".block_sparse_moe.output_linear.weight",
232 - f".block_sparse_moe.experts.routed_experts.{e}.w2.weight",
232 + f".block_sparse_moe.experts.{e}.w2.weight",
233 )
234 w2_param = p[e]
235 assert w2_name not in new_weights