Skip to content

vendor: move hash to vendor - #27262

Merged
ngxson merged 2 commits into
masterfrom
xsn/vendor_hash
Aug 17, 2026
Merged

ngxson merged 2 commits into
masterfrom
xsn/vendor_hash

Conversation

@ngxson

@ngxson ngxson commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

move gguf-hash deps to project-level vendors

to be reused by server

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: for finding the licenses and impl patches

@ngxson
ngxson requested a review from ggerganov as a code owner August 17, 2026 13:13
@ngxson
ngxson requested a review from CISC August 17, 2026 13:15
@github-actions github-actions Bot added documentation Improvements or additions to documentation build Compilation issues examples vendor labels Aug 17, 2026
@ngxson

ngxson commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator Author

test

@ngxson
ngxson merged commit 39be55c into master Aug 17, 2026
23 of 31 checks passed
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Aug 17, 2026
* origin/master: (86 commits)
ui: enforce alphabetical enum member ordering (ggml-org#27272)
ui: Refactor Built-In Tools naming (Server/Browser) (ggml-org#27271)
ci: more optimizations (ggml-org#26983)
doc: document MCP stdio servers and CORS defaults in the server README [no release] [no ci] (ggml-org#26847)
server: save processed mtmd chunks as placeholder (ggml-org#27278)
mtmd: use sha256 for input hashing (ggml-org#27274)
vocab : support integer tokenizer scores (ggml-org#27260)
mtmd : skip thumbnail for non-tiled LFM2 images (ggml-org#27246)
cuda : skip UMA override for HIP builds (ggml-org#27083)
vendor: move hash to vendor (ggml-org#27262)
ci : push release tag explicitly in release.yml (ggml-org#27261)
ui: move get_datetime tool to frontend (ggml-org#27255)
ci : reduce builds in build-xcframework.sh (ggml-org#27252)
model: support speculators-format checkpoints for DSpark (ggml-org#26275)
ui: add browser get_info tool (ggml-org#27251)
ci : restore release.yml check during make-release.yml (ggml-org#27247)
mtmd: harden preprocessor_granite (ggml-org#27235)
ci : allow make-release to target a specific commit (ggml-org#27234)
ci : make release workflows use a deploy key (ggml-org#27229)
convert: add @ModelBase.example (ggml-org#27208)
...
brittlewis12 pushed a commit to brittlewis12/llama.cpp that referenced this pull request Aug 17, 2026
* vendor: move hash to vendor

* group hashes into one single static lib
Madreag pushed a commit to Madreag/turbo3-cuda that referenced this pull request Aug 18, 2026
* vendor: move hash to vendor

* group hashes into one single static lib
korcan-h pushed a commit to korcan-h/qvac-fabric-llm.cpp that referenced this pull request Sep 1, 2026
Cache compiled OpenCL programs to disk using clCreateProgramWithBinary
on subsequent runs, keyed by SHA-256 of source + device + driver +
compile opts + GGML version/commit.

Cache is automatically invalidated when the library version changes
(GGML_OPENCL_CACHE_VERSION is set from GGML_VERSION + GGML_BUILD_COMMIT
at compile time).

Env controls:
  GGML_OPENCL_KERNEL_CACHE=0  disable cache at runtime
  GGML_OPENCL_CACHE_DIR       set cache directory (no default; caller
                               must set explicitly via env)

Also clarifies the clGetPlatformIDs error message.

Retrieves device name and driver name from OpenCL in favor of changing
the build_program_from_source function signature.

Allows keeping upstream build_program_from_source and makes patch more
portable.

Co-authored-by: Lubosz Sarnecki <[email protected]>
Co-authored-by: Guilherme Gallo <[email protected]>
Assisted-by: OpenAI Codex

---

b10069 rebase:

- This cycle's audit exercised the OpenCL build with
  GGML_OPENCL_KERNEL_CACHE at its default ON and it does not compile:
  the save-binary block sat in build_program_from_binary, which never
  declared the cache_dir/cache_path locals it reads (they belong to
  build_program_from_source_ex). Latent since at least the b9952 stack
  -- no OpenCL-capable environment had built the cache path since.
- Move the save into build_program_from_source_ex, right after a
  successful source compilation: the only scope where the cache path
  exists, and the only point where a freshly compiled binary is
  available to persist. Build verified with the cache at its default
  ON (libggml-opencl.a compiles and links into a running consumer).

(cherry picked from commit 041c0ca)

b10549 rebase:

- examples/gguf-hash/deps was moved to vendor/hash by upstream 39be55c
  (vendor: move hash to vendor, ggml-org#27262), so the GGML_OPENCL_KERNEL_CACHE
  build glue referenced a nonexistent sha256.c and every GGML_OPENCL=ON
  configure failed at generate time.
- Do not just repoint at vendor/hash: that would compile a second copy of
  the extern sha256_* symbols into libggml, colliding with libvendor-hash
  (which mtmd links since the move) in fully static links. Instead reuse
  the SHA-256 that upstream's cl-program-cache.cpp already embeds by
  exposing cl_program_cache_sha256_hex(), and drop the external source and
  include glue from the build entirely.
- Note: upstream ed7adbf (ggml-org#26050) now layers its own on-disk program
  cache on the build_program_from_source path; this commit's env-gated
  cache remains the only coverage for the direct
  build_program_from_source_ex call sites (FA variants), so it is kept.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011M8oZK4B2h4zLVCCLypWnz
thecodacus pushed a commit to thecodacus/llama.cpp that referenced this pull request Sep 7, 2026
* vendor: move hash to vendor

* group hashes into one single static lib
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
* vendor: move hash to vendor

* group hashes into one single static lib
korcan-h pushed a commit to korcan-h/qvac-fabric-llm.cpp that referenced this pull request Sep 18, 2026
Cache compiled OpenCL programs to disk using clCreateProgramWithBinary
on subsequent runs, keyed by SHA-256 of source + device + driver +
compile opts + GGML version/commit.

Cache is automatically invalidated when the library version changes
(GGML_OPENCL_CACHE_VERSION is set from GGML_VERSION + GGML_BUILD_COMMIT
at compile time).

Env controls:
  GGML_OPENCL_KERNEL_CACHE=0  disable cache at runtime
  GGML_OPENCL_CACHE_DIR       set cache directory (no default; caller
                               must set explicitly via env)

Also clarifies the clGetPlatformIDs error message.

Retrieves device name and driver name from OpenCL in favor of changing
the build_program_from_source function signature.

Allows keeping upstream build_program_from_source and makes patch more
portable.

Co-authored-by: Lubosz Sarnecki <[email protected]>
Co-authored-by: Guilherme Gallo <[email protected]>
Assisted-by: OpenAI Codex

---

b10069 rebase:

- This cycle's audit exercised the OpenCL build with
  GGML_OPENCL_KERNEL_CACHE at its default ON and it does not compile:
  the save-binary block sat in build_program_from_binary, which never
  declared the cache_dir/cache_path locals it reads (they belong to
  build_program_from_source_ex). Latent since at least the b9952 stack
  -- no OpenCL-capable environment had built the cache path since.
- Move the save into build_program_from_source_ex, right after a
  successful source compilation: the only scope where the cache path
  exists, and the only point where a freshly compiled binary is
  available to persist. Build verified with the cache at its default
  ON (libggml-opencl.a compiles and links into a running consumer).

(cherry picked from commit 041c0ca)

b10549 rebase:

- examples/gguf-hash/deps was moved to vendor/hash by upstream 39be55c
  (vendor: move hash to vendor, ggml-org#27262), so the GGML_OPENCL_KERNEL_CACHE
  build glue referenced a nonexistent sha256.c and every GGML_OPENCL=ON
  configure failed at generate time.
- Do not just repoint at vendor/hash: that would compile a second copy of
  the extern sha256_* symbols into libggml, colliding with libvendor-hash
  (which mtmd links since the move) in fully static links. Instead reuse
  the SHA-256 that upstream's cl-program-cache.cpp already embeds by
  exposing cl_program_cache_sha256_hex(), and drop the external source and
  include glue from the build entirely.
- Note: upstream ed7adbf (ggml-org#26050) now layers its own on-disk program
  cache on the build_program_from_source path; this commit's env-gated
  cache remains the only coverage for the direct
  build_program_from_source_ex call sites (FA variants), so it is kept.

Assisted-by: Claude Fable 5
(cherry picked from commit c06fb0a)
gianni-cor added a commit to tetherto/qvac-fabric-llm.cpp that referenced this pull request Oct 1, 2026
Cache compiled OpenCL programs to disk using clCreateProgramWithBinary
on subsequent runs, keyed by SHA-256 of source + device + driver +
compile opts + GGML version/commit.

Cache is automatically invalidated when the library version changes
(GGML_OPENCL_CACHE_VERSION is set from GGML_VERSION + GGML_BUILD_COMMIT
at compile time).

Env controls:
  GGML_OPENCL_KERNEL_CACHE=0  disable cache at runtime
  GGML_OPENCL_CACHE_DIR       set cache directory (no default; caller
                               must set explicitly via env)

Also clarifies the clGetPlatformIDs error message.

Retrieves device name and driver name from OpenCL in favor of changing
the build_program_from_source function signature.

Allows keeping upstream build_program_from_source and makes patch more
portable.

Co-authored-by: Lubosz Sarnecki <[email protected]>
Co-authored-by: Guilherme Gallo <[email protected]>
Assisted-by: OpenAI Codex

---

b10069 rebase:

- This cycle's audit exercised the OpenCL build with
  GGML_OPENCL_KERNEL_CACHE at its default ON and it does not compile:
  the save-binary block sat in build_program_from_binary, which never
  declared the cache_dir/cache_path locals it reads (they belong to
  build_program_from_source_ex). Latent since at least the b9952 stack
  -- no OpenCL-capable environment had built the cache path since.
- Move the save into build_program_from_source_ex, right after a
  successful source compilation: the only scope where the cache path
  exists, and the only point where a freshly compiled binary is
  available to persist. Build verified with the cache at its default
  ON (libggml-opencl.a compiles and links into a running consumer).

(cherry picked from commit 041c0ca)

b10549 rebase:

- examples/gguf-hash/deps was moved to vendor/hash by upstream 39be55c
  (vendor: move hash to vendor, ggml-org#27262), so the GGML_OPENCL_KERNEL_CACHE
  build glue referenced a nonexistent sha256.c and every GGML_OPENCL=ON
  configure failed at generate time.
- Do not just repoint at vendor/hash: that would compile a second copy of
  the extern sha256_* symbols into libggml, colliding with libvendor-hash
  (which mtmd links since the move) in fully static links. Instead reuse
  the SHA-256 that upstream's cl-program-cache.cpp already embeds by
  exposing cl_program_cache_sha256_hex(), and drop the external source and
  include glue from the build entirely.
- Note: upstream ed7adbf (ggml-org#26050) now layers its own on-disk program
  cache on the build_program_from_source path; this commit's env-gated
  cache remains the only coverage for the direct
  build_program_from_source_ex call sites (FA variants), so it is kept.

Assisted-by: Claude Fable 5
(cherry picked from commit c06fb0a)
(cherry picked from commit 6d830c7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Compilation issues documentation Improvements or additions to documentation examples vendor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants