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:
@@ -75,7 +75,6 @@ class DeepseekScalingRotaryEmbedding(RotaryEmbeddingBase):
|
||||
self.rotary_dim,
|
||||
2,
|
||||
dtype=torch.float,
|
||||
device=current_platform.device_type,
|
||||
)
|
||||
/ self.rotary_dim
|
||||
)
|
||||
@@ -104,7 +103,6 @@ class DeepseekScalingRotaryEmbedding(RotaryEmbeddingBase):
|
||||
inv_freq = self._compute_inv_freq(self.scaling_factor)
|
||||
t = torch.arange(
|
||||
self.max_position_embeddings * self.scaling_factor,
|
||||
device=current_platform.device_type,
|
||||
dtype=torch.float32,
|
||||
)
|
||||
freqs = torch.einsum("i,j -> ij", t, inv_freq)
|
||||
|
||||
Reference in New Issue
Block a user