tests : run fusion test from ci instead of ctest

The fusion test needs Metal and generates a lot of dummy models, so it
does not belong in the generic ctest suite. Move it to ci/run.sh as
gg_run_test_fusion, gated on GG_BUILD_METAL like
gg_run_test_llama_archs_tensor_split: it generates the dummy models with
test-llama-archs -o and then validates the fusion counts against the
committed baseline. test-fusion.cpp is still built (llama_build) but no
longer registered as a ctest.

Assisted-by: pi:llama.cpp/DeepSeek-V4-Flash-0731
This commit is contained in:
Georgi Gerganov
2026-09-03 17:19:49 +03:00
parent 4af6790656
commit 2fd29e2235
2 changed files with 29 additions and 7 deletions
+29
View File
@@ -334,6 +334,34 @@ function gg_sum_test_llama_archs_tensor_split {
gg_printf '```\n'
}
# test_fusion
function gg_run_test_fusion {
cd ${SRC}
set -e
if [ ! -z ${GG_BUILD_METAL} ]; then
rm -rf build-ci-fusion-models && mkdir -p build-ci-fusion-models
# generate the dummy models and run the fusion regression test
./build-ci-release/bin/test-llama-archs -o build-ci-fusion-models 2>&1
./build-ci-release/bin/test-fusion --models build-ci-fusion-models --device MTL0 --check tests/fusion/MTL.tsv 2>&1
fi
set +e
}
function gg_sum_test_fusion {
gg_printf '### %s\n\n' "${ci}"
gg_printf 'Runs test-fusion against the Metal baseline\n'
gg_printf '- status: %s\n' "$(cat $OUT/${ci}.exit)"
gg_printf '```\n'
gg_printf '%s\n' "$(cat $OUT/${ci}.log)"
gg_printf '```\n'
}
# test_scripts
function gg_run_test_scripts {
@@ -791,6 +819,7 @@ test $ret -eq 0 && gg_run ctest_debug
test $ret -eq 0 && gg_run ctest_release
test $ret -eq 0 && gg_run test_llama_archs_tensor_split
test $ret -eq 0 && gg_run test_fusion
if [ ! -z ${GG_BUILD_HIGH_PERF} ]; then
test $ret -eq 0 && gg_run test_backend_ops_cpu
-7
View File
@@ -247,14 +247,7 @@ if (NOT WIN32 OR NOT BUILD_SHARED_LIBS)
)
set_tests_properties(test-save-load-state PROPERTIES FIXTURES_REQUIRED generate-models)
# Test Metal fusion against a per-device baseline, using the generated dummy models
llama_build(test-fusion.cpp)
llama_test(
test-fusion
LABEL main
ARGS --models "${MODEL_DIR}" --device MTL0 --check "${PROJECT_SOURCE_DIR}/tests/fusion/MTL.tsv"
)
set_tests_properties(test-fusion PROPERTIES FIXTURES_REQUIRED generate-models)
endif()
llama_build_and_test(test-chat-peg-parser.cpp peg-parser/simple-tokenize.cpp)