Skip to content

Commit 8e1f0b6

Browse files
committed
tests : disable grad / opt + minor naming changes
1 parent 4646cc2 commit 8e1f0b6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

llama.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ static bool llama_eval_internal(
12681268
const float * embd,
12691269
const int n_tokens,
12701270
const int n_past,
1271-
const int n_threads,
1271+
int n_threads,
12721272
const char * cgraph_fname) {
12731273

12741274
LLAMA_ASSERT((!tokens && embd) || (tokens && !embd));
@@ -1309,10 +1309,11 @@ static bool llama_eval_internal(
13091309

13101310
struct ggml_context * ctx0 = ggml_init(params);
13111311

1312+
ggml_cgraph gf = {};
1313+
13121314
// for big prompts, if BLAS is enabled, it is better to use only one thread
13131315
// otherwise, the threads are spin-lock waiting for the BLAS calls and are degrading the performance
1314-
ggml_cgraph gf = {};
1315-
const int actual_n_threads = N >= 32 && ggml_cpu_has_blas() && !ggml_cpu_has_gpublas() ? 1 : n_threads;
1316+
n_threads = N >= 32 && ggml_cpu_has_blas() && !ggml_cpu_has_gpublas() ? 1 : n_threads;
13161317

13171318
struct ggml_tensor * cur;
13181319
struct ggml_tensor * inpL;
@@ -1622,7 +1623,7 @@ static bool llama_eval_internal(
16221623
#endif
16231624

16241625
if (call_ggml_graph_compute) {
1625-
ggml_cplan pf = ggml_graph_plan(&gf, actual_n_threads);
1626+
ggml_cplan pf = ggml_graph_plan(&gf, n_threads);
16261627
if (pf.work_size > 0) {
16271628
lctx.work_buffer.resize(pf.work_size);
16281629
pf.work_data = lctx.work_buffer.data();

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ llama_add_test(test-quantize-fns.cpp)
1010
llama_add_test(test-quantize-perf.cpp)
1111
llama_add_test(test-sampling.cpp)
1212
llama_add_test(test-tokenizer-0.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab.bin)
13-
llama_add_test(test-grad0.c) # SLOW
14-
llama_add_test(test-opt.c) # SLOW
13+
# llama_add_test(test-grad0.c) # SLOW
14+
# llama_add_test(test-opt.c) # SLOW

0 commit comments

Comments
 (0)