Skip to content

Commit 537d0d4

Browse files
committed
ci : try to add memory leaks check
ggml-ci
1 parent 83c891e commit 537d0d4

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

ci/run.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ function gg_run_ctest_with_model_debug {
270270
local model; model=$(gg_get_model)
271271
cd build-ci-debug
272272
set -e
273+
273274
(LLAMACPP_TEST_MODELFILE="$model" time ctest --output-on-failure -L model) 2>&1 | tee -a $OUT/${ci}-ctest.log
275+
274276
set +e
275277
cd ..
276278
}
@@ -281,7 +283,15 @@ function gg_run_ctest_with_model_release {
281283
local model; model=$(gg_get_model)
282284
cd build-ci-release
283285
set -e
286+
284287
(LLAMACPP_TEST_MODELFILE="$model" time ctest --output-on-failure -L model) 2>&1 | tee -a $OUT/${ci}-ctest.log
288+
289+
# test memory leaks
290+
#if [[ ! -z ${GG_BUILD_METAL} ]]; then
291+
# # TODO: this hangs for some reason ...
292+
# (time leaks -quiet -atExit -- ./bin/test-thread-safety -m $model --parallel 2 -t 2 -p "hello") 2>&1 | tee -a $OUT/${ci}-leaks.log
293+
#fi
294+
285295
set +e
286296
cd ..
287297
}
@@ -860,20 +870,15 @@ if [ -z ${GG_BUILD_LOW_PERF} ]; then
860870
fi
861871

862872
ret=0
863-
if [ -z ${GG_BUILD_SYCL} ]; then
864-
# SYCL build breaks with debug build flags
865-
test $ret -eq 0 && gg_run ctest_debug
866-
fi
873+
test $ret -eq 0 && gg_run ctest_debug
867874
test $ret -eq 0 && gg_run ctest_release
868875

869876
if [ -z ${GG_BUILD_LOW_PERF} ]; then
870877
test $ret -eq 0 && gg_run embd_bge_small
871878
test $ret -eq 0 && gg_run rerank_tiny
872879

873880
if [ -z ${GG_BUILD_CLOUD} ] || [ ${GG_BUILD_EXTRA_TESTS_0} ]; then
874-
if [ -z ${GG_BUILD_SYCL} ]; then
875-
test $ret -eq 0 && gg_run test_scripts_debug
876-
fi
881+
test $ret -eq 0 && gg_run test_scripts_debug
877882
test $ret -eq 0 && gg_run test_scripts_release
878883
fi
879884

@@ -884,9 +889,7 @@ if [ -z ${GG_BUILD_LOW_PERF} ]; then
884889
test $ret -eq 0 && gg_run pythia_2_8b
885890
#test $ret -eq 0 && gg_run open_llama_7b_v2
886891
fi
887-
if [ -z ${GG_BUILD_SYCL} ]; then
888-
test $ret -eq 0 && gg_run ctest_with_model_debug
889-
fi
892+
test $ret -eq 0 && gg_run ctest_with_model_debug
890893
test $ret -eq 0 && gg_run ctest_with_model_release
891894
fi
892895
fi

ggml/src/ggml-metal/ggml-metal.m

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,8 +1682,6 @@ @implementation GGMLMetalClass
16821682
char name[256];
16831683

16841684
@autoreleasepool {
1685-
MTLFunctionConstantValues * cv = [[MTLFunctionConstantValues alloc] init];
1686-
16871685
const char * op_str = "undefined";
16881686
switch (op) {
16891687
case GGML_OP_ADD: op_str = "add"; break;
@@ -1707,9 +1705,7 @@ @implementation GGMLMetalClass
17071705
return res;
17081706
}
17091707

1710-
cv = [[MTLFunctionConstantValues alloc] init];
1711-
1712-
return ggml_metal_compile_kernel(backend, base, name, cv);
1708+
return ggml_metal_compile_kernel(backend, base, name, nil);
17131709
}
17141710
}
17151711

@@ -1722,8 +1718,6 @@ @implementation GGMLMetalClass
17221718
char name[256];
17231719

17241720
@autoreleasepool {
1725-
MTLFunctionConstantValues * cv = [[MTLFunctionConstantValues alloc] init];
1726-
17271721
switch (n_fuse) {
17281722
case 1: snprintf(base, 256, "kernel_rms_norm"); break;
17291723
case 2: snprintf(base, 256, "kernel_rms_norm_mul"); break;
@@ -1739,9 +1733,7 @@ @implementation GGMLMetalClass
17391733
return res;
17401734
}
17411735

1742-
cv = [[MTLFunctionConstantValues alloc] init];
1743-
1744-
return ggml_metal_compile_kernel(backend, base, name, cv);
1736+
return ggml_metal_compile_kernel(backend, base, name, nil);
17451737
}
17461738

17471739
GGML_UNUSED(op);

0 commit comments

Comments
 (0)