server : add --sleep-mode <keep-alive/terminate> to optionally exit process on idle - #25243
Closed
DEV-DUFORD wants to merge 5 commits into
Closed
server : add --sleep-mode <keep-alive/terminate> to optionally exit process on idle#25243DEV-DUFORD wants to merge 5 commits into
DEV-DUFORD wants to merge 5 commits into
Conversation
Frees all resources (including GPU device context) by exiting the process on idle; a supervisor (router or systemd) respawns on demand. Assisted-by: GitHub Copilot CLI
Collaborator
|
it's not the clean solution, but rather a hacky one that doesn't address the root cause please try #25265 , if it's still not working correctly, that's the problem of |
This was referenced Aug 19, 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
Adds a
llama-serverargument for determining what to do to a child process when they hit thesleepstate. I've noticed on two of my rigs (gfx900andgfx906) that when the child process goes into asleepstate, the idle power draw and clocks stay relatively high due to the child process still claiming resources on the GPUs. This results, at least for me, with a decent amount of wasted electricity and higher idle thermals that is super wasteful (mygfx900cards are idling 10C higher in the normalsleepmode vs truly idle)Argument added is
--sleep-mode, options arekeep-alive- Logic as it stands today, child frees resources but is still aliveterminate- New option, on enteringsleepthe child process is terminatedDepending on the system there's probably not too much penalty on just using
keep-alive, I can imagine consumer GPUs idle just fine, but on these old data center cards the trade-off of lettingllama-serverspawn a new child 100% beats the large power draw and thermal drift.Requirements
sleep-idle-seconds, up in the 55C range, when I was expecting more in the 37C area, where they typically idle. That started my investigation, which led to me better understanding how thesleeplogic works for children processes. Springboarding off of this, I made thellama-serverarg by hand, then used copilot to check it, and add a little bit of documentation. Then, went through by hand and refined said documentation.