Skip to content

feat(llama-cpp): bump llama.cpp and add the moe_cache_cpu_share option - #13155

Merged
mudler merged 2 commits into
masterfrom
feat/moe-cache-cpu-share
Nov 8, 2026
Merged

mudler merged 2 commits into
masterfrom
feat/moe-cache-cpu-share

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

Description

Moves the pinned llama.cpp to ggml-org/llama.cpp#30966 and adds the model option for the flag that PR introduces.

  • The pin goes to the merge commit e95426f1, 12 commits after the old one. Only that PR touches code the backend uses; the score task patch applies with line offsets only.
  • New option moe_cache_cpu_share (upstream --moe-cache-cpu-share): the share of MoE cache misses that the CPU computes from the host experts instead of uploading them to the GPU once the cache is full. It takes a number from 0 to 1 and does nothing unless moe_cache_mib is above 0. A value outside the range is ignored with a warning.
  • The option is behind its own build macro, LOCALAI_HAS_MOE_CACHE_CPU_SHARE, set in prepare.sh from common/common.h, so a fork on an older llama.cpp still builds and logs a warning.
  • Docs: a row in the options table and an example next to moe_cache_mib. The best value depends on the hardware; upstream ships scripts/moe-cache-tune.py to find it, and the docs point to it.

Notes for Reviewers

  • Checked: the CPU build of grpc-server at the new pin, and ctest 13 of 13 including the new parser tests.
  • Not checked: a run on a GPU with a real model, and the build with the macro off.
  • The bump is its own commit, like earlier bumps. If you prefer, merge it alone first.

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

🤖 Generated with Claude Code

…996dd22f0fe`

Move the pin to the merge commit of ggml-org/llama.cpp#30966, which
adds --moe-cache-cpu-share. The pin was 12 commits behind it.

The score task patch applies with line offsets only, no fuzz or
rejects. grpc-server builds and links on CPU, and its unit tests pass.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Ettore Di Giacinto <[email protected]>
Map the new model option to the upstream --moe-cache-cpu-share flag.
Once the MoE cache is full, this share of the cache misses is computed
by the CPU from the host experts instead of uploaded to the GPU.

The value is a float from 0 to 1. Anything else is ignored with a
warning, like moe_cache_mib. A build macro, set by prepare.sh from
common.h, keeps older upstream forks building: they log a warning and
ignore the option.

Document the option next to moe_cache_mib, with a pointer to the
upstream scripts/moe-cache-tune.py tuning script.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Ettore Di Giacinto <[email protected]>
@mudler
mudler merged commit 7cdc3a9 into master Nov 8, 2026
84 of 86 checks passed
@mudler
mudler deleted the feat/moe-cache-cpu-share branch November 8, 2026 21:03
@mudler-agent mudler-agent added the enhancement New feature or request label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants