Fix weight tying (#51665)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-08-20 10:31:55 +00:00
committed by GitHub
parent 6e85feb1b7
commit f0c14b4f77
70 changed files with 526 additions and 238 deletions
+10
View File
@@ -1170,6 +1170,16 @@ class VllmConfig:
self.model_config, self.load_config
)
# "dummy" reads no weights at all, and the sharded formats read a vLLM
# state dict, which stores tied word embeddings under the lm_head only.
# Neither can tell us what the original checkpoint contained.
if self.model_config is not None and self.load_config.load_format not in (
"dummy",
"sharded_state",
"runai_streamer_sharded",
):
self.model_config.maybe_untie_word_embeddings()
if (
self.quant_config is not None
and self.model_config is not None