Skip to content

Commit be2ac38

Browse files
committed
Make qrot, krot contiguous
1 parent 047032d commit be2ac38

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llama.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4712,20 +4712,20 @@ struct llm_build_context {
47124712
cb(Vcur, "Vcur", il);
47134713

47144714
// RoPE the first n_rot of q/k, pass the other half, and concat.
4715-
struct ggml_tensor * qrot = ggml_view_3d(
4715+
struct ggml_tensor * qrot = ggml_cont(ctx0, ggml_view_3d(
47164716
ctx0, tmpq, hparams.n_rot, n_head, n_tokens,
47174717
ggml_element_size(tmpq) * n_embd_head,
47184718
ggml_element_size(tmpq) * n_embd_head * n_head,
47194719
0
4720-
);
4720+
));
47214721
cb(qrot, "qrot", il);
47224722

4723-
struct ggml_tensor * krot = ggml_view_3d(
4723+
struct ggml_tensor * krot = ggml_cont(ctx0, ggml_view_3d(
47244724
ctx0, tmpk, hparams.n_rot, n_head, n_tokens,
47254725
ggml_element_size(tmpk) * n_embd_head,
47264726
ggml_element_size(tmpk) * n_embd_head * n_head_kv,
47274727
0
4728-
);
4728+
));
47294729
cb(krot, "krot", il);
47304730

47314731
// get the second half of tmpq, e.g tmpq[n_rot:, :, :]

0 commit comments

Comments
 (0)