Skip to content

Commit 624f06f

Browse files
restore original RoPE logic
1 parent 10343cb commit 624f06f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ggml-cuda.cu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6418,7 +6418,11 @@ void ggml_cuda_soft_max(const ggml_tensor * src0, const ggml_tensor * src1, ggml
64186418

64196419
void ggml_cuda_rope(const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst) {
64206420
GGML_ASSERT(ggml_is_contiguous(src0)); // TODO: this restriction is temporary until non-cont support is implemented
6421-
ggml_cuda_op(src0, src1, dst, ggml_cuda_op_rope, true, true);
6421+
6422+
const int mode = ((int32_t *) dst->op_params)[2];
6423+
const bool is_glm = mode & 4;
6424+
6425+
ggml_cuda_op(src0, src1, dst, ggml_cuda_op_rope, true, !is_glm); // flatten support not implemented for glm
64226426
}
64236427

64246428
void ggml_cuda_alibi(const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst) {

0 commit comments

Comments
 (0)