Skip to content

Commit 6e5607b

Browse files
committed
bugfix: correct rotary_dim calculation in apply_rotary function to use sin tensor size.
1 parent 1e1fba9 commit 6e5607b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xllm/core/kernels/mlu/rope.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void apply_rotary(torch::Tensor& q,
2828
bool discrete,
2929
bool dynamic_ntk,
3030
int max_query_len) {
31-
const int64_t rotary_dim = q.size(-1);
31+
const int64_t rotary_dim = sin.size(-1);
3232
const int64_t T = q.size(0);
3333
q = q.view({T, -1});
3434
k = k.view({T, -1});

0 commit comments

Comments
 (0)