[Bugfix] Fix spec decode memory regression after #28549 (#28819)

Signed-off-by: zhewenli <zhewenli@meta.com>
This commit is contained in:
Zhewen Li
2025-11-20 19:05:50 +08:00
committed by GitHub
parent 371b1d4c61
commit 93c8672ceb
4 changed files with 5 additions and 19 deletions
+5 -2
View File
@@ -1028,8 +1028,11 @@ class EagleProposer:
elif (
isinstance(target_embed_tokens.weight, torch.Tensor)
and isinstance(self.model.model.embed_tokens.weight, torch.Tensor)
and torch.equal(
target_embed_tokens.weight, self.model.model.embed_tokens.weight
and torch.allclose(
target_embed_tokens.weight.cpu(),
self.model.model.embed_tokens.weight.cpu(),
rtol=1e-5,
atol=1e-7,
)
):
share_embeddings = True