From 2fd29e2235376162ba15fb690b780bf2cf36e6f3 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 1 Sep 2026 22:59:29 +0300 Subject: [PATCH] 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 --- ci/run.sh | 29 +++++++++++++++++++++++++++++ tests/CMakeLists.txt | 7 ------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ci/run.sh b/ci/run.sh index 3909283d12..0851e20aab 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -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 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 905833ffa1..531a690cb5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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)