diff --git a/CLAUDE.md b/CLAUDE.md index 3b1ad31c..ef04c03f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co Java bindings for [llama.cpp](https://github.com/ggerganov/llama.cpp) via JNI, providing a high-level API for LLM inference in Java. The Java layer communicates with a native C++ library through JNI. -Current llama.cpp pinned version: **b10059** +Current llama.cpp pinned version: **b10064** ## Upgrading CUDA Version @@ -421,7 +421,7 @@ needs no extra step here, `build-webui` re-reads the tag and rebuilds the matchi ships no UI): ```bash # needs node/npm + network; embed.cpp is plain C++17 (no npm) -git clone --depth 1 --branch b10059 https://github.com/ggml-org/llama.cpp /tmp/lc +git clone --depth 1 --branch b10064 https://github.com/ggml-org/llama.cpp /tmp/lc ( cd /tmp/lc/tools/ui && npm ci && npm run build \ && ( cd dist && find . -type f -not -path './_gzip/*' \ | while read -r f; do mkdir -p "_gzip/$(dirname "$f")"; gzip -9 -c "$f" > "_gzip/$f"; done ) \ @@ -461,7 +461,7 @@ cache lives in **Depot Cache** over sccache's **WebDAV** backend: - `SCCACHE_WEBDAV_TOKEN: ${{ secrets.DEPOT_TOKEN }}` — a Depot **organization** token, stored as the repo secret **`DEPOT_TOKEN`**. -Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10059`), the +Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10064`), the ~280 upstream object files are byte-identical every run, so a warm cache recompiles only the *changed* files. Depot's cache is **shared across all branches** (unlike GitHub's per-branch `actions/cache`), so every branch builds incrementally; a `b` version bump @@ -1254,7 +1254,7 @@ ctest --test-dir build --output-on-failure -R "ResultsToJson" #### Upstream source location (in CMake build tree) -llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10059`. +llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10064`. **GoogleTest** is a separate `BUILD_TESTING`-only FetchContent (`GIT_TAG v1.17.0`), used solely by the `jllama_test` C++ unit-test binary — not by the shipped library, and not coupled to the diff --git a/README.md b/README.md index e23f63c6..9afeb514 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ **Build:** ![Java 8+](https://img.shields.io/badge/Java-8%2B-informational) ![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows%20%7C%20Android-lightgrey) -[![llama.cpp b10059](https://img.shields.io/badge/llama.cpp-%23b10059-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10059) +[![llama.cpp b10064](https://img.shields.io/badge/llama.cpp-%23b10064-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10064) [![JPMS](https://img.shields.io/badge/JPMS-modular%20JAR-25A162)](https://openjdk.org/projects/jigsaw/) ![JUnit](https://img.shields.io/badge/tested%20with-JUnit6-25A162) [![JSpecify](https://img.shields.io/badge/JSpecify-1.0.0%20%40NullMarked-25A162)](https://jspecify.dev) diff --git a/docs/history/llama-cpp-breaking-changes.md b/docs/history/llama-cpp-breaking-changes.md index 97d046c9..a675b6f3 100644 --- a/docs/history/llama-cpp-breaking-changes.md +++ b/docs/history/llama-cpp-breaking-changes.md @@ -501,3 +501,5 @@ Used during `llama.cpp` version bumps: when upgrading, scan this file from the r | b10034–b10056 | upstream verification (sandbox) | Verified via a fresh `cmake -B build -DBUILD_TESTING=ON` (fail-loud `PATCH_COMMAND` + TTS extraction) on Linux x86_64: all **six** patches (`0001`–`0003`, `0006`–`0008`) apply clean against b10056 (ggml commit `b85833e93`) — `0001`'s `common/arg.{cpp,h}` region untouched upstream; `0002`/`0003`/`0007` anchor onto `tools/server/server-context.{cpp,h}` regions the slot-save/CORS edits do not overlap; `0006`/`0008` targets (`server.cpp`, `server-models.cpp`) unchanged. OuteTTS generator extracted `tts.cpp @ b10056` (all anchors held). Full native build (`cmake --build`, `libjllama.so` + `jllama_test` linked, incl. the changed server TUs) + C++ `ctest` **485/485 green**; per-platform model-backed confirmation by the CI pipeline. | | b10056–b10059 | `ggml/src/{ggml-sycl/dmmv.cpp,ggml-blas/ggml-blas.cpp,ggml-vulkan/ggml-vulkan.cpp,ggml-vulkan/vulkan-shaders/**}` + `tests/test-backend-ops.cpp` | **Additive/bugfix-only, no public-API surface (15 files, ~3 commits).** Every file changed across the whole `b10056...b10059` range is a GPU-backend TU or an upstream test harness. **b10056→b10057** touches only the SYCL dequantize-matrix-vector kernel (`ggml-sycl/dmmv.cpp`): eight `row > nrows` boundary checks corrected to `row >= nrows`, `dequantize_mul_mat_vec_q5_k()` gains a missing `int nrows` parameter with matching launch-config/row-index fixes, and its inner compute is wrapped in a `for (int im = 0; im < 2; ++im)` loop. **b10057→b10059** adds Vulkan **Q2_0** quantization support (`ggml-blas.cpp`; `ggml-vulkan.cpp`; new shader `dequant_q2_0.comp` + `copy_to_quant.comp`/`dequant_funcs*.glsl`/`mul_mat_vecq*`/`mul_mm*_funcs.glsl`/`types.glsl`/`vulkan-shaders-gen.cpp`) plus a matching `tests/test-backend-ops.cpp` case. All of this is inside the SYCL/BLAS/Vulkan backends' upstream-compiled TUs (this project's SYCL/Vulkan classifiers are build-only, no source touched); `test-backend-ops.cpp` is an upstream tool, not compiled/shipped here. All **eight** priority-8 headers (`common/{common.h,chat.h,speculative.h,arg.h,download.h}`, `tools/mtmd/mtmd.h`, `include/{llama.h,llama-cpp.h}`) are **byte-identical**; no `common/arg.*`, `tools/server/*`, or OuteTTS generator anchor (`tools/tts/tts.cpp` unchanged) touched. All **six** patches (`0001`–`0003`, `0006`–`0008`) apply unchanged. b10059 is the topmost release at bump time. | | b10056–b10059 | upstream verification (sandbox) | Verified via a fresh `cmake -B build -DBUILD_TESTING=ON` (fail-loud `PATCH_COMMAND` + TTS extraction) on Linux x86_64: all **six** patches (`0001`–`0003`, `0006`–`0008`) apply clean against b10059 in filename order (`0001`'s `common/arg.*` region untouched upstream; `0002`/`0003`/`0007` anchor onto `tools/server/server-context.{cpp,h}`, unchanged in this range; `0006`/`0008` targets `server.cpp`/`server-models.cpp`, unchanged). OuteTTS generator extracted `tts.cpp @ b10059` (all anchors held). b10059 (llama.cpp commit `11fd0a6fb`) is a 3-commit GPU-backend-only range over b10056; full native build (`cmake --build`, `libjllama.so` + `jllama_test` linked) + C++ `ctest` **485/485 green**; per-platform model-backed confirmation by the CI pipeline. | +| b10059–b10064 | `common/{arg.cpp,download.cpp,download.h}` + `ggml/{CMakeLists.txt,src/ggml-opencl/{ggml-opencl.cpp,kernels/{gemm_noshuffle_q4_k_f32,gemm_noshuffle_q4_k_q8_1_dp4a,gemv_noshuffle_q4_k_f32}.cl}}` + `scripts/sync-ggml.last` + `tests/test-backend-ops.cpp` + `tools/{cli,completion,server}/README.md` | **Additive-only, no public-API break (13 files, ~44 KiB / +143 −51, 5 builds).** The only non-backend, non-doc source change is new speculative-decoding **sidecar download** support: `common/arg.cpp` adds `--dflash` / `--eagle3` download options (`COMMON_SPECULATIVE_TYPE_DRAFT_{DFLASH,EAGLE3}` pushes in `common_params_parser_init`, plus discovery/apply blocks in `common_models_handler_init` / `common_models_handler_apply`) and `common/download.{h,cpp}` adds matching `download_{eagle3,dflash}` opt bools + `hf_file {eagle3,dflash}` plan fields — all **purely additive**, only for the `LLAMA_EXAMPLE_DOWNLOAD` tool (not compiled/shipped here). Of the priority-8 headers only `common/download.h` changed (additive fields); `common/{common.h,chat.h,speculative.h,arg.h}`, `tools/mtmd/mtmd.h`, `include/{llama.h,llama-cpp.h}` are **byte-identical**. The `arg.cpp` edits are all **outside** patch `0001`'s `common_params_parse`/`common_params_parse_main` region. The rest is ggml-OpenCL Q4_K gemm/gemv `noshuffle` kernel tuning + a build-flag/test/README bump — inside upstream-compiled backend TUs (this project's OpenCL classifiers are build-only, no source touched). No `tools/server/*` patch-target region or OuteTTS generator anchor (`tools/tts/tts.cpp` unchanged) touched; all **six** patches (`0001`–`0003`, `0006`–`0008`) apply unchanged. b10064 is the topmost release at bump time. | +| b10059–b10064 | upstream verification (sandbox) | All **six** patches (`0001`–`0003`, `0006`–`0008`) re-verified against a clean b10064 checkout: applied in filename order, all clean (`0001`'s `common/arg.{cpp,h}` region untouched by the additive `--dflash`/`--eagle3` options in `common_params_parser_init`/`common_models_handler_*`; `0006`/`0007` anchor onto `0001`'s post-flip `tools/server/server.cpp`, which upstream left unchanged in this range — `0006`'s standalone `git apply --check` fails only because its context is the post-`0001` tree, as documented). No OuteTTS generator anchor touched (`tools/tts/tts.cpp` unchanged). Per-platform build + `ctest` confirmation by the CI pipeline. | diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index 6f6af682..9377a6d5 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -173,7 +173,7 @@ set(LLAMA_BUILD_APP OFF CACHE BOOL "" FORCE) FetchContent_Declare( llama.cpp GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git - GIT_TAG b10059 + GIT_TAG b10064 PATCH_COMMAND ${CMAKE_COMMAND} -DPATCH_DIR=${CMAKE_CURRENT_SOURCE_DIR}/patches -DLLAMA_SRC= @@ -196,7 +196,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -DTTS_SRC=${llama.cpp_SOURCE_DIR}/tools/tts/tts.cpp -DOUT_CPP=${JLLAMA_TTS_GEN_CPP} - -DLLAMA_TAG=b10059 + -DLLAMA_TAG=b10064 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generate-tts-upstream.cmake RESULT_VARIABLE JLLAMA_TTS_GEN_RESULT ) diff --git a/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java b/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java index ffa7d979..a0d43d26 100644 --- a/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java +++ b/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java @@ -10,13 +10,13 @@ * library was compiled against, exposed as a compile-time constant so callers can render a badge or * emit a startup log line without loading the native library. * - *

{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10059"}) that mirrors the + *

{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10064"}) that mirrors the * {@code GIT_TAG} in {@code llama/CMakeLists.txt}. It is available even when {@code libjllama} is * absent (pure-Java checkout, before {@code System.load}), which is what makes it suitable for a * lightweight version badge in Android or other UIs.

* *

For the authoritative value that is baked into the native binary — the build number - * plus the resolved upstream commit, e.g. {@code "b10059-11fd0a6fb"} — call + * plus the resolved upstream commit, e.g. {@code "b10064-11fd0a6fb"} — call * {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} instead; that reads llama.cpp's own * {@code build-info} through JNI and therefore cannot drift from the compiled library (but requires * the native library to be loaded).

@@ -24,14 +24,14 @@ public final class LlamaCppVersion { /** - * The pinned llama.cpp release tag this library was built against, e.g. {@code "b10059"}. + * The pinned llama.cpp release tag this library was built against, e.g. {@code "b10064"}. * *

Kept in lockstep with {@code GIT_TAG} in {@code llama/CMakeLists.txt} — see the * "Upgrading/Downgrading llama.cpp Version" checklist in {@code CLAUDE.md}. This is the * compile-time pin; use {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} for the * value actually linked into the native binary.

*/ - public static final String LLAMA_CPP_VERSION = "b10059"; + public static final String LLAMA_CPP_VERSION = "b10064"; // Constants holder — not instantiable. private LlamaCppVersion() {}