TECHNOLOGY

llama.cpp Vulkan batched copies: prompt-save time is a state-transfer metric

In this article
THE QUICK TAKE

The b12306 Vulkan batched-copy API targets state-transfer work; keep prompt-save latency, restore correctness and token generation as separate evidence.

llama.cpp b12306 adds Vulkan support for the batched tensor-copy API. The upstream benchmark concerns multi-slot unified-KV prompt-save time. This is a concrete state-transfer optimization, and its reported improvements should remain attached to that operation rather than being relabelled as ordinary token-generation throughput.

Batching copies changes submission work

A state save can involve many tensor-copy requests. Supporting a batched API allows the backend to handle that collection through a different submission path. The release also avoids staging allocation for copies that do not need it. Neither change implies a different language-model arithmetic result. The practical question is how much state-transfer overhead remains in the application’s actual save pattern, including its slot count and bytes per slot.

The benchmark has an explicit unit of work

Upstream reports prompt-save timings with state size and model configuration. Those units are important because they describe an operation that may occur occasionally rather than every generated token. A local comparison should hold the save trigger and state size fixed, then measure generation without saves as a control. Counting an occasional pause reduction as a constant decode-speed improvement would misstate what the API changed.

Restore validates the meaning of the copy

Successful copy completion does not fully validate a checkpoint. Restore the saved state and compare continuation behaviour with the equivalent unsaved execution, using a deterministic or appropriately controlled setup. Include multiple slots with distinguishable contents so accidental cross-slot association is visible. This checks the semantic purpose of the batch, not only that a transfer API returned success and moved the expected aggregate number of bytes.

Do not infer universal copy coverage

The PR distinguishes the new API support from possible future unification of other copy paths. It should not be described as proof that every one-dimensional or two-dimensional transfer now uses the same implementation. Record the actual route when investigating a local result. This article reports the published backend addition and a qualification design, without claiming independent reproduction of the upstream timing table on another GPU.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles