Skip to content

Track latest ggml-org llama.cpp again (keep Kokoro / OmniVoice / TBQ)#44

Open
odilitime wants to merge 909 commits into
mainfrom
zerollama/pr0-upstream-86d86ed4
Open

Track latest ggml-org llama.cpp again (keep Kokoro / OmniVoice / TBQ)#44
odilitime wants to merge 909 commits into
mainfrom
zerollama/pr0-upstream-86d86ed4

Conversation

@odilitime

@odilitime odilitime commented Jul 21, 2026

Copy link
Copy Markdown

Why merge this

Eliza’s fork should track upstream llama.cpp again — new models, Metal/CUDA fixes, and server APIs — without throwing away Kokoro, OmniVoice, or TBQ/QJL/Polar.

Every week on a frozen tip makes rebases harder, blocks community patches, and forces agents/Mac builds to miss upstream reliability work. This PR is the water-test that unblocks that future: re-root onto a recent ggml-org tip while keeping Eliza product trees in-tree.

If this cannot land, feature work on top of a stale orphan history will keep getting more expensive. Landing it restores a shared base with ggml-org so the next PRs are normal diffs again.


Pain today

  • main @ ad56033 (Jul 3) sits on an orphan ~51-commit history with no merge-base against ggml-org/llama.cpp
  • Tag names like main-b10064-* do not mean the tree matches ggml b10064
  • Normal git merge / rebase against upstream is blocked; drift compounds every upstream release
  • Agents and Mac users miss upstream model support, server fixes, and Metal/CUDA improvements already on ggml-org

What you get

Upstream tip ggml-org 86d86ed4 (b10064 line) as the new root
Eliza kept tools/kokoro, tools/omnivoice, eliza-shipped / eliza-kernels Metal, CPU TBQ/QJL/Polar sources, Eliza validation workflows/docs
Mergeable main recorded via merge -s ours so GitHub can merge despite unrelated histories
Stock server builds Metal llama-server compiles on the tip today

This is a re-root, not a three-way content squash of two full trees. That is intentional: content-merging orphan histories produced Frankenstein sources (e.g. stale dflash-draft against new headers) that do not build.

Why it is safe to merge

  • No new product flags and no voice ABI change in this PR
  • Kokoro / OmniVoice / TBQ trees remain present for follow-up wiring
  • Conflict strategy prefers the upstream tip for shared llama.cpp files; Eliza-only product trees stay as overlayed from current Eliza main
  • Draft until you are happy with CI / follow-up CMake wiring — but the merge conflict is already cleared (MERGEABLE)

How to try (3 commands)

git fetch origin zerollama/pr0-upstream-86d86ed4
git checkout zerollama/pr0-upstream-86d86ed4

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER="$(xcrun --find clang)" \
  -DCMAKE_CXX_COMPILER="$(xcrun --find clang++)" \
  -DGGML_METAL=ON -DLLAMA_BUILD_WEBUI=OFF -DLLAMA_BUILD_UI=OFF
cmake --build build --target llama-server -j
./build/bin/llama-server --version
# expected: version: 10117 (3375f3a0c)  — Darwin arm64 Metal

Sanity: tools/kokoro, tools/omnivoice, and ggml/src/ggml-metal/eliza-shipped are present.

Proof

  • Local Metal llama-server build on tip 3375f3a0cversion: 10117 (3375f3a0c)
  • GitHub merge status: MERGEABLE (unrelated-history deconflict via merge -s ours)
  • Eliza voice / TBQ source trees retained in the branch tip
  • CI Metal / CUDA Eliza validation (after CMake product wiring, or green stock jobs)

Honest follow-up (not a reason to reject the re-root)

CMake is still stock ggml on this tip so llama-server proves the upstream base compiles. Next commit(s) should re-wire:

  1. Kokoro / OmniVoice / elizainference CMake options
  2. TBQ / QJL / Polar type enums + backend registration

That work is easier on this tip than on the orphan history. Rejecting the re-root does not avoid that work — it only makes it harder.

Out of scope (deliberately)

  • Changing voice / FFI ABI
  • New agent flags unrelated to upstream tracking
  • Full product-parity CMake in this same PR (tracked as immediate follow-up)

Ask

Merge the re-root so Eliza main shares history with ggml-org again. Then land the small CMake/type follow-ups as normal PRs on a living tip — instead of fighting an orphan freeze forever.

angt and others added 30 commits June 26, 2026 15:15
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
* CUDA:  Improve performance via less synchronizations between token (#17795)

* Adds CPU-to-CUDA copy capability to
ggml_backend_cuda_cpy_tensor_async()

* Adds function to relax sync requirements between input copies on
supported backends (CUDA for now)

* Exchanges synchronous copy with async copy function.

* Adds macro guards to allow compilation in non-CUDA builds

* Reworked backend detection in ggml-backend.cpp to avoid linking
conflicts

* Relax requirement of checks in async CUDA copies from backend and buffer type to just buffer type, to avoid linking issues

* Minor cleanup

* Makes opt-in to relax use of explicit syncs more general. Backends like
vulkan which require a synchronization between HtoD copies and graph
execution could also adopt this change now.

* Reintroduces stricter check for CPU->CUDA backend async copy via
GGML_DEVICE_TYPE_CPU.

* Corrects initialization of ggml_backend_sync_mode in
ggml_backend_sched_split initialization

* Simplifies synchronizations to adhere to `saaasg` pattern.

* Apply suggestion from @ggerganov (src->buffer to buf_src)

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* Apply suggestion from @ggerganov (src->buffer to buf_src) v2

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* Apply suggestions from @JohannesGaessler code review

Co-authored-by: Johannes Gäßler <johannesg@5d6.de>

* Adds single-GPU synchronizations to multi-GPU settings to fix hip backend pipeline parallel bugs.

* Scheduler Hardening: Exclude hip/MUSA from copy_from_host CPU split ->
GPU split optimization

* Scheduler Hardening: Re-adding original additional synchronizations for
non-async backends

* Adds disclaimer to hip/musa exclusion of copy_from_host. Highlights that it is out of
precaution, but that no perf-impact is visible, and that it can be
revisited separately anytime.

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
Tests are generally prefixed with -test, so rename export-graph-ops
accordingly.

rpc-server is probably too generic a name for /usr/bin. Because it
should work with any ggml application, it is renamed to ggml-rpc-server.
* [CUDA] Added a cudaMemcpy2DAsync fast path to ggml_cuda_cpy

Add a CUDA ggml_cpy fast path for same-type, same-shape strided copies that are just 2D pitched block copies.
When tensors are not fully contiguous but each row is contiguous, it now uses cudaMemcpy2DAsync instead of the slow element-wise scalar copy kernel.

This fixes the GDN recurrent snapshot update with -np 4, where rollback slots are separated by cache stride gaps.

* Add new tests that execute the new optimized strided copy path

* Return unsupported for strided copy in OpenVINO, as new tests are failing
* opencl: rework FA kernel for f16 and f32

* opencl: flash-attention prefill prepass kernels

- flash_attn_kv_pad_f16    pads the tail KV tile to a BLOCK_N multiple
- flash_attn_mask_pad_f16  pads the matching mask tile
- flash_attn_blk_f16       classifies each KV tile per query block as
                           fully masked / mixed / fully unmasked, so
                           the main kernel can skip fully-masked tiles
                           and the mask lookup for fully-unmasked ones

* opencl: FA kernels for q4_0 and q8_0

* opencl: `set_rows` for f32 to q8_0/q4_0

* opencl: dequant kernels for q4_0 and q8_0

* opencl: add FA tile tuning table with override

* opencl: wire host side for FA

* opencl: q4_0 MoE tensors are also SOA'ed

* opencl: cosmetic fix

* opencl: refactor, also clarify some code paths in comments

* opencl: fix inifity for `-cl-finite-math-only`

---------

Co-authored-by: Li He <lih@qti.qualcomm.com>
* server : reduce logs

* cont : common

* cont : spec

* cont : CMN_ -> COM_
Expose the existing --offline flag to `llama download` so a script can
run it to check whether a model is already cached and ready to be served
without touching the network.

Also fix a latent use-after-free in the URL-task on_done callback:
first_path is block-scoped and was captured by reference, but invoked
after the block ends.

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
* spec: add DFlash v2 support

* dflash: support sliding window attention per layer_types

* docs: add dflash section

---------

Co-authored-by: Kashif Rasul <kashif.rasul@gmail.com>
* jinja: add --dump-prog for debugging

* Update common/jinja/runtime.cpp

Co-authored-by: Sigbjørn Skjæret <1629204+CISC@users.noreply.github.com>

---------

Co-authored-by: Sigbjørn Skjæret <1629204+CISC@users.noreply.github.com>
* Add minicpm5 tool call parser

* Refactor MiniCPM5 PEG parser per review feedback

* Fix jinja min/max API to match Jinja2

* modify by review

* MiniCPM5: use autoparser for XML tool calls and fix grammar preserved-token triggers

* MiniCPM5: fix streaming tool-arg placeholder and remove alt XML markers

* skip min/max attribute tests in -py mode

* test-jinja: use real expected output for min/max attribute tests

* MiniCPM5: revert shared mapper and history fallbacks per review

Drop streaming tool-arg placeholder workarounds from the generic PEG
mapper and restore strict tool-call argument JSON parsing so MiniCPM5
support stays limited to autoparser/diff-analyzer changes.

* chat : refactor minicpm5 back to dedicated parser

* cont : simplify grammar

* cont : refactor

* cont : fixes

* cont : rename template to openbmb-MiniCPM5-1B.jinja

* cont : add message delimiters

* cont : fix tests

---------

Co-authored-by: zhangtao <zhangtao2@modelbest.cn>
Co-authored-by: 张涛 <>
* dflash: refactor draft model conversion

* apply fix for eagle3 convert
…sisted by claude(in debugging and tests) (#24727)" (#25098)
* jinja, chat: add --reasoning-preserve flag

* correct help message
* convert: add dsv4 conversion

* add basic setup

* add llm_graph_input_dsv4

* add save-load state

* add sinkhorn eps - correction by @fairydreaming

* add rope fix

* cleanup dead code

* fix bugs

* support pro model: added by @fairydreaming

* remove redundant V cache

* Chat template

* remove debugging leftovers

* Add mechanism for inlining templates based on architecture

* s/deepseek-v4-flash/deepseek4/g

* s/deepseek-v4-flash/deepseek4/g continued

* enable graph reuse

* enable FA

* fix test llama archs

* rename

* compatibility with antirez ds4 GGUFs

* simplified set_gguf_parameters() by calling super class method, replaced moe.score_func with expert_gating_func.

* reserve worst-case kv-cache

* revert max split inputs

* address review comments

* add padding to enable FA

* pad only the final value of plan.n_kv to 256

* remove built-in cpp chat template

* cont: remove cpp built-in template

* rm outdated test

* replace ggml_view_3d() with ggml_reshape_3d()

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* only support n_seq=1 for now

* remove unused var

* cont: remove unused var

* use scale bias

* use correct ptr for can_reuse

* remove gen-chat-inline-templates.py

* simplify graph reuse

* cont: cleanup

* remove unused inputs

* enable partial checkpointing

* add correct shape for kq_mask + set llama_model_n_swa to 0 for dsv4

* precompute source_idx + add comment about dummy write

* support multi-seq

* remove restored_trim_pos

* use split_equal when possible

* fix indent

* address review comments

* use LLM_KV

* fix ci

---------

Co-authored-by: Piotr Wilkin <piotr.wilkin@syndatis.com>
Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
Co-authored-by: fairydreaming <166155368+fairydreaming@users.noreply.github.com>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…tic (#25005)

* vulkan: extract flops calculation into function

* use flops instead of matmul src0 tensor size for submission threshold

* use unsigned ints
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
* HIP: keep MMQ for gfx900 MoE and Q8_0, use hipBLAS for dense K-quants

Assisted-by: GitHub Copilot CLI

* HIP: tighten conditional block to be explicitly for gfx900

* HIP: Further simplified gfx900 conditional block

* removed unnecessary comment
* vulkan: roll bk loop in matmul for asahi linux

* vulkan: fix inline comment

* vulkan: revert BK-loop unroll change

* vulkan: edit spirv directly for asahi roll bk loop

* vulkan: remove trailing whitespace at the end of comments
* CUDA: fix Gemma E4B MTP FlashAttention

* remove unused template declaration
wanghqc and others added 2 commits July 17, 2026 07:49
Eliza main is a 51-commit orphan history (no merge-base with ggml-org).
Water-test branch starts at pin tip 86d86ed and brings over Kokoro,
OmniVoice, eliza-shipped Metal kernels, and CPU TBQ/QJL/Polar sources.
CMake still stock ggml — llama-server build proves upstream tip compiles;
wiring voice/FFI + type enums is a follow-up commit.
Unrelated histories block GitHub merge. Keep tree at ggml-org 86d86ed +
Eliza overlay (kokoro/omnivoice/eliza-shipped/TBQ sources); mark origin/main
merged without importing stale orphan-tree sources (e.g. dflash-draft).
@odilitime

Copy link
Copy Markdown
Author

Deconflict update: histories were unrelated (~771 add/add). Content merge with -X ours pulled orphan-only sources (e.g. dflash-draft.cpp) that break the ggml tip build.

Switched to git merge -s ours origin/main --allow-unrelated-histories: tree stays at ggml-org 86d86ed4 + Eliza overlay; main is now a merge parent so GitHub can merge cleanly.

Metal llama-server rebuild OK after this commit.

@odilitime

Copy link
Copy Markdown
Author

Deconflict landed (3375f3a0c): git merge -s ours origin/main --allow-unrelated-histories.

  • Tree unchanged from ggml-org 86d86ed4 + Eliza overlay (avoids Frankenstein from content-merging orphan histories)
  • main is now a merge parent → GitHub conflict cleared
  • Metal llama-server OK: version: 10117 (3375f3a0c)

@odilitime odilitime changed the title PR0: track ggml-org tip (86d86ed4) + keep Eliza voice/TBQ trees Track latest ggml-org llama.cpp again (keep Kokoro / OmniVoice / TBQ) Jul 21, 2026
Skip TBQ/QJL/Polar parity gates until types land in ggml.h, keep WebGPU
fixture generation for qwen35, disable OpenMP for wasm, link CUDA against
toolkit stubs in Docker, ignore known HIP VGPR spills, and retry OpenVINO
Windows builds after z-applocal races.
Hosted runners have no NVIDIA driver; GGML_CUDA_NO_VMM avoids linking
libcuda.so.1 so the compile-only ubuntu-cuda-build job can finish.
@odilitime
odilitime marked this pull request as ready for review July 25, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.