sched, ggml-meta : pipeline the host KV delivery under split mode tensor - #8
Open
Piggidragon wants to merge 3 commits into
Open
Piggidragon wants to merge 3 commits into
Piggidragon wants to merge 3 commits into
Conversation
A meta event is one event per simple device, recorded and waited for on each device's own stream. set_tensor_async and set_tensor_2d_async take part of the window of a host cache split by head: whole cells from an offset, once per stream, as one 2d copy per stream per device. A mirrored tensor passes the offset through. Add ggml_backend_meta_init_transfer, a meta backend that does not start a communicator, for streams that only move data. Rotate the compute containers of buffers that are only sources of a graph, so tensors bound into a buffer the graph allocator does not own do not pile up. Assisted-by: Claude Opus 5
A meta backend is eligible when each of its simple backends is. Its transfer backend has no communicator, and the headroom check uses the simple device with the least free memory, since a meta buffer allocates the whole ring on every device. A device of the meta type that is not the ggml meta backend stays ordered. test-llama-archs runs the host-resident tensor split with two streams a second time at pipeline depth 1. Assisted-by: Claude Opus 5
The A/B and server gate scripts take LLAMA_KV_SM, as the parallel gate already did. Assisted-by: Claude Opus 5
This was referenced Sep 17, 2026
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
Pipeline the host-to-device delivery of a host-resident KV cache under
-sm tensor, the one case GenerelSchwerz#39 left on the ordered path.The change itself is the last three commits:
ggml-meta : add events and a ranged write for a head-split host cacheset_tensor_async/set_tensor_2d_asyncaccept part of the window of the head-split copy (whole cells from an offset, per stream), as one 2d copy per stream per device.ggml_backend_meta_init_transferbuilds a meta backend without a communicator for the transfer streams.sched : pipeline the host KV delivery under split mode tensortest-alloccase).test-llama-archsaddsMeta -nkvo -np 2 -kvpd 1.docs : measure the pipelined transport under split mode tensordocs/kv-transport-pipelining.md#tensor-parallelism.LLAMA_KV_SMworks for the A/B and server gate scripts.Testing
RTX 4070 (gen4 x16) + RTX 3060 (gen3 x4), CUDA + NCCL, Qwen3.8-27B-UD-IQ2_M,
-sm tensor -nkvo --kv-cpu-pinned -ctk q8_0 -ctv q8_0.llama-benchtg128, A/B/A/B,-kvpb 512:At 16,384 the ordered copy is 104 ms against 31 ms of compute. That is the 3060's x4 link, so the gain is bounded by the slower link, not by the scheduling.
Output is identical at depth 0, 1 and 4 in every gate:
LLAMA_KV_SM=tensor): all 8 tasks125cb9c2082d36cf64e86551f7ef1638, the same hash as a device-resident cache; gemma-45525e3f5ac7337d7(-ts 50,50) and4f8986fb3655a567(-ts 55,45)Existing paths are unchanged: the parallel gate still gives
17f946c340db110bwith-sm noneanddb661b7a08686b97with-sm layerat depth 0 and 1.test-llama-archs -s 1passes on 2, 3 and 4 CUDA devices, andtest-allocpasses.Not done here
Requirements
Assisted-by:commit trailers.🤖 Generated with Claude Code
https://claude.ai/code/session_0145V8xvxxUQMUVbg6ZiCZMg
🤖 Generated with Claude Code