[GH-ISSUE #1684] [Feature]: a repeatable CPU prompt-read share: auto changes short-prompt outputs run to run, a fixed share does not #673

Closed
opened 2026-11-04 01:44:59 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @KarlGrier on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1684

What do you want to do?

Keep v0.1.41's CPU prompt-read share (about 17-21 % faster first tokens on short prompts here) and still get the same output for the same input. That would keep "same request, same answer" checks and conversation resume checks working.

With the default (STRATA_PREFILL_CPU_SHARE unset, which behaves as auto for chunks below 1,024 tokens), the output of a short prompt changes from run to run. auto times layers with and without the share and keeps sharing by wall time, so which experts the CPU computes (in its own activation format) depends on timing. A fixed share repeated in every case we tried, and here it was as fast as auto or faster. Could the default become repeatable, for example auto deciding each layer's share once and then keeping it, or a fixed share by default? Or could the docs say that a fixed value repeats and auto does not?

Repeatability, stock v0.1.41, 2026-10-09. strata generate --stats, 1,024 tokens after a 136-token math prompt and a 151-token code prompt, greedy and seeded sampling (seed 11, temperature 1.0). The expert cache was held fixed (--expert-cache 3500 --adapt-swaps 0 --suffix-draft 0). Two separate engine starts per setting:

STRATA_PREFILL_CPU_SHARE items whose two runs gave the same output prompt read (ms)
unset (auto, the default) 0 of 4 406-505
0.4 (fixed) 4 of 4 413-437
0 (off) 7 of 7 on 2026-10-08 (these four plus 2K / 32K / 112K-token prompts); the same bytes as v0.1.40.2 502-545

On 2026-10-08 two default runs of the same seven items also agreed on only the three long-prompt items, which the share does not touch.

Speed, served, stock v0.1.41, 2026-10-09. A B C C B A (auto / 0.4 / off), a fresh server per arm. A 9.5K-token and two ~600-token warm-ups, then 6 prompts of 512 and 6 of 1,000 tokens per arm, each a different text, 64 tokens out:

prompt auto TTFT (engine read) 0.4 off
512 tokens 579 ms (547) 576 ms (545) 693 ms (664)
1,000 tokens 716 ms (685) 679 ms (648) 864 ms (834)

The two arms of each setting were within 1 %.

What it breaks for us. With the share on (measured on our local build, which carries a conversation cache), a 96-token follow-up read after 5,726 reused tokens is not repeatable. Two identical direct reads of the same conversation differ in 31 of 1,536 teacher-forced argmax tokens. So a resumed conversation cannot be checked bit for bit against a direct read. With the share off, both are identical. Quality looked unchanged. Teacher-forced NLL on vs off was −0.010 nats on average over six 16K-112K texts read with a 700-token last chunk, about as much as two other rounding-level changes in our build move the same texts, and within ±0.002 nats on two short texts. For now we run with STRATA_PREFILL_CPU_SHARE=0.

Setup: RTX 5080 16 GB + RTX 4060 Ti 8 GB (helper expert cache, --expert-cache-device1 3300), Ryzen 9 9950X3D (16 cores), 96 GB DDR5, Linux 7.0, CUDA 13.3, Qwen3.8-Flash-Next GSQ-RCO IQ3_S, --prefill auto:16384 --spec 4 --kv int8 --kv-resident 32768, STRATA_IO_THREADS=64.

Not tested: whether a fixed share stays repeatable in served sessions with the adaptive tier on, values other than 0.4, other CPUs or GPUs, AMD (HIP), a layer split, and STRATA_PREFILL_CPU_SHARE_MAX above 1,024. Related: #1595 (the default's speed on a V100 with every expert in VRAM).

Measured and drafted with Claude Code.

Originally created by @KarlGrier on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1684 ### What do you want to do? Keep v0.1.41's CPU prompt-read share (about 17-21 % faster first tokens on short prompts here) and still get the same output for the same input. That would keep "same request, same answer" checks and conversation resume checks working. With the default (`STRATA_PREFILL_CPU_SHARE` unset, which behaves as `auto` for chunks below 1,024 tokens), the output of a short prompt changes from run to run. `auto` times layers with and without the share and keeps sharing by wall time, so which experts the CPU computes (in its own activation format) depends on timing. A **fixed** share repeated in every case we tried, and here it was as fast as `auto` or faster. Could the default become repeatable, for example `auto` deciding each layer's share once and then keeping it, or a fixed share by default? Or could the docs say that a fixed value repeats and `auto` does not? **Repeatability, stock v0.1.41, 2026-10-09.** `strata generate --stats`, 1,024 tokens after a 136-token math prompt and a 151-token code prompt, greedy and seeded sampling (seed 11, temperature 1.0). The expert cache was held fixed (`--expert-cache 3500 --adapt-swaps 0 --suffix-draft 0`). Two separate engine starts per setting: | `STRATA_PREFILL_CPU_SHARE` | items whose two runs gave the same output | prompt read (ms) | |---|---|---| | unset (`auto`, the default) | **0 of 4** | 406-505 | | `0.4` (fixed) | **4 of 4** | 413-437 | | `0` (off) | 7 of 7 on 2026-10-08 (these four plus 2K / 32K / 112K-token prompts); the same bytes as v0.1.40.2 | 502-545 | On 2026-10-08 two default runs of the same seven items also agreed on only the three long-prompt items, which the share does not touch. **Speed, served, stock v0.1.41, 2026-10-09.** A B C C B A (auto / 0.4 / off), a fresh server per arm. A 9.5K-token and two ~600-token warm-ups, then 6 prompts of 512 and 6 of 1,000 tokens per arm, each a different text, 64 tokens out: | prompt | `auto` TTFT (engine read) | `0.4` | off | |---|---|---|---| | 512 tokens | 579 ms (547) | **576 ms (545)** | 693 ms (664) | | 1,000 tokens | 716 ms (685) | **679 ms (648)** | 864 ms (834) | The two arms of each setting were within 1 %. **What it breaks for us.** With the share on (measured on our local build, which carries a conversation cache), a 96-token follow-up read after 5,726 reused tokens is not repeatable. Two identical direct reads of the same conversation differ in 31 of 1,536 teacher-forced argmax tokens. So a resumed conversation cannot be checked bit for bit against a direct read. With the share off, both are identical. Quality looked unchanged. Teacher-forced NLL on vs off was −0.010 nats on average over six 16K-112K texts read with a 700-token last chunk, about as much as two other rounding-level changes in our build move the same texts, and within ±0.002 nats on two short texts. For now we run with `STRATA_PREFILL_CPU_SHARE=0`. Setup: RTX 5080 16 GB + RTX 4060 Ti 8 GB (helper expert cache, `--expert-cache-device1 3300`), Ryzen 9 9950X3D (16 cores), 96 GB DDR5, Linux 7.0, CUDA 13.3, Qwen3.8-Flash-Next GSQ-RCO IQ3_S, `--prefill auto:16384 --spec 4 --kv int8 --kv-resident 32768`, `STRATA_IO_THREADS=64`. Not tested: whether a fixed share stays repeatable in served sessions with the adaptive tier on, values other than 0.4, other CPUs or GPUs, AMD (HIP), a layer split, and `STRATA_PREFILL_CPU_SHARE_MAX` above 1,024. Related: #1595 (the default's speed on a V100 with every expert in VRAM). Measured and drafted with Claude Code.
Author
Owner

@agnaylor commented on GitHub (Oct 11, 2026):

Data point from 2× Arc Pro B70 (SYCL, engine 0.1.41 at fb58e0d).

Coder IQ1_M fully VRAM-resident (--stream-experts, STRATA_MIRROR_MIB=0), greedy (temp 0, fixed seeds), 21 code/reasoning prompts: two separate server runs on the same card with the same config gave different text on 11 of 21.

IQ2_XS on the same card with a 25 GiB host mirror was byte-identical on 21 of 21 across runs. Within one server run, IQ1_M was byte-identical with and without the MTP draft.

This is consistent with the auto CPU prompt-read share described here. We did not test a fixed share.

<!-- gh-comment-id:6106327957 --> @agnaylor commented on GitHub (Oct 11, 2026): Data point from 2× Arc Pro B70 (SYCL, engine 0.1.41 at fb58e0d). Coder IQ1_M fully VRAM-resident (`--stream-experts`, `STRATA_MIRROR_MIB=0`), greedy (temp 0, fixed seeds), 21 code/reasoning prompts: two separate server runs on the same card with the same config gave different text on 11 of 21. IQ2_XS on the same card with a 25 GiB host mirror was byte-identical on 21 of 21 across runs. Within one server run, IQ1_M was byte-identical with and without the MTP draft. This is consistent with the `auto` CPU prompt-read share described here. We did not test a fixed share.
Author
Owner

@KarlGrier commented on GitHub (Oct 12, 2026):

Thanks to @nekomario28 for the docs note in #1687, and to @Niko1221 for taking it into v0.1.42. A follow-up on v0.1.42 with the issue's two-card setup: a fixed STRATA_PREFILL_CPU_SHARE=0.4 repeated 4 of 4 items over two starts, reached the first token 15 % and 21 % sooner than 0 on 512- and 1,000-token prompts (583 vs 690 ms, 674 vs 856 ms), and passed our checks against llama.cpp (teacher-forced NLL, needles, sampler tests), so we're switching from 0 to 0.4.

One catch, for anyone setting the share by hand: with an explicit value it covers chunks below STRATA_PREFILL_CPU_SHARE_MAX, which then defaults to 3072 (1024 when the share is left unset). Here it paid up to about 1,500 tokens and cost above that: at 3,000 tokens the first token took 28 % longer with the default limit than with 1024 (1.24 vs 0.97 s), and at 2,000 tokens 7 % longer (0.97 vs 0.91 s). So we also set STRATA_PREFILL_CPU_SHARE_MAX=1792, which kept the gain at 512 to 1,500 tokens and removed the cost above it.

Measured and drafted with Claude Code.

<!-- gh-comment-id:6117080376 --> @KarlGrier commented on GitHub (Oct 12, 2026): Thanks to @nekomario28 for the docs note in #1687, and to @Niko1221 for taking it into v0.1.42. A follow-up on v0.1.42 with the issue's two-card setup: a fixed `STRATA_PREFILL_CPU_SHARE=0.4` repeated 4 of 4 items over two starts, reached the first token 15 % and 21 % sooner than `0` on 512- and 1,000-token prompts (583 vs 690 ms, 674 vs 856 ms), and passed our checks against llama.cpp (teacher-forced NLL, needles, sampler tests), so we're switching from 0 to 0.4. One catch, for anyone setting the share by hand: with an explicit value it covers chunks below `STRATA_PREFILL_CPU_SHARE_MAX`, which then defaults to 3072 (1024 when the share is left unset). Here it paid up to about 1,500 tokens and cost above that: at 3,000 tokens the first token took 28 % longer with the default limit than with 1024 (1.24 vs 0.97 s), and at 2,000 tokens 7 % longer (0.97 vs 0.91 s). So we also set `STRATA_PREFILL_CPU_SHARE_MAX=1792`, which kept the gain at 512 to 1,500 tokens and removed the cost above it. Measured and drafted with Claude Code.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156182500 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#673
No description provided.