@@ -3603,7 +3603,7 @@ static struct ggml_cgraph * llm_build_falcon(
3603
3603
ggml_build_forward_expand (gf, cur);
3604
3604
3605
3605
ggml_free (ctx0);
3606
-
3606
+
3607
3607
#if defined(GGML_USE_KOMPUTE)
3608
3608
if (lctx.ctx_kompute ) {
3609
3609
if (!ggml_vk_has_h2d_all (lctx.ctx_kompute )) {
@@ -4147,7 +4147,7 @@ static struct ggml_cgraph * llm_build_mpt(
4147
4147
ggml_build_forward_expand (gf, cur);
4148
4148
4149
4149
ggml_free (ctx0);
4150
-
4150
+
4151
4151
#if defined(GGML_USE_KOMPUTE)
4152
4152
if (lctx.ctx_kompute ) {
4153
4153
if (!ggml_vk_has_h2d_all (lctx.ctx_kompute )) {
@@ -4307,11 +4307,19 @@ static bool llama_eval_internal(
4307
4307
ggml_graph_compute_helper (lctx.work_buffer , gf, n_threads);
4308
4308
}
4309
4309
#elif defined(GGML_USE_KOMPUTE)
4310
- if (lctx.ctx_kompute ) {
4310
+ if (lctx.ctx_kompute && N == 1 ) {
4311
4311
ggml_vk_graph_compute (lctx.ctx_kompute , gf);
4312
4312
ggml_vk_d2h_tensor (lctx.ctx_kompute , res);
4313
4313
} else {
4314
+ if (lctx.ctx_kompute ) {
4315
+ ggml_vk_d2h_tensor (lctx.ctx_kompute , kv_self.k );
4316
+ ggml_vk_d2h_tensor (lctx.ctx_kompute , kv_self.v );
4317
+ }
4314
4318
ggml_graph_compute_helper (lctx.work_buffer , gf, n_threads);
4319
+ if (lctx.ctx_kompute ) {
4320
+ ggml_vk_h2d_tensor (lctx.ctx_kompute , kv_self.k );
4321
+ ggml_vk_h2d_tensor (lctx.ctx_kompute , kv_self.v );
4322
+ }
4315
4323
}
4316
4324
#else
4317
4325
ggml_graph_compute_helper (lctx.work_buffer , gf, n_threads);
0 commit comments