TECHNOLOGY

llama-server sleep: the draft/MTP resource cleanup fixed in May 2026

In this article
THE QUICK TAKE

The patch fixes a particular missing cleanup path. Reported idle memory before the patch and a later confirmation establish different evidence; no paired post-fix memory table was supplied.

A llama-server issue opened on 20 May 2026 reported that GPU memory remained allocated during sleep when using multi-token prediction. Repeated sleep and resume eventually failed with an out-of-memory error. The fix was merged on 21 May 2026. This is a specific resource ownership case, rather than a general explanation for every nonzero idle memory reading.

The reported workload and observations

The reporter used Linux, CUDA and an RTX 3090 with a Qwen3.6-27B MTP model in Q4_K_M format. The issue includes launch commands, fitting settings and allocation logs. With fitting disabled, reported process memory changed from 22034 MiB at startup to 1094 MiB while idle. With fitting enabled, the corresponding observations were 24048 and 1698 MiB. The reporter separately noted 302 MiB idle for the non-MTP variant.

These are the reporter’s observations before the correction. The non-MTP comparison changes the model path, so its residual allocation is not a subtraction that isolates the exact size of leaked objects. Likewise, startup versus idle memory measures release during a transition, rather than a paired benchmark of unpatched and patched builds.

Which ownership path was missing

The patch explanation identifies resources outside the main model initialization object: the speculative decoder, draft context and draft model. The draft context can own GPU KV cache and compute buffers. Clearing only the main object therefore failed to release every relevant owner when entering sleep.

The actual code change adds resets for the speculative decoder, then the draft context, then the draft model, before resetting the main initialization object. Order matters because dependent objects must be destroyed before the objects they reference. The small diff supports this cleanup mechanism; it is more specific evidence than the issue title alone.

Confirmation has a narrower scope

The issue reporter confirmed that the retained MTP memory problem was fixed. The public confirmation does not supply a matched post-patch allocation table, a long-duration stress protocol or a guarantee for all speculative decoding modes. A merged change also needs to be present in the deployed binary before its behavior can be expected.

The log’s eventual allocation failure is consistent with the reported repeated-cycle problem, but a failed allocation elsewhere is not automatically the same bug. Context sizing, other GPU processes and separate resource owners remain possible causes in a different environment. The software reproducibility guide explains why the exact build and command belong with a diagnosis.

Evaluate the full transition

A meaningful check records memory before sleep, during sleep and after resumed inference, then repeats the lifecycle. It also verifies a completed representative request: released memory without successful restoration does not establish a working server. These are proposed validation boundaries, not experiments performed for this article.

The sleep and wake readiness guide offers a related lifecycle framework for another engine. Its engine-specific levels and restoration procedures should not be copied into llama-server without documentation. This case contributes a concrete missing draft cleanup and an author-confirmed fix. It does not establish universal allocator behavior, preservation of every conversation cache, or a quantified post-fix VRAM saving across models.

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