Fully generalise input embedding handling in Transformers modelling backend (#51247)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-08-06 16:21:24 +00:00
committed by GitHub
parent 566c80edf9
commit e7b8d59460
6 changed files with 300 additions and 47 deletions
@@ -290,7 +290,7 @@ class VocabParallelEmbedding(PluggableLayer):
# If we are making an embedding layer, then our quantization linear
# method must implement the embedding operation. If we are another
# layer type like ParallelLMHead, this is not important.
is_embedding_layer = type(self) is VocabParallelEmbedding
is_embedding_layer = not isinstance(self, ParallelLMHead)
quant_method_implements_embedding = method_has_implemented_embedding(
type(quant_method)
)