Fix DeepSeek V2 RoPE initialization error (#33501)

Signed-off-by: Eduardo Salinas <edus@microsoft.com>
Signed-off-by: catswe <212922539+catswe@users.noreply.github.com>
Co-authored-by: Eduardo Salinas <edus@microsoft.com>
This commit is contained in:
will b.
2026-02-01 15:00:56 -06:00
committed by GitHub
parent 8869cd8ec1
commit 46b4a02794

View File

@@ -75,7 +75,6 @@ class DeepseekScalingRotaryEmbedding(RotaryEmbeddingBase):
self.rotary_dim, self.rotary_dim,
2, 2,
dtype=torch.float, dtype=torch.float,
device=current_platform.device_type,
) )
/ self.rotary_dim / self.rotary_dim
) )
@@ -104,7 +103,6 @@ class DeepseekScalingRotaryEmbedding(RotaryEmbeddingBase):
inv_freq = self._compute_inv_freq(self.scaling_factor) inv_freq = self._compute_inv_freq(self.scaling_factor)
t = torch.arange( t = torch.arange(
self.max_position_embeddings * self.scaling_factor, self.max_position_embeddings * self.scaling_factor,
device=current_platform.device_type,
dtype=torch.float32, dtype=torch.float32,
) )
freqs = torch.einsum("i,j -> ij", t, inv_freq) freqs = torch.einsum("i,j -> ij", t, inv_freq)