Skip to content

Commit 870ef91

Browse files
committed
initialize inv_freq on cuda
1 parent 1f768b8 commit 870ef91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vllm/model_executor/layers/attention.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def __init__(
265265

266266
# Create the cos and sin cache.
267267
inv_freq = 1.0 / (base**(
268-
torch.arange(0, rotary_dim, 2, dtype=torch.float32) / rotary_dim))
269-
t = torch.arange(max_position, dtype=torch.float32)
268+
torch.arange(0, rotary_dim, 2, dtype=torch.float32, device="cuda") / rotary_dim))
269+
t = torch.arange(max_position, dtype=torch.float32, device="cuda")
270270
freqs = torch.einsum("i,j -> ij", t, inv_freq)
271271
cos = freqs.cos()
272272
sin = freqs.sin()

0 commit comments

Comments
 (0)