diff --git a/CLAUDE.md b/CLAUDE.md index 4210cab34..fc3f4f635 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: **b10069** +Current llama.cpp pinned version: **b10076** ## 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 b10069 https://github.com/ggml-org/llama.cpp /tmp/lc +git clone --depth 1 --branch b10076 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 b10069`), the +Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10076`), 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 b10069`. +llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10076`. **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 8c1f54d57..ca70ee52b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,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 b10069](https://img.shields.io/badge/llama.cpp-%23b10069-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10069) +[![llama.cpp b10076](https://img.shields.io/badge/llama.cpp-%23b10076-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10076) [![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 1a556dcec..b9d7da4e2 100644 --- a/docs/history/llama-cpp-breaking-changes.md +++ b/docs/history/llama-cpp-breaking-changes.md @@ -505,3 +505,7 @@ Used during `llama.cpp` version bumps: when upgrading, scan this file from the r | 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. | | b10064–b10069 | `ggml/src/ggml-opencl/{ggml-opencl.cpp,kernels/gemm_moe_{mxfp4_q8_1_dp4a,q4_0_q8_1_dp4a,q4_k_q8_1_dp4a,q6_k_q8_1_dp4a,q8_1_dp4a}.cl}` + `src/{llama-quant.cpp,models/dflash.cpp}` | **Additive/tuning-only, no public-API surface (8 files, 5 commits).** Every changed file is a ggml-OpenCL backend TU or an internal `llama`-lib source, none a patch target or OuteTTS anchor. The OpenCL work is MoE dp4a activation-tile tuning (128-bit local-memory loads across five `gemm_moe_*_dp4a.cl` kernels) plus Adreno `MUL_MAT` broadcast + `view_offs` handling and a `kernel_gemm_moe_q6_k_f32_ns` binary-kernel load in `ggml-opencl.cpp` — inside upstream-compiled backend TUs (this project's OpenCL classifiers are build-only, no source touched). `src/llama-quant.cpp` excludes the i32 `ffn_gate_tid2eid` routing table from quantization and `src/models/dflash.cpp` rotates the injected DFlash K/V cache — both internal to the upstream-compiled `llama` lib. 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 `tools/tts/tts.cpp` touched. All **six** patches (`0001`–`0003`, `0006`–`0008`) apply unchanged. b10069 is the topmost release at bump time. | | b10064–b10069 | upstream verification (sandbox) | All **six** patches (`0001`–`0003`, `0006`–`0008`) re-verified against a clean b10069 checkout via the fail-loud `PATCH_COMMAND` (fresh `cmake -B build`): applied in filename order, all clean — the `b10064...b10069` diff touches only ggml-OpenCL kernels + `src/{llama-quant.cpp,models/dflash.cpp}`, none overlapping `0001`'s `common/arg.{cpp,h}` region, the `tools/server/*` targets of `0002`/`0003`/`0006`/`0007`/`0008`, or the OuteTTS generator anchors (`tools/tts/tts.cpp` unchanged). Per-platform build + `ctest` confirmation by the CI pipeline. | +| b10069–b10075 | `ggml/src/ggml-hexagon/{ggml-hexagon.cpp,htp/{htp-ops.h,main.c,unary-ops.c}}` + `src/llama-kv-cache-dsv4.cpp` + `tools/ui/**` | **Additive/internal-only, no public-API surface (15 files, 6 commits).** The changed files are the Qualcomm Hexagon DSP backend (adds a `GGML_OP_CLAMP` → `HTP_OP_CLAMP` mapping + a tiled/non-tiled `clamp_f32()` — not built by this project; Hexagon is not in the classifier matrix), the internal DSV4 KV-cache serializer (`src/llama-kv-cache-dsv4.cpp` bumps `DSV4_K_CACHE_STATE_VER` 1→2 and tracks used K rows separately from storage size, with v1 back-compat — inside the upstream-compiled `llama` lib, no signature change), and the Svelte WebUI (`tools/ui/**`: bulk-select/rename dialogs, `@lucide/svelte` 0.515→1.25, radio-group settings — rebuilt from the pinned `GIT_TAG` by the `build-webui` CI job, no C++ surface). 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 `tools/tts/tts.cpp` touched. All **six** patches (`0001`–`0003`, `0006`–`0008`) apply unchanged. b10075 is the topmost release at bump time. | +| b10069–b10075 | upstream verification (sandbox) | The `b10069...b10075` diff touches only the Hexagon backend, `src/llama-kv-cache-dsv4.cpp`, and `tools/ui/**` — none overlapping `0001`'s `common/arg.{cpp,h}` region, the `tools/server/*` targets of `0002`/`0003`/`0006`/`0007`/`0008`, or the OuteTTS generator anchors (`tools/tts/tts.cpp` unchanged), so all **six** patches (`0001`–`0003`, `0006`–`0008`) apply cleanly in filename order. Per-platform build + `ctest` confirmation by the CI pipeline. | +| b10075–b10076 | `ggml/src/ggml-cuda/getrows.cu` | **Additive/perf-only, no public-API surface (1 file, 1 commit).** The sole changed file is a ggml-CUDA kernel: `k_get_rows_float` hoists loop-invariant index math out of the inner loop and a new `int4`-vectorized `k_get_rows_float_vec` path is taken in `get_rows_cuda_float` when alignment/size/block constraints hold (scalar kernel preserved as fallback). Inside an upstream-compiled CUDA backend TU — this project's CUDA classifiers are build-only, no source touched. 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 `tools/tts/tts.cpp` touched. All **six** patches (`0001`–`0003`, `0006`–`0008`) apply unchanged and the OuteTTS generator anchors hold. b10076 is the topmost release at bump time. | +| b10075–b10076 | upstream verification (sandbox) | The `b10075...b10076` diff touches only `ggml/src/ggml-cuda/getrows.cu` — no overlap with `0001`'s `common/arg.{cpp,h}` region, the `tools/server/*` targets of `0002`/`0003`/`0006`/`0007`/`0008`, or the OuteTTS anchors (`tools/tts/tts.cpp` unchanged), so all **six** patches apply cleanly in filename order. Per-platform build + `ctest` confirmation by the CI pipeline. | diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index 2ef0f1e68..ea8248c4a 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 b10069 + GIT_TAG b10076 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=b10069 + -DLLAMA_TAG=b10076 -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 991bc891b..26d5b5801 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 "b10069"}) that mirrors the + *

{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10076"}) 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 "b10069-11fd0a6fb"} — call + * plus the resolved upstream commit, e.g. {@code "b10076-"} — 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 "b10069"}. + * The pinned llama.cpp release tag this library was built against, e.g. {@code "b10076"}. * *

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 = "b10069"; + public static final String LLAMA_CPP_VERSION = "b10076"; // Constants holder — not instantiable. private LlamaCppVersion() {}