serve: make Phase 2a (device-resident decode) & live prefix caching durable in NixOS module #52
Labels
No labels
human-approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack#52
Loading…
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?
Goal
Harden the validated Option A (Phase 2a Device-Resident Decode Chain) and Option B (Prefix Caching) configuration into
modules/tenstorrent-serving.nixandnixos-llmso that production deployments survive system reboots durably.Context
QWEN36_DEVICE_RESIDENT=1) and Option B (--enable-prefix-caching --mamba-cache-mode align):cfx-llm2requires runtime container options or manual overrides; it needs to be baked into the NixOS module.Acceptance
services.tenstorrent-serving.deviceResidentoption tomodules/tenstorrent-serving.nix.services.tenstorrent-serving.enablePrefixCachinganddeviceResidentin host configuration.--no-async-schedulingis automatically passed when prefix caching is active.nixos-rebuild switchstartstenstorrent-servingwith all self-identifying banners active.Performance advisory (automated review, 2026-09-24)
Before this becomes the durable default, four corrections and one missing measurement.
bench/runs/decode-phase2a-resident-20260922.jsonlused a 26-token prompt, and its text is degenerate ("HT#3333…", sha not the baseline). #53's review already invalidated it. The valid B=1 control is 48.619 ms without resident decode (p150-decode-40-control-20260923T1652Z.jsonl). There is currently no valid measurement of resident decode's performance effect.supports_async_decode: _RESIDENT). Prefix caching refuses async scheduling:qwen36_vllm.py:242, "prefix sidecars require synchronous local execution", which is also why this issue wants--no-async-scheduling. Under prefix caching you therefore get resident decode's cost and correctness surface with at most its sync-mode benefit. Missing measurement: one interleaved A/B ofdeviceResidenton vs off, both arms with prefix caching on, at conc-8, with a realistic prompt and sha/banner checks. If the delta is inside the ~0.5% noise band, ship prefix caching without resident decode.deviceResidentforces the configuration that has a known concurrency defect. The module assertsdeviceResident -> deviceArgmax(modules/tenstorrent-serving.nix:544). Argmax+prefix failed 1 of 32 concurrent requests (prefix-argmax-correctness-fail-20260919T0100Z.jsonl). The one stage-3 pass inphase2a-prefix-e2e.jsonl(32 requests) has a ~78% chance of passing even at the observed ~1/128 rate. The argmax-off prefix arm is bounded at <1.17% by 256 requests (prefix-intermittent-bound-20260919T0230Z.jsonl). Match that bound (≥8×32 requests) on this exact configuration before making it durable.cache-speed-16k-32k.shtest.Housekeeping:
deviceResident/enablePrefixCachingoptions exist (modules/tenstorrent-serving.nix:420,461, fromf092aa3), along with banner checks. What remains is enabling them in nixos-llm plus the tests above.sdpaStreamingand the merge guard (QWEN36_MERGE_BATCH_GUARD=1, #45, proven free) durable in the same host change. That closes the/run-only class from #49 in one reboot-tested deploy.MemAvailable≥ ~4 GB before the verification boot, and usedocker stop -t 60(neverrm -f).