@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 561b77a0d6
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 15, 08:30 UTC

[Bugfix] Fix the lm_head in gpt_bigcode in lora mode (#6357)

Signed-off-by: Max de Bayser <mbayser@br.ibm.com> Signed-off-by: Max de Bayser <maxdebayser@gmail.com>

Maximilien de Bayser committed May 26, 2025 at 03:52 UTC 561b77a0d608a9059318d6cff9f0975439880d77
1 file changed +5 -8
vllm/model_executor/models/gpt_bigcode.py
+5 -8
@@ -272,12 +272,6 @@ class GPTBigCodeModel(nn.Module):
272 class GPTBigCodeForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
273 packed_modules_mapping = {"c_attn": ["c_attn"]}
274
275 - # LoRA specific attributes
276 - embedding_modules = {
277 - "wte": "input_embeddings",
278 - "lm_head": "output_embeddings",
279 - }
280 -
275 def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
276 super().__init__()
277 config = vllm_config.model_config.hf_config
@@ -330,8 +324,11 @@ class GPTBigCodeForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
324
325 def load_weights(self, weights: Iterable[tuple[str,
326 torch.Tensor]]) -> set[str]:
327 + skip_prefixes = None
328 + if self.config.tie_word_embeddings:
329 + skip_prefixes = ["lm_head."]
330 loader = AutoWeightsLoader(
331 self,
335 - skip_prefixes=(["lm_head."]),
332 + skip_prefixes=skip_prefixes,
333 )
337 - return loader.load_weights(weights)
\ No newline at end of file
334 + return loader.load_weights(weights)