[Bugfix] Fix humming lm_head crash and FusedMoE weight_shape coercion (#46420)

Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: Michael Goin <mgoin64@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michael Goin
2026-06-22 18:19:29 -07:00
committed by GitHub
co-authored by Claude Opus 4.8
parent e48592066e
commit 8207ce0850
5 changed files with 27 additions and 7 deletions
@@ -530,8 +530,10 @@ class RoutedExperts(PluggableLayer):
):
param_data = param.data
# Input scales can be loaded directly and should be equal.
param_data[expert_id] = self._to_scalar(loaded_weight)
# Used for both scalar input_scale and the size-2 `weight_shape`
# param (compressed-tensors). Assign directly so both shapes load;
# _to_scalar's reshape(()) would reject the size-2 weight_shape.
param_data[expert_id] = loaded_weight
def _load_g_idx(
self,