[Bugfix][Model] MiMo: keep fused fp8 qkv_proj pairing state across weight-loading calls (#58142)

Signed-off-by: vllmellm <vllm.ellm@embeddedllm.com>
This commit is contained in:
yhcheong (vllmellm)
2026-09-29 09:37:20 +00:00
committed by GitHub
parent 4861833ae2
commit 77e52645e9
2 changed files with 12 additions and 3 deletions
+6 -2
View File
@@ -742,8 +742,12 @@ class MiMoV2Model(nn.Module, EagleModelMixin):
expert_params_mapping = self.get_expert_mapping()
# Pro-format fused qkv_proj arrives as two tensors (weight and
# weight_scale_inv). Store them per-layer so that they can be
# sharded together.
pending_fp8_qkv_proj: dict[str, dict[str, torch.Tensor]] = {}
# sharded together. The state must outlive this call: AutoWeightsLoader
# delegates per contiguous group of names, so a pair can straddle two
# calls and would otherwise be dropped silently.
pending_fp8_qkv_proj = getattr(self, "_pending_fp8_qkv_proj", None)
if pending_fp8_qkv_proj is None:
self._pending_fp8_qkv_proj = pending_fp8_qkv_proj = {}
for name, loaded_weight in weights:
if "rotary_emb.inv_freq" in name:
continue
+6 -1
View File
@@ -266,7 +266,12 @@ class MiMoV2MTP(nn.Module):
params_dict = dict(self.named_parameters())
loaded_params: set[str] = set()
pending_qkv_proj: dict[str, dict[str, torch.Tensor]] = {}
# The pairing state must outlive this call: AutoWeightsLoader delegates
# per contiguous group of names, so a pair can straddle two calls and
# would otherwise be dropped silently.
pending_qkv_proj = getattr(self, "_pending_qkv_proj", None)
if pending_qkv_proj is None:
self._pending_qkv_proj = pending_qkv_proj = {}
for name, loaded_weight in weights:
if "rotary_emb.inv_freq" in name: