From 027986e8ab3d03b4e7e3b4e7943f96d55e1aeb4c Mon Sep 17 00:00:00 2001 From: Zauberio <95449991+Zauberio@users.noreply.github.com> Date: Tue, 29 Sep 2026 11:18:54 +0200 Subject: [PATCH] Windows: name the Task Scheduler load throttle (24x) and how to fix it The expert-arena load runs at ~0.05 GiB/s (13-14 min to ready) when the serve is started from Task Scheduler with its registration defaults (Priority 7 / Below normal, least-privilege token), versus 1.4-1.5 GiB/s (~35 s) from a terminal or SSH - same binary, args and cache state. - docs/DETAILS.md: measured table + the two registration settings that fix it - src/program/generate.cpp: when load_gib_per_second() < 0.2 GiB/s, print a hint naming this cause under the load line --- docs/DETAILS.md | 22 ++++++++++++++++++++++ src/program/generate.cpp | 13 +++++++++++++ 2 files changed, 35 insertions(+) diff --git a/docs/DETAILS.md b/docs/DETAILS.md index 1a6e0203..70d1cebf 100644 --- a/docs/DETAILS.md +++ b/docs/DETAILS.md @@ -216,6 +216,28 @@ install; `START-HERE.bat --calibrate` (Linux: `./setup.sh --calibrate`) does it speed with each setting and keeps one only when it is more than 3% faster. The result is remembered per PC and model (in the settings file next to the data folder's record), so updates keep it. +### Running it at startup (Task Scheduler) + +To have the model up at logon, people start the serve from **Task Scheduler** (or a service). Beware: Windows +throttles such contexts, and the model's ~40 GB expert load then crawls at **~0.05 GiB/s (13-14 minutes)** +instead of **~1.4-1.5 GiB/s (~35 seconds)** - a 24x slower start. Measured on an RTX 5070 Ti + Ryzen 7 9800X3D ++ NVMe, same binary, same args, same cache state: + +| How the serve starts | Expert load | +| --- | ---: | +| Double-click / terminal / SSH | 1.42-1.52 GiB/s (~35 s) | +| Task Scheduler with its defaults | 0.05 GiB/s (821-841 s) | +| Task Scheduler with the two settings below | 1.42 GiB/s (35 s) | + +In the task's properties set both of these (the defaults are the opposite): + +- **Priority level: Normal** (Options tab; the default is Below normal), and +- **Run with highest privileges** (General tab; without it the task runs with a limited user token - which + also strips `SeLockMemoryPrivilege`, the privilege Windows large pages need). + +(Both were changed at once, so the isolated effect of each is not measured.) If the model still starts +slowly, the engine prints a hint under its `loaded ... GiB at ...` line naming this cause. + ### Chat in the terminal (optional) ``` diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 0364a73e..cf1c4740 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -1711,6 +1711,19 @@ int main(int argc, char** argv) { std::fprintf(stderr, "strata generate: loaded %.2f GiB at %.2f GiB/s\n", (double) strata::kernels::cpu::expert_layout().total / (1024.0 * 1024 * 1024), arena_src.load_gib_per_second()); + // A rate under ~0.2 GiB/s is not the hardware. Task Scheduler / service contexts throttle this + // read+fill about 24x (measured 0.05 vs 1.42 GiB/s for the same binary, args and cache state; the + // scheduler's defaults - Below normal priority and a least-privilege token - were the only + // difference between the runs). Say so instead of letting the user blame the disk; see + // docs/DETAILS.md, "Running it at startup (Task Scheduler)". + if (arena_src.load_gib_per_second() > 0.0 && arena_src.load_gib_per_second() < 0.2) { + std::fprintf(stderr, + "strata generate: hint: ~24x below what this hardware streams from a normal " + "launch. If Strata is started by Task Scheduler or a service, register the task " + "with Priority 4 (Normal) and 'Run with highest privileges' - the scheduler's " + "defaults (Below normal + a least-privilege token) throttle the load. See " + "docs/DETAILS.md ('Running it at startup').\n"); + } srcp = &arena_src; } strata::kernels::cpu::ExpertPool pool(o.pool_workers, /*pin=*/true, /*host_works=*/!o.no_host_worker);