Some custom CausalLM/VLM model classes expose or pass through tie_word_embeddings,
but not all of them explicitly implement weight tying between the input embeddings
and lm_head.
This is usually fine for current released configs because many of these models
intentionally default to tie_word_embeddings=False, and some architectures may
require separate embedding/head weights, especially with pipeline parallelism or
asymmetric model structure.
However, the behavior is confusing when a user sets tie_word_embeddings=True.
It may not be obvious whether the model should actually tie lm_head.weight to
embed_tokens.weight, or whether the config value should be rejected or
documented as unsupported.
Suggested cleanup
Audit custom nn.Module model implementations that define lm_head and input
embeddings:
- If the architecture supports tied embeddings, add explicit
_tied_weights_keys
and tie_weights() handling.
- If the architecture intentionally requires separate weights, document that
tie_word_embeddings=True is unsupported or validate against it.
- Add small tied/untied config tests where tying is supported.
This is not currently considered an urgent checkpoint-resume correctness issue
after the tied-lm-head checkpoint guard in #2511, but it would make model behavior clearer
and safer for future configs.
Some custom CausalLM/VLM model classes expose or pass through
tie_word_embeddings,but not all of them explicitly implement weight tying between the input embeddings
and
lm_head.This is usually fine for current released configs because many of these models
intentionally default to
tie_word_embeddings=False, and some architectures mayrequire separate embedding/head weights, especially with pipeline parallelism or
asymmetric model structure.
However, the behavior is confusing when a user sets
tie_word_embeddings=True.It may not be obvious whether the model should actually tie
lm_head.weighttoembed_tokens.weight, or whether the config value should be rejected ordocumented as unsupported.
Suggested cleanup
Audit custom
nn.Modulemodel implementations that definelm_headand inputembeddings:
_tied_weights_keysand
tie_weights()handling.tie_word_embeddings=Trueis unsupported or validate against it.This is not currently considered an urgent checkpoint-resume correctness issue
after the tied-lm-head checkpoint guard in #2511, but it would make model behavior clearer
and safer for future configs.