mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4296
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2851
Author: @suprfire
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:f-keep-awake📝 Commits (1)
8acf07a--keep-awake N: hold the system awake while the engine serves (#1727)📊 Changes
2 files changed (+56 additions, -2 deletions)
View changed files
📝
docs/DETAILS.md(+8 -0)📝
src/program/generate.cpp(+48 -2)📄 Description
Closes #1727 (the feature request for a native prevent-sleep option during active inference on Windows).
What it changes
A new opt-in engine flag,
--keep-awake N(an argument in the config'sargs):0(or no flag) - off.1- hold the system awake for as long as the engine runs (armed atREADY).2- hold it only while a request runs (request start toDONE/STOP/ERR), and hold the display too.It calls
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED [| ES_DISPLAY_REQUIRED])on the serving thread and clears back toES_CONTINUOUSwhen the arm ends. Windows only; a no-op elsewhere.--keep-awakewithout--serveis refused with a message.What it leaves alone
No default changes: with the flag absent nothing calls
SetThreadExecutionState, so the default path is byte-identical. No new dependency (windows.hwas already included). The2arm hooks the existingBusyScope(busy from a request's start to the end of its iteration), soQUITand the between-request commands (SAVE/RESTORE/VRAM) do not arm it.Why
Windows counts a CPU-bound server as idle. Nothing in the engine asked the system to stay up, so a long prompt read can run into the display and sleep timers, and an S3 sleep kills the running request (the expert arena survives in RAM, so the model does not reload - the request is what is lost).
How I checked it
RTX 3080 Ti 12 GB + Ryzen 9 5900X + 64 GB DDR4, Windows 11 (10.0.26200), engine built from this commit (CUDA 13.4, sm_86), Swift IQ3_XXS,
--keep-awake 1:--keep-awake: SetThreadExecutionState(0x80000001) -> 0x80000000 (error 0)- the return is the previous state, so the request was accepted.powercfg /requests(elevated) lists the engine under SYSTEM while it serves.powercfg /lastwakeconfirm the off-case sleeps).--serve, and--helplists the three values.What I did not test
2arm (only1was measured) and its display hold.#ifdef _WIN32and compiles out on those backends.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.