2023-08-21 22:07:43 +02:00
|
|
|
function(llama_build_executable source)
|
2023-03-22 18:29:06 +01:00
|
|
|
get_filename_component(TEST_TARGET ${source} NAME_WE)
|
2024-01-26 13:18:00 +01:00
|
|
|
add_executable(${TEST_TARGET} ${source} get-model.cpp)
|
2023-07-19 09:01:11 +02:00
|
|
|
install(TARGETS ${TEST_TARGET} RUNTIME)
|
2023-12-29 15:39:15 +01:00
|
|
|
target_link_libraries(${TEST_TARGET} PRIVATE common)
|
2023-08-21 22:07:43 +02:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(llama_test_executable name source)
|
|
|
|
get_filename_component(TEST_TARGET ${source} NAME_WE)
|
|
|
|
add_test(NAME ${name} COMMAND $<TARGET_FILE:${TEST_TARGET}> ${ARGN})
|
2024-01-26 13:18:00 +01:00
|
|
|
set_property(TEST ${name} PROPERTY LABELS "main")
|
2023-08-21 22:07:43 +02:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(llama_build_and_test_executable source)
|
2024-01-26 13:18:00 +01:00
|
|
|
llama_build_and_test_executable_with_label(${source} "main")
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(llama_build_and_test_executable_with_label source label)
|
2023-08-21 22:07:43 +02:00
|
|
|
get_filename_component(TEST_TARGET ${source} NAME_WE)
|
2024-01-26 13:18:00 +01:00
|
|
|
add_executable(${TEST_TARGET} ${source} get-model.cpp)
|
2023-08-21 22:07:43 +02:00
|
|
|
install(TARGETS ${TEST_TARGET} RUNTIME)
|
2023-12-29 15:39:15 +01:00
|
|
|
target_link_libraries(${TEST_TARGET} PRIVATE common)
|
2023-03-22 18:29:06 +01:00
|
|
|
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}> ${ARGN})
|
2024-01-26 13:18:00 +01:00
|
|
|
set_property(TEST ${TEST_TARGET} PROPERTY LABELS ${label})
|
2023-03-22 18:29:06 +01:00
|
|
|
endfunction()
|
|
|
|
|
2023-08-21 22:07:43 +02:00
|
|
|
# llama_build_and_test_executable(test-double-float.cpp) # SLOW
|
|
|
|
llama_build_and_test_executable(test-quantize-fns.cpp)
|
|
|
|
llama_build_and_test_executable(test-quantize-perf.cpp)
|
|
|
|
llama_build_and_test_executable(test-sampling.cpp)
|
2024-02-19 09:23:37 +01:00
|
|
|
llama_build_and_test_executable(test-chat-template.cpp)
|
2023-12-07 21:26:54 +01:00
|
|
|
|
2023-08-27 13:19:19 +02:00
|
|
|
llama_build_executable(test-tokenizer-0-llama.cpp)
|
|
|
|
llama_test_executable (test-tokenizer-0-llama test-tokenizer-0-llama.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-llama.gguf)
|
2023-12-07 21:26:54 +01:00
|
|
|
|
2023-08-27 13:19:19 +02:00
|
|
|
llama_build_executable(test-tokenizer-0-falcon.cpp)
|
2023-10-03 09:16:26 +02:00
|
|
|
llama_test_executable (test-tokenizer-0-falcon test-tokenizer-0-falcon.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-falcon.gguf)
|
2023-12-07 21:26:54 +01:00
|
|
|
|
2023-09-13 15:19:44 +02:00
|
|
|
llama_build_executable(test-tokenizer-1-llama.cpp)
|
2023-12-07 21:26:54 +01:00
|
|
|
llama_test_executable (test-tokenizer-1-llama test-tokenizer-1-llama.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-llama.gguf)
|
|
|
|
llama_test_executable (test-tokenizer-1-baichuan test-tokenizer-1-llama.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-baichuan.gguf)
|
|
|
|
|
2023-10-03 09:16:26 +02:00
|
|
|
llama_build_executable(test-tokenizer-1-bpe.cpp)
|
2023-12-07 21:26:54 +01:00
|
|
|
llama_test_executable (test-tokenizer-1-falcon test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-falcon.gguf)
|
|
|
|
llama_test_executable (test-tokenizer-1-aquila test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-aquila.gguf)
|
|
|
|
llama_test_executable (test-tokenizer-1-mpt test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-mpt.gguf)
|
|
|
|
llama_test_executable (test-tokenizer-1-stablelm-3b-4e1t test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-stablelm-3b-4e1t.gguf)
|
|
|
|
llama_test_executable (test-tokenizer-1-gpt-neox test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-gpt-neox.gguf)
|
|
|
|
llama_test_executable (test-tokenizer-1-refact test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-refact.gguf)
|
|
|
|
llama_test_executable (test-tokenizer-1-starcoder test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-starcoder.gguf)
|
2023-12-28 15:03:57 +01:00
|
|
|
llama_test_executable (test-tokenizer-1-gpt2 test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-gpt2.gguf)
|
2023-12-07 21:26:54 +01:00
|
|
|
# llama_test_executable (test-tokenizer-1-bloom test-tokenizer-1-bpe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-bloom.gguf) # BIG
|
|
|
|
|
2023-08-21 22:07:43 +02:00
|
|
|
llama_build_and_test_executable(test-grammar-parser.cpp)
|
|
|
|
llama_build_and_test_executable(test-llama-grammar.cpp)
|
2023-12-07 21:26:54 +01:00
|
|
|
llama_build_and_test_executable(test-grad0.cpp)
|
2023-08-21 22:07:43 +02:00
|
|
|
# llama_build_and_test_executable(test-opt.cpp) # SLOW
|
2023-12-07 21:26:54 +01:00
|
|
|
llama_build_and_test_executable(test-backend-ops.cpp)
|
2023-08-30 08:20:26 +02:00
|
|
|
|
2023-09-28 18:04:36 +02:00
|
|
|
llama_build_and_test_executable(test-rope.cpp)
|
|
|
|
|
2024-01-26 13:18:00 +01:00
|
|
|
llama_build_and_test_executable_with_label(test-model-load-cancel.cpp "model")
|
|
|
|
llama_build_and_test_executable_with_label(test-autorelease.cpp "model")
|
|
|
|
|
2023-08-30 08:20:26 +02:00
|
|
|
# dummy executable - not installed
|
|
|
|
get_filename_component(TEST_TARGET test-c.c NAME_WE)
|
|
|
|
add_executable(${TEST_TARGET} test-c.c)
|
|
|
|
target_link_libraries(${TEST_TARGET} PRIVATE llama)
|