fix: keep DeepSeek V4 RoPE cache on inv_freq device (#43926)

Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
Signed-off-by: Schwinn Saereesitthipitak <17022745+galletas1712@users.noreply.github.com>
This commit is contained in:
Schwinn Saereesitthipitak
2026-06-04 15:30:29 -07:00
committed by GitHub
parent a55fccfc7c
commit b7c5baf63d
@@ -251,7 +251,7 @@ class DeepseekV4ScalingRotaryEmbedding(DeepseekScalingRotaryEmbedding):
inv_freq = self._compute_inv_freq(self.scaling_factor)
t = torch.arange(
self.max_position_embeddings * self.scaling_factor,
device=current_platform.device_type,
device=inv_freq.device,
dtype=torch.float32,
)
freqs = torch.einsum("i,j -> ij", t, inv_freq)