From 2d2e059f4f83f27e18ffd753d642f53546f32293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Wed, 28 May 2025 09:50:41 +0200 Subject: [PATCH 01/11] make common_download_file_single/multiple public --- common/arg.cpp | 4 ++-- common/arg.h | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/arg.cpp b/common/arg.cpp index 69a58364f9b60..8e40d85bc20ac 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -242,7 +242,7 @@ static bool curl_perform_with_retry(const std::string & url, CURL * curl, int ma } // download one single file from remote URL to local path -static bool common_download_file_single(const std::string & url, const std::string & path, const std::string & bearer_token, bool offline) { +bool common_download_file_single(const std::string & url, const std::string & path, const std::string & bearer_token, bool offline) { // Check if the file already exists locally auto file_exists = std::filesystem::exists(path); @@ -465,7 +465,7 @@ static bool common_download_file_single(const std::string & url, const std::stri // download multiple files from remote URLs to local paths // the input is a vector of pairs -static bool common_download_file_multiple(const std::vector> & urls, const std::string & bearer_token, bool offline) { +bool common_download_file_multiple(const std::vector> & urls, const std::string & bearer_token, bool offline) { // Prepare download in parallel std::vector> futures_download; for (auto const & item : urls) { diff --git a/common/arg.h b/common/arg.h index 70bea100fd4f2..0a7400d0651b2 100644 --- a/common/arg.h +++ b/common/arg.h @@ -87,3 +87,10 @@ struct common_remote_params { }; // get remote file content, returns std::pair> common_remote_get_content(const std::string & url, const common_remote_params & params); + +// download one single file from remote URL to local path +bool common_download_file_single(const std::string & url, const std::string & path, const std::string & bearer_token, bool offline); + +// download multiple files from remote URLs to local paths +// the input is a vector of pairs +bool common_download_file_multiple(const std::vector> & urls, const std::string & bearer_token, bool offline); From 42ff1867bc467554b1757fde1822fcf5dbe441d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Wed, 28 May 2025 09:51:44 +0200 Subject: [PATCH 02/11] add test-tokenizers-remote --- tests/CMakeLists.txt | 4 + tests/test-tokenizers-remote.cpp | 145 +++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 tests/test-tokenizers-remote.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 62a9f5842bca8..2ef36ffaea780 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -98,6 +98,10 @@ llama_test(test-tokenizer-0 NAME test-tokenizer-0-qwen2 ARGS ${CMAKE llama_test(test-tokenizer-0 NAME test-tokenizer-0-refact ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-refact.gguf) llama_test(test-tokenizer-0 NAME test-tokenizer-0-starcoder ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-starcoder.gguf) +if (LLAMA_CURL) + llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +endif() + if (LLAMA_LLGUIDANCE) llama_build_and_test(test-grammar-llguidance.cpp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-llama-bpe.gguf) endif () diff --git a/tests/test-tokenizers-remote.cpp b/tests/test-tokenizers-remote.cpp new file mode 100644 index 0000000000000..5b6a359f3d54e --- /dev/null +++ b/tests/test-tokenizers-remote.cpp @@ -0,0 +1,145 @@ +#include "arg.h" +#include "common.h" + +#include +#include +#include +#include + +using json = nlohmann::json; + +#undef NDEBUG +#include + +std::string endpoint = "https://huggingface.co/"; +std::string repo = "ggml-org/vocabs"; + +static void write_file(const std::string & fname, const std::string & content) { + std::ofstream file(fname); + if (file) { + file << content; + file.close(); + } +} + +static json get_hf_repo_dir(const std::string & hf_repo_with_branch, bool recursive, const std::string & repo_path, const std::string & bearer_token) { + auto parts = string_split(hf_repo_with_branch, ':'); + std::string branch = parts.size() > 1 ? parts.back() : "main"; + std::string hf_repo = parts[0]; + std::string url = endpoint + "api/models/" + hf_repo + "/tree/" + branch; + std::string path = repo_path; + + if (!path.empty()) { + // FIXME: path should be properly url-encoded! + string_replace_all(path, "/", "%2F"); + url += "/" + path; + } + + if (recursive) { + url += "?recursive=true"; + } + + // headers + std::vector headers; + headers.push_back("Accept: application/json"); + if (!bearer_token.empty()) { + headers.push_back("Authorization: Bearer " + bearer_token); + } + + // we use "=" to avoid clashing with other component, while still being allowed on windows + std::string cached_response_fname = "tree=" + hf_repo + "/" + repo_path + "=" + branch + ".json"; + string_replace_all(cached_response_fname, "/", "_"); + std::string cached_response_path = fs_get_cache_file(cached_response_fname); + + // make the request + common_remote_params params; + params.headers = headers; + json res_data; + try { + // TODO: For pagination links we need response headers, which is not provided by common_remote_get_content() + auto res = common_remote_get_content(url, params); + long res_code = res.first; + std::string res_str = std::string(res.second.data(), res.second.size()); + + if (res_code == 200) { + write_file(cached_response_path, res_str); + } else if (res_code == 401) { + throw std::runtime_error("error: model is private or does not exist; if you are accessing a gated model, please provide a valid HF token"); + } else { + throw std::runtime_error(string_format("error from HF API, response code: %ld, data: %s", res_code, res_str.c_str())); + } + } catch (const std::exception & e) { + fprintf(stderr, "error: failed to get repo tree: %s\n", e.what()); + fprintf(stderr, "try reading from cache\n"); + } + + // try to read from cache + try { + std::ifstream f(cached_response_path); + res_data = json::parse(f); + } catch (const std::exception & e) { + fprintf(stderr, "error: failed to get repo tree (check your internet connection)\n"); + } + + return res_data; +} + +int main(void) { + if (common_has_curl()) { + json tree = get_hf_repo_dir(repo, true, {}, {}); + + if (!tree.empty()) { + std::vector> files; + + for (const auto & item : tree) { + if (item.at("type") == "file") { + std::string path = item.at("path"); + + if (string_ends_with(path, ".gguf") || string_ends_with(path, ".gguf.inp") || string_ends_with(path, ".gguf.out")) { + // this is to avoid different repo having same file name, or same file name in different subdirs + std::string filepath = repo + "_" + path; + // to make sure we don't have any slashes in the filename + string_replace_all(filepath, "/", "_"); + // to make sure we don't have any quotes in the filename + string_replace_all(filepath, "'", "_"); + filepath = fs_get_cache_file(filepath); + + files.push_back({endpoint + repo + "/resolve/main/" + path, filepath}); + } + } + } + + if (common_download_file_multiple(files, {}, false)) { + std::string dir_sep(1, DIRECTORY_SEPARATOR); + + for (auto const & item : files) { + std::string filepath = item.second; + + if (string_ends_with(filepath, ".gguf")) { + std::string vocab_inp = filepath + ".inp"; + std::string vocab_out = filepath + ".out"; + auto matching_inp = std::find_if(files.begin(), files.end(), [&vocab_inp](const auto & p) { + return p.second == vocab_inp; + }); + auto matching_out = std::find_if(files.begin(), files.end(), [&vocab_out](const auto & p) { + return p.second == vocab_out; + }); + + if (matching_inp != files.end() && matching_out != files.end()) { + std::string test_command = "." + dir_sep + "test-tokenizer-0 '" + filepath + "'"; + assert(std::system(test_command.c_str()) == 0); + } else { + printf("test-tokenizers-remote: %s found without .inp/out vocab files, skipping...\n", filepath.c_str()); + } + } + } + } else { + printf("test-tokenizers-remote: failed to download files, unable to perform tests...\n"); + } + } else { + printf("test-tokenizers-remote: failed to retrieve repository info, unable to perform tests...\n"); + } + } else { + printf("test-tokenizers-remote: no curl, unable to perform tests...\n"); + } +} From ecbc92acd009ed776303209290a4f8f4f8d854bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Wed, 28 May 2025 10:16:34 +0200 Subject: [PATCH 03/11] correct working directory --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2ef36ffaea780..669f9fc7601bd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -99,7 +99,7 @@ llama_test(test-tokenizer-0 NAME test-tokenizer-0-refact ARGS ${CMAKE llama_test(test-tokenizer-0 NAME test-tokenizer-0-starcoder ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-starcoder.gguf) if (LLAMA_CURL) - llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin) endif() if (LLAMA_LLGUIDANCE) From 0fe7183ae4e5284654163ae27c56b2aca67fc2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Wed, 28 May 2025 11:11:02 +0200 Subject: [PATCH 04/11] fix prototype for non-curl builds --- common/arg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/arg.cpp b/common/arg.cpp index 8e40d85bc20ac..8371774f482ad 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -709,12 +709,12 @@ bool common_has_curl() { return false; } -static bool common_download_file_single(const std::string &, const std::string &, const std::string &, bool) { +bool common_download_file_single(const std::string &, const std::string &, const std::string &, bool) { LOG_ERR("error: built without CURL, cannot download model from internet\n"); return false; } -static bool common_download_file_multiple(const std::vector> &, const std::string &, bool) { +bool common_download_file_multiple(const std::vector> &, const std::string &, bool) { LOG_ERR("error: built without CURL, cannot download model from the internet\n"); return false; } From d97b9ade5118bb3ee4f5115a1eec4714358d8566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Wed, 28 May 2025 12:49:36 +0200 Subject: [PATCH 05/11] correct working directory for all builds ..and change cache file name as per suggestion. --- tests/CMakeLists.txt | 2 +- tests/test-tokenizers-remote.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 669f9fc7601bd..1b24829d9a6ca 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -99,7 +99,7 @@ llama_test(test-tokenizer-0 NAME test-tokenizer-0-refact ARGS ${CMAKE llama_test(test-tokenizer-0 NAME test-tokenizer-0-starcoder ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-starcoder.gguf) if (LLAMA_CURL) - llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif() if (LLAMA_LLGUIDANCE) diff --git a/tests/test-tokenizers-remote.cpp b/tests/test-tokenizers-remote.cpp index 5b6a359f3d54e..a6e2ecdd0264b 100644 --- a/tests/test-tokenizers-remote.cpp +++ b/tests/test-tokenizers-remote.cpp @@ -47,7 +47,7 @@ static json get_hf_repo_dir(const std::string & hf_repo_with_branch, bool recurs } // we use "=" to avoid clashing with other component, while still being allowed on windows - std::string cached_response_fname = "tree=" + hf_repo + "/" + repo_path + "=" + branch + ".json"; + std::string cached_response_fname = "test_vocab=" + hf_repo + "/" + repo_path + "=" + branch + ".json"; string_replace_all(cached_response_fname, "/", "_"); std::string cached_response_path = fs_get_cache_file(cached_response_fname); From 4b4843adf3a68cabc7b1378b2434799febc3c040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 30 May 2025 11:51:46 +0200 Subject: [PATCH 06/11] windows builds adds build type to runtime output --- tests/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1b24829d9a6ca..7071feef98b4c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -99,7 +99,11 @@ llama_test(test-tokenizer-0 NAME test-tokenizer-0-refact ARGS ${CMAKE llama_test(test-tokenizer-0 NAME test-tokenizer-0-starcoder ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-starcoder.gguf) if (LLAMA_CURL) - llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + IF (WIN32) + llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) + else() + llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + endif() endif() if (LLAMA_LLGUIDANCE) From 8e1125a8dbd195a61141896be87106a6d0dfbf22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sat, 31 May 2025 21:22:37 +0200 Subject: [PATCH 07/11] copy curl dll for tests --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee76d1799e6f4..b42cdebbc26d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -788,7 +788,10 @@ jobs: - name: Test id: cmake_test if: ${{ matrix.build != 'llvm-arm64' && matrix.build != 'llvm-arm64-opencl-adreno' }} + env: + CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} run: | + Copy-Item $env:CURL_PATH\bin\libcurl-${{ matrix.arch }}.dll .\build\bin\Release\ cd build ctest -L main -C Release --verbose --timeout 900 From f9a27178e538cbd02bc1e321dd49edc0e903bcfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sat, 31 May 2025 22:35:26 +0200 Subject: [PATCH 08/11] download in batches --- tests/test-tokenizers-remote.cpp | 67 ++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/tests/test-tokenizers-remote.cpp b/tests/test-tokenizers-remote.cpp index a6e2ecdd0264b..1ad11d418dc0c 100644 --- a/tests/test-tokenizers-remote.cpp +++ b/tests/test-tokenizers-remote.cpp @@ -4,7 +4,8 @@ #include #include #include -#include + +#include using json = nlohmann::json; @@ -109,32 +110,50 @@ int main(void) { } } - if (common_download_file_multiple(files, {}, false)) { - std::string dir_sep(1, DIRECTORY_SEPARATOR); - - for (auto const & item : files) { - std::string filepath = item.second; - - if (string_ends_with(filepath, ".gguf")) { - std::string vocab_inp = filepath + ".inp"; - std::string vocab_out = filepath + ".out"; - auto matching_inp = std::find_if(files.begin(), files.end(), [&vocab_inp](const auto & p) { - return p.second == vocab_inp; - }); - auto matching_out = std::find_if(files.begin(), files.end(), [&vocab_out](const auto & p) { - return p.second == vocab_out; - }); - - if (matching_inp != files.end() && matching_out != files.end()) { - std::string test_command = "." + dir_sep + "test-tokenizer-0 '" + filepath + "'"; - assert(std::system(test_command.c_str()) == 0); - } else { - printf("test-tokenizers-remote: %s found without .inp/out vocab files, skipping...\n", filepath.c_str()); + if (!files.empty()) { + bool downloaded = false; + const size_t batch_size = 6; + size_t batches = (files.size() + batch_size - 1) / batch_size; + + for (size_t i = 0; i < batches; i++) { + size_t batch_pos = (i * batch_size); + size_t batch_step = batch_pos + batch_size; + auto batch_begin = files.begin() + batch_pos; + auto batch_end = batch_step >= files.size() ? files.end() : files.begin() + batch_step; + std::vector> batch(batch_begin, batch_end); + + if (!(downloaded = common_download_file_multiple(batch, {}, false))) { + break; + } + } + + if (downloaded) { + std::string dir_sep(1, DIRECTORY_SEPARATOR); + + for (auto const & item : files) { + std::string filepath = item.second; + + if (string_ends_with(filepath, ".gguf")) { + std::string vocab_inp = filepath + ".inp"; + std::string vocab_out = filepath + ".out"; + auto matching_inp = std::find_if(files.begin(), files.end(), [&vocab_inp](const auto & p) { + return p.second == vocab_inp; + }); + auto matching_out = std::find_if(files.begin(), files.end(), [&vocab_out](const auto & p) { + return p.second == vocab_out; + }); + + if (matching_inp != files.end() && matching_out != files.end()) { + std::string test_command = "." + dir_sep + "test-tokenizer-0 '" + filepath + "'"; + assert(std::system(test_command.c_str()) == 0); + } else { + printf("test-tokenizers-remote: %s found without .inp/out vocab files, skipping...\n", filepath.c_str()); + } } } + } else { + printf("test-tokenizers-remote: failed to download files, unable to perform tests...\n"); } - } else { - printf("test-tokenizers-remote: failed to download files, unable to perform tests...\n"); } } else { printf("test-tokenizers-remote: failed to retrieve repository info, unable to perform tests...\n"); From 05f94a0e905fbabfa2eb177992b89e771dd0f1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sat, 31 May 2025 22:54:37 +0200 Subject: [PATCH 09/11] add arch to matrix --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b42cdebbc26d2..85225c11c11b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -688,14 +688,19 @@ jobs: matrix: include: - build: 'cpu-x64' + arch: 'x64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF' - build: 'openblas-x64' + arch: 'x64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"' - build: 'vulkan-x64' + arch: 'x64' defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON' - build: 'llvm-arm64' + arch: 'arm64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON' - build: 'llvm-arm64-opencl-adreno' + arch: 'arm64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON' # - build: 'kompute-x64' # defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON' From 7210ebe2301a5acc1f75900f87653c167ef82ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sat, 31 May 2025 23:16:56 +0200 Subject: [PATCH 10/11] revert build changes --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85225c11c11b4..ee76d1799e6f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -688,19 +688,14 @@ jobs: matrix: include: - build: 'cpu-x64' - arch: 'x64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF' - build: 'openblas-x64' - arch: 'x64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"' - build: 'vulkan-x64' - arch: 'x64' defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON' - build: 'llvm-arm64' - arch: 'arm64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON' - build: 'llvm-arm64-opencl-adreno' - arch: 'arm64' defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON' # - build: 'kompute-x64' # defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON' @@ -793,10 +788,7 @@ jobs: - name: Test id: cmake_test if: ${{ matrix.build != 'llvm-arm64' && matrix.build != 'llvm-arm64-opencl-adreno' }} - env: - CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} run: | - Copy-Item $env:CURL_PATH\bin\libcurl-${{ matrix.arch }}.dll .\build\bin\Release\ cd build ctest -L main -C Release --verbose --timeout 900 From d3a2eb592dea2e8d1c216fb0c53c289155e87522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sat, 31 May 2025 23:17:18 +0200 Subject: [PATCH 11/11] disable on windows --- tests/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c22cdeb2093e1..432058f9a11e1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -97,12 +97,8 @@ llama_test(test-tokenizer-0 NAME test-tokenizer-0-qwen2 ARGS ${CMAKE llama_test(test-tokenizer-0 NAME test-tokenizer-0-refact ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-refact.gguf) llama_test(test-tokenizer-0 NAME test-tokenizer-0-starcoder ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-starcoder.gguf) -if (LLAMA_CURL) - IF (WIN32) - llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) - else() - llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - endif() +if (LLAMA_CURL AND NOT WIN32) + llama_build_and_test(test-tokenizers-remote.cpp WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif() if (LLAMA_LLGUIDANCE)