Repository navigation
ggml: refactor selective expert copying to user code - #29943
Merged
Merged
Conversation
ggerganov
reviewed
Oct 4, 2026
| const int64_t n_expert = src->ne[2]; | ||
| const size_t expert_size = src->nb[2]; | ||
|
|
||
| if (ids != st.ids || (int64_t) st.used.size() != n_expert) { |
Member
There was a problem hiding this comment.
In which situations, the ids == st.ids?
Member
There was a problem hiding this comment.
I see that this case is also handled on master, but it is not clear to me why.
Contributor
Author
There was a problem hiding this comment.
it's because we transfer gate, up and down and they can all re-use the same ids tensors
am17an
force-pushed
the
aman/sched-copy-callback
branch
from
October 4, 2026 15:46
7441797 to
72cb4da
Compare
ggerganov
reviewed
Oct 4, 2026
ggerganov
approved these changes
Oct 4, 2026
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
ggerganov
force-pushed
the
aman/sched-copy-callback
branch
from
October 6, 2026 06:50
528e0a3 to
ca2934f
Compare
ggerganov
reviewed
Oct 6, 2026
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
edwardyoon
pushed a commit
to edwardyoon/focus-llama
that referenced
this pull request
Oct 8, 2026
* ggml: refactor selective expert copying to user code * tests: enroll two models into selective expert copy test * tests: use deepseek2 as test model * improve comment in ggml-backend.h Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * cont: fix whitespace * cont : better comments Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> (cherry picked from commit 6753a03)
sodre90
added a commit
to sodre90/llama.cpp
that referenced
this pull request
Oct 8, 2026
sodre90
added a commit
to sodre90/llama.cpp
that referenced
this pull request
Oct 8, 2026
…ts ahead and with O_DIRECT again The ggml-org#29943 port moved the selective expert upload into sched_copy_experts but left the lookahead source and the staged direct reads behind in the scheduler, where nothing called them. Prefill then copied every non-pool expert from the cold mapping.
kmbandy
added a commit
to kmbandy/llama.cpp
that referenced
this pull request
Oct 8, 2026
Brings LiquidAI d1-3B / d1-omni-600M decision models (ggml-org#30110, ggml-org#30114), CLEF vision, pplx-decider, LFM2.5 encoder, split router child stdout/stderr (ggml-org#29895), MoE expert-copy callback (ggml-org#29943) and general upstream fixes. 27 conflicted files (69 hunks) resolved keeping both sides; fork-line audit on every conflicted file and on the 57 auto-merged co-touched files: no fork lines lost. server-node.cpp ported to the split subproc API. Server keeps the fork's llama_batch decode path and routes decision/joint-head batches through llama_process (common_batch). Fork's non-fatal spec/checkpoint restore kept. Notes: ~/.cache/llama-sync-20261008/ (reports, review, rulings). Backup: backup/pre-upstream-sync-2026-10-08 @ 49e0f85. Not yet compiled. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mclrcha
added a commit
to mclrcha/llama.cpp
that referenced
this pull request
Oct 10, 2026
…-10-10) Conflicts: - ggml-backend.cpp: upstream moved input copies to ggml_backend_sched_copy_input with host weights last (ggml-org#29943); the GGML_SCHED_BATCH_INPUTS fast path now runs in the first loop before falling back to it. - ggml-cuda/fattn-common.cuh: launch_fattn takes upstream async_kv_preload, then our parallel_blocks_fixed (GQA-6 tile launcher updated). - ggml-cuda/fattn-mma-f16.cuh: upstream swizzle refactor (ggml-org#29612); its helpers take ncols2 like the rest of the fork's config getters. - ggml-cuda/gated_delta_net.cu: keep the fork's kernel and launch geometry (its columns_per_block template argument is not upstream's cols_per_warp, ggml-org#30087). - ggml-cuda/mmq.cu: upstream per-tile src1 padding (ggml-org#29953); ggml_cuda_mul_mat_q_src1_nbytes and the MMQ input cache use the worst-case padding so producers and projections with other tiles can share the buffer. - ggml-cuda/mmq-vec-dot.cuh: fork vec_dot kernels pass GGML_PREC_Q8 to the config helpers (ggml-org#30168). - ggml-cuda/mmvf.cu/.cuh: keep both includes and the HIP declarations, upstream warp_size argument. - ggml-cuda/rope.cu: upstream grid-stride rms_norm+mul+rope (ggml-org#28175) with the fork's M-RoPE theta (nchannels instead of gridDim.y) and rope_store_cast. - ggml-cuda/top-k.cu: upstream shape-based selection (ggml-org#28713), RDNA4 tournament kept for few long rows. - src/llama-batch.*: mixed token/embd batches (ggml-org#29622) copy embd rows per entry; other batches keep pointing at the ext rows. - src/llama-context.cpp: expert copy callback also on the second MTP scheduler. - src/llama-graph.cpp: build_rs keeps the GET_ROWS of the ubatch states (GDN fusions, deferred state) and gathers the extra states from the tail like upstream's custom getter path (ggml-org#29856).
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.
Overview
Refactor the selective expert copying added in #15346 to be called from user code. No functional change is expected from this change. The idea is that this will help in #29887 to be complety handed in user-code. After this is merged, the only change there should be in user code.
Additional information
Requirements