Sync master with upstream (b10632) and repair the merge base - #117
Merged
Conversation
* server: add read_image tool (ggml-org#25875) Adds a server-tool that allows vision models to analyze server-side images. This tool is reading a single file for now: The image data is base64 encoded and passed to the UI, which decodes it, fills the <img> tag and removes the data URI before passing the tool result back to the model. * cleanup read_image tool: move magic strings to constants * Add dedicated constants file: tools/ui/src/lib/constants/read-image.ts with PREFIX_IMAGE, PREFIX_SIZE, PREFIX_MIME constants * Use ATTACHMENT_SAVED_REGEX from agentic.ts in ChatMessageToolCallBlockReadImage.svelte * Use NEWLINE constant from code.ts instead of hardcoded '\n' * Use PREFIX_SIZE in regex pattern for size parsing * Add SERVER_TOOL_READ_IMAGE_PREFIX_* constants in C++ server-tools.cpp to match the TypeScript PREFIX_* constants for consistency * server: rename read_image tool to read_media for images and audio * Rename server_tool_read_image to server_tool_read_media in C++ * Rename enum BuiltInTool.READ_IMAGE to READ_MEDIA * Rename UI constants, parser, and Svelte component files * Update display label from 'Read image' to 'Read media' * ui: consolidate audio data URI handling into shared utility * Extract getAudioInputFormat to a shared utility (was duplicated inline) * Store raw base64 in base64Data on the message object * Use base64Data to construct data URIs for audio rendering * Update agentic store to build INPUT_AUDIO parts from base64Data * server: read_media: restrict audio to wav/mp3 and minor fixes * Server get_mime_from_extension now only advertises audio/wav and audio/mpeg (the only formats the model's input_audio API accepts) * Case-insensitive extension matching (fixes .MP3, .Wav, etc.) * Unknown extensions return an error instead of a multi-MB data URI that inflates model context with garbage * Updated tool description to document supported formats * Frontend AUDIO_MIME_TO_EXTENSION trimmed to match server * fix a missing import in tools/ui/src/lib/stores/agentic.svelte.ts * server: read_media: add to --tools help text and README tool list * ui: fix indentation in ChatMessageToolCallBlockDefault.svelte * server: read_media tool: fix a cast to use the correct type * server: read_media: multiple fixes * server-tools.cpp import cctype, remove UTF-8 char, check mime before reading file * ui: add MimeTypePrefix.AUDIO and use it in agentic.svelte.ts * server: make read_media inherit from read_file and add uses_cwd * ui: fix formating issues * rm from server * move it to frontend-only tool * correct partial commit * rm unused * ui: address review from allozaur Replace the magic strings, regexes and number in the read_media parser and service with named constants. Path splitting reuses FILE_PATH_SEPARATOR_REGEX, the size header regex moves to READ_MEDIA_SIZE_REGEX derived from PREFIX_SIZE, and FILE_EXTENSION_SEPARATOR lands next to it in constants/code.ts. --------- Co-authored-by: ckrafft <ckrafft@epyc> Co-authored-by: Xuan Son Nguyen <son@huggingface.co> Co-authored-by: Pascal <admin@serveurperso.com>
* server : save serialized image chunks at the end of the llama state * server : support multimodal slot state save/restore with packed payload * server : refine image slot state serialization * server : support media slot state and centralize media validation * server : remove unnecessary comment * server : remove defensive media checks and move the chunk type check to validate()
* cmake : add config version support (wip) [no ci] This commit adds support for find_package using a version, for example: ``` find_package(ggml 0.19.0 REQUIRED) ``` examples/test-cmake has been updated to use this and build scripts have been added to verify this manually. This is still a work in progress and I'm not sure about the scripts and if we can find better ways to test this but it might be useful to have for verification of changes to the cmake build. * cmake : add semver to ggml backends [no ci] This commit adds a semver to the ggml backend modules files. The motivation for this is that the backends are currently loaded just a file extension, for example .so on linux. With the introduction of semantic versioning installing a new version should just work but since these files don't have a version they would get overwritten. Adding the semver to the library names allows multiple version to be supported and the correct one will be loaded by the code. I've only tested this on linux and need to test on mac and win. * Revert "cmake : add semver to ggml backends [no ci]" This reverts commit 53a6c58a07591951324c891b9986b2cffe5c7972. * examples : update build-install.sh and set GGML_BACKEND_DIR
* fix sliding_window_pattern * disallow integer pattern
ggml-org#26076) * Add runtime feature detection mechanism for aarch64/kleidiai Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> * Address Review Comments Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> * Add log warning for NSMC reserved value Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> * Address review comments Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> * Fix Rebase, move code from cpu-feats to ggml-feats Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> * Address naming of runtime feature struct Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> --------- Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com>
…ggml-org#25596) * gguf : harden loader against malformed tensor dims and metadata types * gguf: address review on malformed-metadata hardening - report the expected vs. actual type when general.alignment is not u32 - use ggml_nelements() > 0 for the zero-element guard and keep the representability checks visually aligned - add test-gguf cases for a wrong-typed alignment key and a zero-dim tensor (both used to crash: assert-abort and SIGFPE respectively) Ran tests/test-gguf: 164/164 pass. Used an AI assistant to help draft these edits; reviewed and verified by me. * cont : less comments Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* cmake : introduce semantic versioning (wip) This commit introduces semantic versioning to llama.cpp. * squash! cmake : introduce semantic versioning (wip) * cmake : update test-cmake README notes [no ci] * include libmtmd in output so show its semversioned * ci : add make-release workflow * ci : fix build number check in build-cmake-pkg.yml * examples : remove trailing whitespace * ci : abort if upstream ggml version does not exist * ci : extract step contents into scripts * ci : add GGML_NATIVE=OFF to ubuntu job * examples : remove CI build information from test-cmake [no ci] This commit removes the nightly/release information that I added previously to keep this focused only on using building and installing llama.cpp with cmake and being able to quickly verify changes or troubleshoot issues. * ci : merge scripts into single script * remove -dev-build_number support This commit removes the incremental build number (versioning) support that I added. This was incorrect and we should only use the semver for the version. Releases will be tag a nightly build and package maintainers/managers that build from source can use the tag and it is therefor important that the correct version is reported. So a nightly-build will report the semver without the build number. The build number and commit as availble via cmake and test-cmake has been updated to include an example of using them: ```console $ ./build.sh [test-cmake] version: 0.1.0, build: 10360 (08c69e3) ... ``` Refs: ggml-org#26839 (comment) * docs: add initial release.md documentation * cmake : clean-up and add LLAMA_BUILD_IS_DEV option * ci : remove version input from make-release job * ci : add LLAMA_BUILD_IS_DEV=OFF to build-cmake-pkg.yml Refs: https://github.com/danbev/llama.cpp/actions/runs/31576801921/job/94050639145 * docs : update release notes with LLAMA_BUILD_IS_DEV info [no ci] * ci : add TODO to winget workflow [no ci] --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* disable ubuntu-rocm * link PR
* test address on Intel-LNL-U7-258V * retry * run address on github * use native build for cpu * this should be runnable everywhere multicore * disable ccache --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
* common: Add CLI > ENV > models-presets > INI precedence
1. CLI flags have the highest precedence
2. ENV vars have the second-highest precedence
3. System and User configs have the lowest precedence
- Linux/BSD/Mac
- /etc/llama.cpp/config.ini < ${XDG_CONFIG_HOME:-~/.config}/llama.cpp/config.ini
- Windows
- %PROGRAMDATA%\llama.cpp\config.ini < %APPDATA%\llama.cpp\config.ini
* fix UB
* use common_get_env
* ignore_unknown_keys
* nits
* add docs
---------
Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
* refactor: Constants * refactor: Constants/Enums cleanup * refactor: Constant objects instead of multiple single value constants * refactor: Cleanup constants
* refactor: Stores barrel imports + SSR gates * refactor: Drop agenticStore wrapper exports * refactor: Drop chatStore wrapper exports * refactor: Drop modelsStore wrapper exports * refactor: Drop serverStore wrapper exports * refactor: Drop unused mcpStore wrapper exports * refactor: Drop mcpResourceStore wrapper exports * refactor: Drop conversationsStore wrapper exports + move buildConversationTree to utils * refactor: Drop settingsStore wrapper exports * refactor: Drop unused toolsStore wrapper exports * refactor: Fix lint errors from store wrapper removal * fix: Missing change * refactor: Cleanup * refactor: Context Stats store
…gml-org#26951) * refactor: Remove dead context for Chat Settings and create a new one for Chat Messages Actions * refactor: Contexts & types
It enables -fassociative-math, which reassociates FP reductions and can flip greedy argmax on RDNA3.5 (e.g. MTP speculative decode diverging from the non-speculative baseline). Drop it so HIP builds are IEEE-conformant. Co-authored-by: Jim Wu <ywu@xilinx.com>
* server: refactor metrics * move most fields to server_slot_stats * cont * rm result_timings * tie stats to batch * cont * nits: move place in code * exclude first generated token * more accurate batch metrics tracking * n_predict --> n_gen * metrics_on_prediction * metrics_flush_idle * metrics: seperate cache/processed prompt tokens * refactor server_task_result_metrics * add test * nits * fix flush before reset() * cont * rm dead code * nits
* Add DMMV Q4_K and Q6_K ESIMD kernels Configure cmake build with -DGGML_SYCL_ESIMD=ON to enable. Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Refactor ESIMD kernels to share common code Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Move control of ESIMD from compile to runtime Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Use ESIMD by default when available Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Fix possible error when using ESIMD by default While not an issue in the current version, this will become an issue when additional QK ESIMD kernels are added (such as Q2_K). Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Add explicit unroll to ESIMD kernels Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Tidy up ESIMD kernels a bit Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> * Add DMMV Q3_K ESIMD kernel Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> --------- Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Measured on Arc Pro B70 (Battlemage), Qwen3.6-27B Q4_K_M, -fa on, f16 KV, -b 2048 -ub 2048, llama-bench -r 3, three interleaved A/B rounds: pp2048 1014.70 -> 1018.56 t/s (+0.38%, within run-to-run spread) tg128 23.73 -> 23.86 t/s (+0.57%) tg128 @ d4096 22.71 -> 22.86 t/s (+0.62%)
…ml-org#26372) * sycl: use automatic fp16 promotion in gemm * sycl: remove redundant comment
…ggml-org#26947) Co-authored-by: jinzihao <jinzihao.jzh@alibaba-inc.com>
* dflash: enable backend sampling for both dflash & dspark * enable p_min > 0 in backend sampling and add guard * cont : add TODO --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* common : auto-detect spec type from draft GGUF metadata When -md loads a local draft model without --spec-type, the sidecar inference in common_models_handler_apply only checks HF repo sidecars and misses local files. The draft model loads into VRAM but speculative decoding never activates (types stays NONE). Read general.architecture from the draft GGUF header and map: dflash + markov_w1.weight tensor -> draft-dspark dflash without markov head -> draft-dflash Assisted-by: opencode * common : address review feedback on spec-type auto-detect PR - Fix comment spacing to match surrounding style (/* .x = */ not /*.x =*/) - Add LOG_INF when auto-detection fires so users can see why spec decoding enabled - Document single-file assumption for split-GGUF edge case Addresses bot review feedback on ggml-org#26814. * common : move spec-type GGUF auto-detect into speculative module - add common_speculative_types_from_gguf() in speculative.cpp/.h - use gguf_context_ptr (RAII) from ggml-cpp.h - reduce comments to a single line per AGENTS.md style Addresses review feedback on ggml-org#26814 * common : add doc note and join SPC_INF line in spec-type auto-detect Assisted-by: opencode
* metal: add TQ2_0 support Add support for the GGML_TYPE_TQ2_0 (ternary, 2 bits per element) type in the Metal backend. Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * cont : optimize mul_mv kernel - float ops over integer ops - precalculate sums - hoist coef out of the inner loop - contiguous y loads llama.cpp:DeepSeek-v4-Flash-0731
…ml-org#27602) * ci : apply ccache-clear with older/min/dry-run to all ccache jobs Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * ci : install gh in ccache-clear if missing (container jobs) The ccache-clear action relies on the gh CLI, which is not present in container-based jobs. Install it on demand so those jobs can clear caches. Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * ci : install gh via apt repo in ccache-clear The install.sh script used previously is no longer served (404). Switch to the official GitHub CLI apt repository, which is still available. Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * ci : pass --repo to gh cache commands in ccache-clear In container jobs gh cannot auto-detect the repository from git, so gh cache list/delete fail with 'failed to run git: not a git repository'. Pass the repository explicitly via --repo using GITHUB_REPOSITORY. Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * ci : drop -new suffix from vulkan ccache key The -new suffix was only needed to force a fresh cache. With ccache-clear now evicting stale caches, the original key can be used again. The old ccache-vulkan-ubuntu-24.04-arm-new entries still match the ccache-clear key prefix and are cleaned up automatically. Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * ci : fix ccache-clear date parsing on macOS (BSD date) macOS ships BSD date, which has no -d option. The older cutoff check was silently disabled there: 'date: illegal option -- d' errors in the log and the loop was only stopped by the min limit, risking deletion of caches not older than the cutoff (e.g. saved by a concurrent job). Parse the ISO-8601 timestamps with GNU date when available and fall back to BSD date otherwise (TZ=UTC, fractional seconds dropped). Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * ci : extract ccache-clear logic into scripts/ccache-clear.sh The composite action now consists of a dedicated step that installs the GitHub CLI when missing (e.g. in container jobs) and a thin step that calls the new script. The script follows the make-release-checks.sh conventions (usage/env header, set -euo pipefail, CLI flags) and only checks that gh is available. The action inputs are unchanged, so the workflow steps are untouched. Assisted-by: llama.cpp:DeepSeek-v4-Flash-0731 * ci : remove unused apple ccaches
* mtmd: video: fix moov at the end of file Co-authored-by: rkfg <rkfg@rkfg.me> * fix SIGPIPE * windows: handle broken pipe case --------- Co-authored-by: rkfg <rkfg@rkfg.me>
…ay be defined as K in flash_attn_decls.tmpl if KV_OVERLAP (ggml-org#27545) Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
* ggml : shorten virtual device naming in CUDA and Metal Assisted-by: llama.cpp:DeepSeek-V4-Flash-0731 * ggml-metal : build device description at init Assisted-by: llama.cpp:DeepSeek-V4-Flash-0731 * cont : naming
Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
…27659) `repetition_penalty` is standard HF key for repetion penalty. Currently, only `penalty_repeat` is mapped, read `repetition_penalty` and map it to `metadata.sampling_penalty_repeat`.
* metal : per-op source split + parallel compile (ggml-org#24021) * preliminary extract common header * op source split * split metallib into 8 libs && load in parallel * derive kernel->library routing from functionNames * x-macro lib list + underscore filenames, dedup QK_NL, MRC fixes * op source split 8 to 20 * improve robustness of source fallback * clean up * change bool -> atomic_bool * only prepend headers that source actually includes * no semaphore, use GCD global queue * dedup library compile path, fix NSError lifetime, rename gla * relocate upstream concat/rope_back/repeat kernel changes into split files * move ggml-common.h from common.h into dequantize.h to shrink binary size --------- Co-authored-by: lvyichen <lvyichen@stepfun.com> * metal: add col2im_1d op (f32/f16/bf16) (ggml-org#25176) * metal : add set_rows with src0 f16 (ggml-org#25434) * metal : add CONV_2D_DW (depthwise convolution) support (ggml-org#21565) * metal : add Q2_0 support (ggml-org#25419) * metal: fuse snake activation (mul, sin, sqr, mul, add) (ggml-org#25459) * ggml-metal: FWHT kernel for metal backend (ggml-org#25924) * metal : port new kernels into the split sources Move the kernels added on master after the split (lightning indexer, DSv4 hyper-connections, silu_back, f16 bin ops, TQ2_0, the flash-attn KV dequantization pass, rope offset/inplace, ssm_scan rollback, packed q8_0 dequantization and the tensor-API mat-mat K clamp) into the corresponding kernels/*.metal sources. Copied verbatim, no functional change. --------- Co-authored-by: lvyichen <lvyichen@stepfun.com> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* metal : per-device tuned (Q, NE) for flash-attn vec (ggml-org#25750) * rebase Q-generic FA vec body from 01dc936 (ggml-org#23114) * add 53 f16 (Q,NE) flash-attn vec instantiations (vec 80 -> 133) * add FA vec (Q,NE) tuning table + dispatch wiring + SMEM cap fallback * add FA vec (Q,NE) perf sweep * fill tuning result * fold family table into a per-family representative SKU * refactor tuning result format * extend FA vec tuning to quantized KV caches * sync fa vec tuner bucketing with runtime, use pointwise tuning regret * update tuned table * format and cleanup * prefix fa_vec tuning procs with ggml_backend_metal_tuning_, drop unused fa_vec_override_active * add device id -> token lookup for the offline tuning tool * add ggml-metal-tuning skeleton * add op-agnostic perf cell + median timing for the tuner * add FA-vec graph build + tensor init to the tuner * tools : add FA-vec (Q,NE) sweep, compression and table emit * cool down and re-measure the dirty window on thermal drift * test-backend-ops : replace the FA vec tune mode with a bounded (Q,NE) slice * tools : document the Metal tuner, point the table comment at it * abort on unknown KV type, single-source fa_vec_legal_ne * cleanup * honor -o in the FA vec (Q,NE) slice * retune FA-vec (Q, NE) under a pointwise no-harm gate * cont : add fa-vec tunings for M1 Pro, M2 Ultra, M5 Max --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…ml-org#27538) Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
* grammar : accept "\-" escape in character classes gbnf_escape_char_class() escapes '-' as "\-" but parse_char() rejected that escape, so generated tool-call grammars failed to parse. Assisted-by: Claude Code <claude@anthropic.com> * tests : add parser test for "\-" in char classes Assisted-by: Claude Code <claude@anthropic.com> * tests : add integration test for "\-" in char classes Assisted-by: Claude Code <claude@anthropic.com> * tests : drop integration and parser tests
* ggml : bump version to 0.22.0 * scripts : update default release desc
* llama.cpp : bump version to 0.3.0 * ci : update release default desc * scripts : add prompt for generating release summary
* metal : null-check ggml_metal_buffer_init result to avoid OOM crash ggml_backend_metal_buffer_type_alloc_buffer used the result of ggml_metal_buffer_init without checking for NULL. ggml_metal_buffer_init returns NULL when the underlying Metal allocation fails (e.g. an out-of-memory condition), and the following ggml_metal_buffer_is_shared(res) call dereferences it, turning a recoverable allocation failure into a hard crash (EXC_BAD_ACCESS). This is easy to hit on memory-constrained devices such as iOS when a model/context exceeds the available Metal budget. Log the failure using the existing GGML_LOG_ERROR convention and return NULL so the allocator surfaces a diagnosable error up the stack instead of crashing. * cont : fix log --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* chore: Spacing between sibling elements in html markup * chore: Formatting and linting rules
…-org#27699) * add ccache-buckets action * use ccache-buckets * only save on master * install python3-venv for hip * add jq and python3 for cuda * only delete caches older than 5 minutes
…g#27626) * server: fix tool calls getting silently stripped with --prefill-assistant Last assistant carries tool_calls + --prefill-assistant is on → request flips into continuation mode, add_generation_prompt forced off, tail rebuilt from reasoning_content + content only. Tool calls just vanish. - Auto-continuation now skips trailing assistant msgs that have tool calls - continue_final_message on those throws a clear error instead of silently corrupting the prompt - Regression tests included, red before / green after Fixes ggml-org#27588 Developed with AI assistance, disclosed per the contribution policy. * server : address review: fail on prefill-assistant + trailing tool_calls Move validation into oaicompat_chat_params_parse (next to the existing two-or-more-assistant check) and remove it from common_chat_templates_apply, which has no precedent for validation. Drop the regression tests. Per review: --prefill-assistant with a trailing assistant message containing tool calls is not supported and should fail loudly.
* devops: use GGML_NATIVE=OFF for OpenVINO Same as in other Dockerfiles. Should fix ggml-org#23100 * enable backend dl and cpu all variants --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
* rpc: support apple RDMA as an RPC transport * remove set_tensor micro optimization, rpc socket pinning per CR * remove transparent reconnect * trigger apple builds on RPC changes --------- Co-authored-by: Ryan Churaman <rschu@meta.com>
This matches what other build targets use and also what AMD advertises wheels as supporting.
* Rework KleidiAI Build System/Integration Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> * Add fp16 guard, and fix cmake caching issue Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> * Fix formatting, and rebase issue Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com> --------- Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com>
…l-org#26647) * metal: WIP chunked SSD SSM_SCAN kernels for multi-token prefill * metal: drop scalar SSD path; MMA + sequential tail * drop WIP ssm scan test noise * remove state_from_dst and rename CS and NSG constants * remove unrelated added whitespace padding * added clarity to mma_tokens calculation * added clarity to use_mma bool checks * added comments to metal ssd op constants for clarity * reserve K tokens for sequential kernel rollback snapshots * reset concurrency between mma and seq tail * remove print args no longer used * fixed comment to no longer point to specific line * add FC_SSM_SCAN so seq path skips token offlset unless it's mma tail * added changes to new ssm.metal for rebase after ggml-metal.metal refactor * specialize ssm_scan tail with a template instead of a function constant --------- Co-authored-by: dpantaleoni <dominikpantaleoni@gmail.com> Co-authored-by: forforever73 <690105611@qq.com>
PR #80 brought its content across but was squash-merged, so 53fd974 has a single parent and git never learned that upstream 82bb485 was incorporated. Every merge since has three-way merged against the 2026-06-10 base and invented conflicts in files nobody touched: merging b10632 conflicts in 539 files with that base and in 21 with this one. At 53fd974 the tree differed from 82bb485 in exactly 71 paths, all under .github/ or scripts/unsloth/, with zero modifications, so this records a fact. The -s ours strategy leaves the tree untouched.
Master was 1047 commits behind upstream and carrying a merge base from 2026-06-10, because PR #80 brought upstream 82bb485 across as a squash. The previous commit records that ancestry, which is what makes this merge 21 conflicts instead of 539. Every conflict is the same shape: an upstream workflow this fork deletes on purpose in favour of the unsloth-prebuilt-* set, modified upstream since the last sync. All 21 stay deleted. Two workflows upstream added since 82bb485 are deleted for the same reason rather than inherited: make-release.yml creates tags and releases in whatever repo it lives in, which would collide with this fork's own release scheme pr-draft-label.yml fires on pull_request_target with contents: write Upstream composite actions are kept; an action never triggers on its own, and several are already referenced by the builds here. The fork owns nothing in llama.cpp source, so this is additive by construction: scripts/unsloth/, .github/workflows/unsloth-* and .github/actions/prebuilt-alert are byte-identical to the previous master. Base tag chosen to match what the nightly builds, so a branch cut from master now replays onto the nightly base with no gap.
The 08-07 sync was squash-merged, so upstream never became an ancestor of
master. Nothing went red. For three weeks every merge involving a
master-derived branch three-way merged against a 2026-06-10 base and invented
conflicts in files nobody had touched, and it read as ordinary churn.
Two checks, on every push to master:
1. the recorded sync commit is still an ancestor of master. Confirmed against
the broken state: compare(82bb485...master) returned "diverged" on
pre-sync master, so this would have caught the original mistake on the day.
2. the diff from that commit to master touches only .github/ and
scripts/unsloth/. That property is what lets verify_upstream_sync.py prove
a sync is additive instead of arguing about it, and it is worth losing
loudly rather than silently.
Uses the compare API rather than a checkout; the ancestry question is one
request and a full-history checkout of this repository is not cheap. It refuses
to answer rather than pass when the API's file list hits its cap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings master up to upstream
ggml-org/llama.cppat the aged release tagb10632, and repairs the merge base that made every recent merge miserable.What was actually wrong
git merge-base(master, upstream/master)wase95dae18d, dated 2026-06-10. Upstream had 1047 commits since; master had 167.The content was not that stale. PR #80 brought upstream
82bb48500across on 08-07, but it was squash-merged, so53fd974b4has a single parent and git never learned upstream had been incorporated. The files arrived; the ancestry did not.Everything since has three-way merged against that 2026-06-10 base and manufactured conflicts in files nobody meaningfully touched. Measured with
git merge-tree:b10632into mastere95dae18d(the stale one)82bb48500(the truth)Nothing was ever red while this was true. It surfaced only when a new architecture PR cut from master could not be replayed onto the nightly base without a 400 file hand merge.
The three commits
1. Record upstream
82bb48500as an ancestor. A-s oursmerge, so the tree does not move at all (git diff HEAD^1 HEADis empty, asserted before anything was pushed). This is a statement of fact, not a convenience: at53fd974b4the fork tree differed from82bb48500in exactly 71 paths, all under.github/orscripts/unsloth/, with zero modifications.2. Sync with
b10632. 21 conflicts, every one a modify/delete on an upstream workflow this fork deletes on purpose. All stay deleted. Two workflows upstream added since the last sync are deleted for the same reason rather than inherited:make-release.ymlcreates tags and releases in whatever repo it lives in, which would collide with this fork's own release schemepr-draft-label.ymlfires onpull_request_targetwithcontents: writeUpstream composite actions are kept; an action never triggers on its own and several are already referenced by the builds here. The rule, stated once: delete every upstream workflow, keep every upstream action.
3. A guard so this cannot recur silently.
scripts/unsloth/upstream-sync.jsonrecords the sync point, andunsloth-upstream-sync-guard.ymlfails master if either the sync commit stops being an ancestor, or the fork acquires divergence outside.github/andscripts/unsloth/.Verification
scripts/unsloth/verify_upstream_sync.py, the gate written for this in #80:Plus, against the pre-sync master
2d36bff8e:scripts/unsloth/differs in 0 files.github/workflows/unsloth-*differs in 0 files.github/actions/prebuilt-alertdiffers in 0 filesb10632is 75 paths, 0 of them outside.github/andscripts/unsloth/, of which 24 added, 50 deleted and 1 modified. The single modification isbench.yml.disabled, carrying this fork's own action-pinning policy from Pin all GitHub Actions to commit SHAs #105 on a file disabled by its extensionLLAMA_BUILD_TESTS=ONThe guard was checked in both directions before being committed. Against the broken state,
compare(82bb48500...master)returnsdiverged, so it would have caught the original mistake on the day it happened. Against this branch it passes with 0 stray paths.One subtlety worth knowing for the next sync:
verify_upstream_sync.pyderives its base frommerge-base(--fork, --upstream). Point it at a--forkref whose ancestry is already correct, or it measures the stale set and reports failures that are artefacts of the bad base. It is noted inupstream-sync.json.Please merge this with a merge commit
Not squash, not rebase. Squashing is exactly what caused this, and it drops the upstream parent again.
masteris backed up atrefs/backup/master-pre-sync-20260826(2d36bff8e) if anything needs undoing.Effect on open PRs
The 13 open PRs targeting master will need rebasing onto the new base, as after any sync. Nothing is force-pushed under them and their own merge bases are unchanged, so their diffs stay narrow. The upside is the point of the exercise: a branch cut from master now replays onto the nightly base tag with no gap.
The nightly itself is unaffected. It builds
aged tag + pinsand never reads master's source; its workflow definitions come from the default branch, which is why the byte-identity checks above are the ones that matter.