@@ -8715,8 +8715,7 @@ static void llm_build_kv_store(
8715
8715
8716
8716
GGML_ASSERT(kv.size == n_ctx);
8717
8717
8718
- struct ggml_tensor * k_cache_view = ggml_view_1d(ctx, kv.k_l[il], n_tokens*n_embd_k_gqa,
8719
- (ggml_row_size(kv.k_l[il]->type, n_embd_k_gqa))*kv_head);
8718
+ struct ggml_tensor * k_cache_view = ggml_view_1d(ctx, kv.k_l[il], n_tokens*n_embd_k_gqa, ggml_row_size(kv.k_l[il]->type, n_embd_k_gqa)*kv_head);
8720
8719
cb(k_cache_view, "k_cache_view", il);
8721
8720
8722
8721
// note: storing RoPE-ed version of K in the KV cache
@@ -8727,8 +8726,7 @@ static void llm_build_kv_store(
8727
8726
struct ggml_tensor * v_cache_view = nullptr;
8728
8727
8729
8728
if (cparams.flash_attn) {
8730
- v_cache_view = ggml_view_1d(ctx, kv.v_l[il], n_tokens*n_embd_v_gqa,
8731
- (kv_head)*ggml_row_size(kv.v_l[il]->type, n_embd_v_gqa));
8729
+ v_cache_view = ggml_view_1d(ctx, kv.v_l[il], n_tokens*n_embd_v_gqa, ggml_row_size(kv.v_l[il]->type, n_embd_v_gqa)*kv_head);
8732
8730
} else {
8733
8731
// note: the V cache is transposed when not using flash attention
8734
8732
v_cache_view = ggml_view_2d(ctx, kv.v_l[il], n_tokens, n_embd_v_gqa,
@@ -9215,8 +9213,7 @@ static struct ggml_tensor * llm_build_kv(
9215
9213
9216
9214
struct ggml_tensor * cur;
9217
9215
9218
- cur = llm_build_kqv(ctx, lctx, kv, graph, wo, wo_b,
9219
- q_cur, kq_mask, n_tokens, n_kv, kq_scale, cb, il);
9216
+ cur = llm_build_kqv(ctx, lctx, kv, graph, wo, wo_b, q_cur, kq_mask, n_tokens, n_kv, kq_scale, cb, il);
9220
9217
cb(cur, "kqv_out", il);
9221
9218
9222
9219
return cur;
0 commit comments