From 91393789a6f06f2e56c501e34897efd818402e9c Mon Sep 17 00:00:00 2001 From: jinglei <333364280+FFAX-max@users.noreply.github.com> Date: Thu, 19 Nov 2026 11:34:39 -0800 Subject: [PATCH] docs: XDG_CACHE_HOME moves the calibration folder; set it to a mounted path in a container (#52) --- docs/HOSTING.md | 5 +++++ docs/USAGE.md | 3 +++ 2 files changed, 8 insertions(+) diff --git a/docs/HOSTING.md b/docs/HOSTING.md index 21de56b4..d0e00cd4 100644 --- a/docs/HOSTING.md +++ b/docs/HOSTING.md @@ -287,6 +287,11 @@ Run `calibrate` as the service user, because the calibration file and the CUDA k `~/.cache/rusting_strata`. The first start after an update compiles the CUDA kernels (about 15 s); `/health` answers `503` until the model has loaded. +In a container that folder is lost when the container exits, and the next one starts uncalibrated with only the +`not calibrated on this machine` line to say so. Set `XDG_CACHE_HOME` to a mounted path (the folder is then +`$XDG_CACHE_HOME/rusting_strata`) for both `calibrate` and `serve`, for example `-v /srv/strata-cache:/cache -e +XDG_CACHE_HOME=/cache`. + **Stopping and restarting.** On `SIGTERM` (`systemctl stop` or `restart`) the server answers new requests, `/health` included, with `503` and `Retry-After: 5`, lets the requests it already accepted finish (the queued ones too), saves the routing profile it learned, so that the next start places the experts as well, and then exits. diff --git a/docs/USAGE.md b/docs/USAGE.md index 6526b549..4f765895 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -87,6 +87,9 @@ other MCP clients use, and pass it with `--mcp ` (or `STRATA_MCP`; the def core count (SMT siblings only add contention; on the 6-core/12-thread reference machine 6 beats 12 by ~20%). `rustingstrata calibrate` measures the best chunk and later runs read it from `~/.cache/rusting_strata/strata-.json` unless flags override. + `XDG_CACHE_HOME` moves that folder to `$XDG_CACHE_HOME/rusting_strata` (on Windows it is + `%LOCALAPPDATA%\rusting_strata`). In a container, set it to a mounted path: `docker run --rm` otherwise discards + the file on exit, and the next container runs uncalibrated. - `STRATA_AVX512=1` uses the AVX-512 kernels for experts that run on the CPU, in a build for a CPU that has AVX-512 VNNI and VBMI (a `target-cpu=native` build on such a machine; the release binaries do not have them). Their results differ from the default kernels in the last bits, so greedy output can change at a near tie.