Skip to content

Commit 41318d7

Browse files
authored
llama : use the same threshold for OpenBLAS and ggml thread limiting (#577)
1 parent a6956b2 commit 41318d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llama.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static bool llama_eval_internal(
856856
// for big prompts, if BLAS is enabled, it is better to use only one thread
857857
// otherwise, the threads are spin-lock waiting for the BLAS calls and are degrading the performance
858858
ggml_cgraph gf = {};
859-
gf.n_threads = N > 255 && ggml_cpu_has_blas() ? 1 : n_threads;
859+
gf.n_threads = N >= 32 && ggml_cpu_has_blas() ? 1 : n_threads;
860860

861861
struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
862862
memcpy(embd->data, tokens, N*ggml_element_size(embd));

0 commit comments

Comments
 (0)