[XPU] Fix Eagle3 initialization on XPU (#43957)

Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com>
Co-authored-by: Andreas Karatzas <akaratza@amd.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
Chaojun Zhang
2026-07-06 08:46:05 +08:00
committed by GitHub
co-authored by Andreas Karatzas mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Kunshang Ji
parent 78a04c208d
commit d2ec433e37
3 changed files with 44 additions and 1 deletions
+4 -1
View File
@@ -233,7 +233,10 @@ class LlamaModel(nn.Module):
) -> tuple[torch.Tensor, torch.Tensor]:
if input_embeds is None:
input_embeds = self.embed_input_ids(input_ids)
assert hidden_states.shape[-1] == input_embeds.shape[-1]
torch._assert(
hidden_states.shape[-1] == input_embeds.shape[-1],
"hidden_states and input_embeds must have the same last dimension",
)
residual = None
for layer in self.layers: