Skip to content

sync: upstream cherry-picks — virtual experts, Apollo engine, Gemma 4 MoE#16

Open
mikeumus wants to merge 11 commits into
mainfrom
sync-upstream-selects
Open

sync: upstream cherry-picks — virtual experts, Apollo engine, Gemma 4 MoE#16
mikeumus wants to merge 11 commits into
mainfrom
sync-upstream-selects

Conversation

@mikeumus

Copy link
Copy Markdown

Summary

Selective cherry-picks from chrishayuk/larql upstream to bring our fork current through the virtual-experts branch merge (PR chrishayuk#32 + chrishayuk#33).

What's included

Upstream SHA Description
ee611ac Fix infer pipeline — walk_ffn + infer_patched improvements
741225e New larql-experts crate — 20 pluggable virtual expert modules (arithmetic, date, dijkstra, finance, geometry, graph, hash, logic, sql, statistics, trig, unit, …) with registry + caller infrastructure
754090d Apollo KV cache engine — NPY-backed store + routing; unlimited-context engine with checkpoint store + token archive; remote MoE backend (ShardConfig, MoeRouterWeights); trie dispatch; expert HTTP endpoint in larql-server
674b616 Clippy clean-up + Gemma 4 model config fixes
4751d25 Gemma 4 26B codebase cleanup — MoE CPU ops split into sub-modules (expert/forward/math), Metal decode/moe_combine, prompt module, remote_expert.rsmoe_remote.rs rename
c9209ad larql-models cleanup + Dispatcher trait + FilteredDispatcher, mock test suite for session dispatch, Markov residual engine spec
aaf0324 FFN coverage example, patch_down_proj example, virtual-experts dispatch doc
3a5b479 Gemma 4 MoEexperts/mask.rs, q4k_forward MoE path, generate expansion, run_cmd MoE CLI flags
6f55d96 Constrained decode working + extended virtual-experts dispatch docs

Conflict resolutions (all conservative — keep best of both)

  • huggingface.rs (d2ee0d2): kept our etag-based cache validation (stronger than upstream's size-only check; detects remote content changes)
  • ffn/mod.rs + lib.rs (754090d4751d25): merged our LastPositionAblatingFfn/LastPositionInjectingFfn re-exports with upstream's renamed MoE types (RemoteMoeBackend/RemoteMoeError)
  • session.rs (c9209ad): took full upstream Dispatcher trait + FilteredDispatcher + mock tests (HEAD sections were empty stubs)
  • qrank_sweep.py (833c124): kept our .float() cast on the QK matrix (correct for fp8/bf16 models like Kimi-K2)

What was intentionally skipped

  • 7de5208 / 8193f02 / 1f75d52 — residual stream + binary format commits below Architecture B; their substance is already in our bdf7e88 sync
  • 74bfe1d — intermediate benchmark work commit superseded by 4751d25 + 3a5b479
  • 3de34bd / 082634d — PR merge commits (their content is in the cherry-picks above)

Our fork additions preserved

All Divinci-AI-specific additions (fact-editing ablating/injecting backends, etag cache validation, LARQL_API_KEY env var, regression test for rebuild_overrides) are intact.

🤖 Generated with Claude Code

mikeumus and others added 11 commits April 24, 2026 13:52
…rovements)

Upstream commit ee611ac from chrishayuk/larql:
- walk_ffn.rs: improved FFN walking with better expert selection
- infer_patched.rs: inference pipeline fixes
- mod.rs/lib.rs: corresponding module updates
- infer.rs: improved query inference execution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Upstream commit 741225e from chrishayuk/larql.
Adds the larql-experts crate: 20+ pluggable virtual expert modules
(arithmetic, date, dijkstra, finance, geometry, graph, hash, sql,
statistics, string_ops, logic, etc.) with an expert registry and
caller infrastructure in larql-inference. Clean cherry-pick.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dispatch

Upstream commit 754090d from chrishayuk/larql.
Adds: Apollo KV cache engine with NPY store + routing, unlimited
context with checkpoint store and token archive, remote expert
backend (ShardConfig + MoeRouterWeights), grid generation,
trie dispatch, and expert endpoint in larql-server.
Conflict resolution: merged HEAD re-exports (ablating/injecting)
with upstream re-exports (remote_expert types).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use upstream's renamed types: RemoteMoeBackend/RemoteMoeError/moe_remote
instead of the old RemoteExpertBackend/RemoteExpertError/remote_expert names.
Keep our fork's ablating/injecting re-exports alongside the new MoE names.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…generate)

Upstream commit 3a5b479 from chrishayuk/larql.
Adds: experts/mask.rs (MoE routing mask), extended q4k_forward.rs for
MoE, layer_graph/generate.rs expansion, run_cmd MoE flags, and updated
ROADMAPs. Reinstates test_arch_golden.rs (deleted in our fork, upstream
extended it with Gemma 4 MoE golden case).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…patch docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
session.rs: add Dispatcher trait + FilteredDispatcher, updated prompt
builder (compact op{args} format), add mock_tests module with 12 tests.
mod.rs: export Dispatcher + FilteredDispatcher.
test_run_experts.rs: add experts_chat_mode_dispatches_via_stdin test.

All upstream (c9209ad) content was the correct resolution — HEAD sections
were stubs added by our fork's empty initializations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant