]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : disable pipeline parallelism with nkvo (#7265)
authorslaren <redacted>
Tue, 14 May 2024 07:33:42 +0000 (09:33 +0200)
committerGitHub <redacted>
Tue, 14 May 2024 07:33:42 +0000 (17:33 +1000)
llama.cpp

index 01a35dfb638f4008231d4f94613b4fe9b1a6da97..ad35e4a2e5306564925e19b15cced6f947de40fb 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -15849,7 +15849,11 @@ struct llama_context * llama_new_context_with_model(
             ctx->buf_compute_meta.resize(ggml_tensor_overhead()*LLAMA_MAX_NODES + ggml_graph_overhead_custom(LLAMA_MAX_NODES, false));
 
             // enabling pipeline parallelism in the scheduler increases memory usage, so it is only done when necessary
-            bool pipeline_parallel = llama_get_device_count() > 1 && model->n_gpu_layers > (int)model->hparams.n_layer && model->split_mode == LLAMA_SPLIT_MODE_LAYER;
+            bool pipeline_parallel =
+                llama_get_device_count() > 1 &&
+                model->n_gpu_layers > (int)model->hparams.n_layer &&
+                model->split_mode == LLAMA_SPLIT_MODE_LAYER &&
+                params.offload_kqv;
 #ifndef GGML_USE_CUDA
             // pipeline parallelism requires support for async compute and events
             // currently this is only implemented in the CUDA backend