]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : fix MPI threads (close #2827)
authorGeorgi Gerganov <redacted>
Sun, 27 Aug 2023 15:55:41 +0000 (18:55 +0300)
committerGeorgi Gerganov <redacted>
Sun, 27 Aug 2023 15:55:41 +0000 (18:55 +0300)
llama.cpp

index 0bb8fcd6eaa0ac79e75d40c2a46e863c64f81b21..72d2d1de03fe8277c9abc2b3d267a75ef5c1749d 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -2845,7 +2845,6 @@ static bool llama_eval_internal(
 
     GGML_ASSERT(n_tokens > 0);
     GGML_ASSERT(n_past >= 0);
-    GGML_ASSERT(n_threads > 0);
     // TODO: keep the values of n_batch and n_ctx
     // GGML_ASSERT(n_tokens <= n_batch);
     // GGML_ASSERT(n_past + n_tokens <= n_ctx);
@@ -2856,6 +2855,8 @@ static bool llama_eval_internal(
     ggml_mpi_eval_init(lctx.ctx_mpi, &n_tokens, &n_past, &n_threads);
 #endif
 
+    GGML_ASSERT(n_threads > 0);
+
     const int N = n_tokens;
 
     const auto & model   = lctx.model;