Files
Athena-Deck/docs/experiments/tts-cpu-threads-2026-10-22

Qwen CPU generation-thread comparison ·22 October2026

Michael requested a comparison after the active user request completed. The authenticated endpoint reported zero active requests before the first run and before each thread change. No user request was deliberately interrupted.

Result: no tested setting reaches realtime under concurrent Strata load. Original2generation/2codec threads restored; Strata/TTS/STT loaded, endpoint running, zero active requests at final verification. The requested two physical TTS-only cores plus two shared cores remain unchanged.

Conditions and results

Same synthetic German passage as the preceding shared-core experiment, producing 17.76seconds of24kHz mono PCM16 in every run. Native CPU runtime0.4.2/ABI5, Qwen0.6B Q4/Anna,2codec threads,2stream frames, CPU flash attention off, Nice10. TTS CPUs2–5/8–11; Strata CPUs0–3/6–9, dual IQ3 profile, repeated512-output-token synthetic requests. CPU quota12/RAM59GiB, model/voice/GPU settings unchanged.

Generation threads Run A Run B Mean generation time Mean RTF
2 23.075s 22.656s 22.865s 1.287
3 22.841s 21.836s 22.338s 1.258
4 24.149s 23.020s 23.584s 1.328

Three threads reduce mean wall time by2.3% relative to two; four increase it by 3.1%. Two runs per condition, fixed order2A/3A/4A/4B/3B/2B, no statistical or voice-quality claim. The small difference does not justify a production change. Every run remains slower than playback. Measured longest packet gaps were 0.524/0.624s(two),0.325/0.404s(three),0.344/0.344s(four); smaller individual gaps do not overcome the cumulative audio deficit. No Conduit call or phone playback was tested.

LLM overlap from first content to request end covers90.3–92.5% of speech generation; short gaps between bounded requests remain. Every LLM request generated512tokens. PCM is counted and discarded by the measurement client; Deck's ordinary synthetic job/history outputs are unchanged. No conversational user text, private audio or VPN data was inspected.

Reload caveat and safe restoration

StrataWorker.ensure compares the entire CPU layout, including TTS-only thread fields. Consequently changing the saved generation-thread count causes the next Strata request to reload its existing model even though its CPU mask is unchanged. No application patch/image build/container restart was introduced to change this behavior. Starting with4A, a separate one-token request completes this reload before measurement. Recorded preparation takes49.744s/49.649s/ 60.836s for4/3/2threads respectively; these are excluded from the table.

In3A the first synthetic LLM request includes a56.839s reload. Speech waits for its first content token, so this load time is excluded from TTS timing. However, the process observer captured the prior Strata PID for this run: do not use3A's CPU samples/masks as evidence for the replacement process or compare its first request wall time as LLM throughput. Subsequent runs observe warmed workers.

threads.py is an Athena-specific maintenance helper, not an installed service. It validates the existing CPU plan, saves only that non-secret CPU configuration as thread-baseline.json, changes only the generation count atomically with owner65534/mode0600, and terminates only the identified idle Qwen worker. Deck's existing residency loop reloads it. warm uses the same neutral short phrase before measurement; warm-llm handles the reload caveat above. API credentials enter through stdin only, never arguments/files/output. API status and owned process metadata are the only live diagnostic data read.

Each operation refuses to begin during ordinary active requests. These checks are not an atomic maintenance lock; no concurrent user-request race was observed. bench.py additionally aborts synthesis after a packet arrives beyond60seconds; this is a measurement bound, not a hard realtime watchdog. No bound was reached. Its underlying request/socket limits still apply if no packet arrives.

Final saved CPU settings match the baseline and the resident Qwen command confirms2generation/2codec threads. Existing image8cf88a02e30444e8 and all published models/voice/profile settings remain in use. No automatic monitoring, container, persistent hook or new dependency was installed.

Reproduction, native installation and rollback

Scoped maintenance directory: /opt/athena-deck-dev/tts-cpu-threads-20261022. Local scripts and sanitized JSON results are included here. Run only with explicit idle time and the existing API credential supplied as stdin JSON. threads.py select 2|3|4, then warm-llm, warm, then bench.py LABEL; restore select 2 and warm both models afterwards. The helper's process discovery/paths target today's named Athena container.

The benchmark accepts --deck-pid MAIN_PID for native Debian/systemd worker discovery. Native qualification uses the same existing CPU policy, ownership, runtime and worker reload procedure described inCPU_PARTITION.md; adapt state paths and physical CPU topology explicitly rather than copying Athena IDs or the container-specific maintenance helper. This experiment adds no production code, runtime package or installer dependency. Full native host restore remains the separately documented open qualification requirement.

Rollback from any trial: at idle restore the saved CPU policy, reload only the owned speech worker, complete Strata's normal reload, and verify both are ready. No model, voice, chat, job schedule, profile or credential deletion is needed.