@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / d3317bbba4
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 10, 01:30 UTC

[Models] Lfm2Moe: minor name changes for resolving lora conflicts (#29063)

Signed-off-by: Paul Pak <paulpak58@gmail.com>

Paul Pak committed Jan 16, 2026 at 23:12 UTC d3317bbba44ec11bbef435308f98284487fce45a
2 files changed +12 -4
vllm/model_executor/models/lfm2.py
+6 -2
@@ -248,7 +248,7 @@ class Lfm2ShortConvDecoderLayer(nn.Module):
248 ) -> None:
249 super().__init__()
250 self.layer_idx = layer_idx
251 - self.conv = ShortConv(
251 + self.short_conv = ShortConv(
252 config=config,
253 dim=config.conv_dim,
254 layer_idx=layer_idx,
@@ -281,7 +281,7 @@ class Lfm2ShortConvDecoderLayer(nn.Module):
281 else:
282 hidden_states, residual = self.operator_norm(hidden_states, residual)
283 output = torch.empty_like(hidden_states)
284 - self.conv(
284 + self.short_conv(
285 hidden_states,
286 output,
287 )
@@ -380,6 +380,9 @@ class Lfm2Model(nn.Module):
380 params_dict = dict(self.named_parameters())
381 loaded_params: set[str] = set()
382 for name, loaded_weight in weights:
383 + if ".conv." in name:
384 + name = name.replace(".conv.", ".short_conv.", 1)
385 +
386 for param_name, weight_name, shard_id in stacked_params_mapping:
387 if weight_name not in name:
388 continue
@@ -414,6 +417,7 @@ class Lfm2ForCausalLM(
417 "w1",
418 "w3",
419 ],
420 + "in_proj": ["in_proj"],
421 }
422
423 # LoRA specific attributes
vllm/model_executor/models/lfm2_moe.py
+6 -2
@@ -349,7 +349,7 @@ class Lfm2MoeShortConvDecoderLayer(nn.Module):
349 ) -> None:
350 super().__init__()
351 self.layer_idx = layer_idx
352 - self.conv = ShortConv(
352 + self.short_conv = ShortConv(
353 config=config,
354 dim=config.hidden_size,
355 layer_idx=layer_idx,
@@ -388,7 +388,7 @@ class Lfm2MoeShortConvDecoderLayer(nn.Module):
388 else:
389 hidden_states, residual = self.operator_norm(hidden_states, residual)
390 output = torch.empty_like(hidden_states)
391 - self.conv(
391 + self.short_conv(
392 hidden_states,
393 output,
394 )
@@ -509,6 +509,9 @@ class Lfm2MoeModel(nn.Module):
509 if "expert_bias" in name:
510 name = name.replace("expert_bias", "gate.e_score_correction_bias")
511
512 + if ".conv." in name:
513 + name = name.replace(".conv.", ".short_conv.", 1)
514 +
515 for param_name, weight_name, shard_id in stacked_params_mapping:
516 # Skip non-stacked layers and experts (experts handled below).
517 if weight_name not in name:
@@ -595,6 +598,7 @@ class Lfm2MoeForCausalLM(
598 "w1",
599 "w3",
600 ],
601 + "in_proj": ["in_proj"],
602 }
603
604 # LoRA specific attributes