Repository navigation
llama.cpp: embed a pinned web UI (the build fetched HF's moving latest) - #879
Conversation
…t the build host's CPU Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 9 minutes for your next included review. View limit details
Comment |
There was a problem hiding this comment.
I don't think this is the fix for the diff.
- Likely a no-op. At b10357,
ggml/CMakeLists.txt:105-110already defaultsGGML_NATIVEto OFF wheneverSOURCE_DATE_EPOCHis set, and the sandbox always sets it. The build log should already show "Setting GGML_NATIVE_DEFAULT to OFF". - It can't explain the diff anyway.
-march=nativeonly applies to ggml-cpu (ggml/src/ggml-cpu/CMakeLists.txt:733), but the differing file islibllama-server-impl.so. The comment atbuild.sh:13-16states a cause that doesn't hold. - Likely real cause:
libllama-server-impl.solinksllama-ui, the embedded web UI. By default the build tries to downloaddist.tar.gzfrom Hugging Face, falling back to a movinglatestwhen there is no build number (no.gitin the tarball;scripts/ui-assets.cmake:183-197). It also gzips the assets without-n(:269). That fits "31% of bytes changed, identical symbols", and it's an unpinned download.- Please check the log for "UI: downloading".
- Then try
-DLLAMA_BUILD_UI=OFF -DLLAMA_USE_PREBUILT_UI=OFF, or a pinned UI source.
Keeping -DGGML_NATIVE=OFF as a guard is harmless; just reword the comment. Separately, arm64's plain -march=armv8-a leaves out dotprod, fp16 and i8mm, a large speed cost that predates this PR and is worth its own issue.
Generated by Claude Code
The prod-pair diff wasn't -march=native: ggml already defaults GGML_NATIVE OFF when SOURCE_DATE_EPOCH is set (the log says so). It was the embedded web UI. scripts/ui-assets.cmake downloads dist.tar.gz from Hugging Face at build time, and with no .git in the tarball the build number is 0, so it falls back to the moving `latest` (a session build logged "UI: downloading from latest"; latest is now 2e4be821…, not b10357's 68f883c9â 8000 €¦). - The b10357 UI is a pinned Source (mirrored to minimal-staging-archives, sha256 = upstream's dist.tar.gz.sha256), unpacked into tools/ui/dist, which the script uses first. LLAMA_BUILD_UI=OFF and LLAMA_USE_PREBUILT_UI=OFF switch off the npm and HF paths. - Asset mtimes pinned to 1980-01-01: the script gzips without -n, and the sandbox's SOURCE_DATE_EPOCH (0) is out of range for gzip, which exits 2. - GGML_NATIVE=OFF kept, with the comment reworded as a guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
latest)
|
Thanks @norrietaylor, you were right on every point. Addressed in 03aa8a5, on top of a merge of main (ba7c118):
One thing this turned up: llama.cpp declares no network 🤖 Generated with Claude Code |
There was a problem hiding this comment.
This fixes the real cause.
tools/ui/distis used first (ui-assets.cmake:298-302), before the npm or Hugging Face paths, andbuild.shfails ifindex.htmlis missing, so the build can't fall back to a network fetch.- The
touch -d @315532800pins the mtimes that gzip stores. - The mirror hashes to the pinned
68f883c9…. - The GGML_NATIVE comment now correctly calls it a guard.
- arm64 is split out to #975.
Nits:
- I couldn't compare the pin with upstream's
dist.tar.gz.sha256(HF is blocked for me), and the bundle'sbuild.jsonsaysb0000. A line in the PR on how you cross-checked the hash would help. - The updater only rewrites the first sha256, so automatic bumps will fail on the UI source until it knows about it. It fails safely.
license_spdx = "MIT"doesn't reflect the Apache-2.0 code (pdf.js) in the embedded bundle. This predates the PR.
Generated by Claude Code
license_spdx was "MIT", but the binary also ships the llama-ui bundle (402 npm packages: Apache-2.0 pdf.js/dexie/…, BSD-3/2, ISC, 0BSD, Unlicense) and vendored public-domain/Unlicense C (miniaudio, stb, sheredom). Declare the full expression and list the components; notice files are pkgs#994. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @norrietaylor. All three nits are addressed in dcf7f7e, on top of a merge of main (61606c8):
Only 🤖 Generated with Claude Code |
Makes llama.cpp reproducible by embedding a pinned web UI instead of whatever Hugging Face serves as
latestat build time.Cause. Diffing the published llama.cpp artifacts of two world rebuilds showed
libllama-server-impl.sodiffering in 31% of its bytes with an identical symbol set. It isn't-march=native: ggml already defaultsGGML_NATIVEOFF whenSOURCE_DATE_EPOCHis set (ggml/CMakeLists.txt:105-110; the build log prints "Setting GGML_NATIVE_DEFAULT to OFF"). It's the embedded web UI (llama-ui, linked into that library):scripts/ui-assets.cmakedownloadsdist.tar.gzfrom Hugging Face during the build..git, so the build number is 0. Theb0lookup 404s, and the script falls back to the movinglatesttag. A session build loggedUI: downloading from latest.latesttoday is2e4be821…; b10357's UI is68f883c9…. Each rebuild embedded whatever was current.Fix
Source. It's mirrored togs://minimal-staging-archives/ggml-org/llama-ui/b10357-dist.tar.gz, and its sha256 matches upstream's publisheddist.tar.gz.sha256. build.sh unpacks it intotools/ui/dist, which the script uses first.-DLLAMA_BUILD_UI=OFF -DLLAMA_USE_PREBUILT_UI=OFFturn off the npm and HF paths.-n, so the header records the file's mtime. The asset mtimes are pinned to 1980-01-01. The sandbox'sSOURCE_DATE_EPOCH(0) is out of range for gzip, which exits 2 on it; the first attempt failed that way.-DGGML_NATIVE=OFFstays as a guard, and its comment now says so.version, but its sha256 must be bumped by hand. The updater only rewrites the first sha256; a stale one fails closed.Verified
--rebuildbuilds with 399 C++ compiles each. All 16 output files hashed identical, includinglibllama-server-impl.so(2e17b64a…) andllama-server.UI: using pre-built assetsand no download.nickel format --check,bash -nandmip dump --packagesare clean.Not in this PR: arm64's plain
-march=armv8-aleaves out the dotprod, fp16, i8mm and SVE kernels. That's #975, which proposes ggml's runtime CPU variants.How t 8000 he UI hash was cross-checked
b10357's
scripts/ui-assets.cmake(hf_download, lines 183-248) fetcheshttps://huggingface.co/buckets/ggml-org/llama-ui/resolve/b<N>/dist.tar.gzand verifies it against the siblingdist.tar.gz.sha256before use. I fetched both directly on 2026-10-22 and compared them with the pin and the mirror:All three agree, and they equal the pin in
build.ncl.HF buckets are Xet storage, not a git repo, so there's no revision commit. The object's immutable identity, from the response headers:
x-xet-hash/x-linked-etag:b3345b4fbdbe854a5f68b33b1e11abd2cddbae5c186d0c3d78405b0157da861fx-linked-size: 3,074,915 byteslast-modified: 2026-08-11 05:36:17 GMT, 19 minutes after the b10357 release was published (05:17:49Z, commit689e227d)build.jsonsaysb0000. b10357'stools/ui/scripts/vite-plugin-build-info.ts:26writesLLAMA_BUILD_NUMBER || 'b0000'. So the published bundle was built without that env var set, andb0000is the plugin's default, not a different build. The UI shows it only as a label.🤖 Generated with Claude Code