llama_build_and_test(test-grammar-llguidance.cpp ARGS ${PROJECT_SOURCE_DIR}/models/ggml-vocab-llama-bpe.gguf)
endif ()
+llama_build(test-recurrent-state-rollback.cpp get-model.cpp)
+
if (NOT WIN32 OR NOT BUILD_SHARED_LIBS)
# these tests are disabled on Windows because they use internal functions not exported with LLAMA_API (when building with shared libraries)
llama_build_and_test(test-sampling.cpp)
# llama_build_and_test(test-double-float.cpp) # SLOW
llama_build_and_test(test-llama-archs.cpp)
+
+ set(MODEL_DIR "${CMAKE_CURRENT_BINARY_DIR}/test-models/")
+ file(MAKE_DIRECTORY "${MODEL_DIR}")
+
+ llama_test(
+ test-llama-archs
+ NAME test-generate-models
+ LABEL main
+ ARGS -o "${MODEL_DIR}"
+ )
+ set_tests_properties(test-generate-models PROPERTIES
+ FIXTURES_SETUP generate-models
+ )
+
+ llama_test(
+ test-recurrent-state-rollback
+ LABEL main
+ ARGS -m "${MODEL_DIR}/qwen35-dense.gguf"
+ )
+ set_tests_properties(test-recurrent-state-rollback PROPERTIES
+ FIXTURES_REQUIRED generate-models
+ )
endif()
llama_build_and_test(test-chat-peg-parser.cpp peg-parser/simple-tokenize.cpp)
llama_build_and_test(test-state-restore-fragmented.cpp LABEL "model" ARGS -m "${MODEL_DEST}")
set_tests_properties(test-state-restore-fragmented PROPERTIES FIXTURES_REQUIRED test-download-model)
-llama_build_and_test(test-recurrent-state-rollback.cpp LABEL "model" ARGS -m "${MODEL_DEST}")
-set_tests_properties(test-recurrent-state-rollback PROPERTIES FIXTURES_REQUIRED test-download-model)
-
# Test state save/load functionality
llama_build_and_test(test-save-load-state.cpp LABEL "model" ARGS -m "${MODEL_DEST}")
set_tests_properties(test-save-load-state PROPERTIES FIXTURES_REQUIRED test-download-model)
if (!moe && moe_mandatory(arch)) {
continue;
}
- if (!llama_model_saver_supports_arch(arch)) {
+ if (!llama_model_saver_supports_arch(arch) || !arch_supported(arch)) {
LOG_INF("%s: %s model (%s) is unsupported, skipping\n", __func__, llm_arch_name(arch), moe ? "MoE" : "dense");
continue;
}
static bool decode_tokens(llama_context * ctx, const std::vector<llama_token> & tokens, uint32_t count) {
llama_batch batch = llama_batch_init(count, 0, 1);
for (uint32_t pos = 0; pos < count; ++pos) {
- common_batch_add(batch, tokens[pos], pos, { 0 }, false);
+ common_batch_add(batch, tokens[pos], pos, { 0 }, pos + 1 == count);
}
const bool ok = llama_decode(ctx, batch) == 0;
llama_batch_free(batch);
return 0;
}
- std::vector<llama_token> tokens = common_tokenize(ctx_src, "The quick brown fox jumps", true);
+ std::vector<llama_token> tokens;
+ if (llama_vocab_type(vocab) == LLAMA_VOCAB_TYPE_NONE) {
+ tokens = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ } else {
+ tokens = common_tokenize(ctx_src, "The quick brown fox jumps", true);
+ }
const uint32_t n_rs_seq = llama_n_rs_seq(ctx_src);
if (tokens.size() > n_rs_seq + 1) {
tokens.resize(n_rs_seq + 1);