In this article
Measure graph allocation separately from the KV cache and compare aligned with unaligned workloads.
The December 3 llama.cpp build b12952 includes a change to the candidate mask in the DeepSeek V4.1 indexer. Pull request #33495 describes applying a compact per-block mask to a reshaped scores tensor by broadcasting in place. When the compressed dimension is not a multiple of the block size, the old path remains. The change is relevant to peak workspace, and its effect depends on the execution path.
Ask which memory is shrinking
The indexer selects candidates for sparse attention. The scoring graph needs to exclude positions, and one representation can hold that mask at a larger shape than necessary. A smaller broadcast mask can represent the same restrictions. The upstream notes describe four 640 MiB tensors alive near the measured peak before the change. That is a developer observation for one setup. Model weights, cache, workspace and allocator reservations each contribute to peak device usage.
Compare realistic request shapes
Benchmark a fixed model revision, quantization, backend and concurrency. Include prompts on each side of the shape boundary described in the pull request. Start with a cold process for each configuration and capture live and reserved device memory after loading and during prefill. At long lengths also record how much memory is used before the next request, so temporary allocations and reusable buffers can be interpreted separately.
Check semantics before using the headroom
For a fixed seed and sampling configuration, compare available output logits or deterministic responses on the two builds. Include padded and unaligned inputs where the fallback remains active. Use the project’s recommended numerical tolerance for the backend. A lower memory peak is useful only when the candidate selection and results satisfy the existing service checks.
Revisit the service limit
Increase context or concurrency in small steps on a staging worker. Keep latency and peak memory in each result row. The practical gain is whichever workload can be served more reliably within the device limit. If the traffic often uses the unchanged fallback, leave the existing headroom in place.
Sources
Related reading
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.