Skip to content

serve: opt-in guard for a repeated phrase (repeat_stop_period), and name repetition stops (stop_cause) - #1803

Closed
gt50 wants to merge 2 commits into
Niko1221:mainfrom
gt50:repetition
Closed

gt50 wants to merge 2 commits into
Niko1221:mainfrom
gt50:repetition

Conversation

@gt50

@gt50 gt50 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Title

Issue: relates to #606 and #728

Summary

Two things about replies Strata ends because they repeat:

  • Opt-in: a guard for a short phrase repeated back to back.
  • Always: the stop is named.

Split out of #1789 (which now only carries the Windows AMD images), as AGENTS.md asks: one change per PR, a new feature opt-in.

What changed

Extra Notes

🤖 Generated with Claude Code

gt50 added a commit to gt50/Strata that referenced this pull request Oct 10, 2026
…Niko1221#1155)

The ready-made Windows AMD zip carries no image encoder. setup now uses one
built from tools/vision: --vision cpu with a CPU build (build-vision), and
--vision gpu / yes with a Vulkan build (-DGGML_VULKAN=ON, build-vision-vulkan),
which runs on the Radeon. place_windows_encoder() puts the right build beside
the engine, also after an engine update replaced the folder; without one,
images stay off as before. docs/AMD_HIP.md: "Images on Windows", both builds
and the measurements.

On a Radeon 8060S, 1224 x 1584 photos of documents at 1024 image tokens: about
1 s to encode with Vulkan against about 23 s on the CPU, the same text read.

The other changes this PR carried are now Niko1221#1803-Niko1221#1807. All serve and
tools/test_setup_* test files pass on main fb58e0d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maddoxkkm added a commit to Maddoxkkm/Strata that referenced this pull request Oct 11, 2026
…clean on 0.1.42)

- Niko1221#1838 resident RAM mode: the RAM copy follows the conversation (STRATA_RAM_ADAPT) - the top candidate
  for this memory-bound box (19 GiB complement, budget clamped by free RAM).
- Niko1221#1803 serve: opt-in repeat_stop_period guard for repeated phrases, plus named repetition stats.
- Niko1221#1876 opt-in cumulative GPU energy in the Power card.
Built and running as logs/binaries/strata-142-b.exe; measurements follow.
Note for the tuner: tools/hip/autotune.py's find_tuner() looks for a file literally named 'tune_decode'
(no .exe), three paths, all Linux-shaped; on Windows the binary has to be copied next to the engine as
'logs/binaries/tune_decode' for it to be found (worth fixing upstream).
Maddoxkkm added a commit to Maddoxkkm/Strata that referenced this pull request Oct 11, 2026
…p-server.bat fixed

A (in-tree levers):
- Niko1221#1297 kernel tuning: RAN. The tuner kept the DEFAULT shape in all nine cases (3 expert shapes + 6 mmvq
  shapes) and wrote a table with 0 changes - nothing to gain on gfx1100. The tuner also needs its binary
  copied next to the engine on Windows (autotune.py looks for a literal 'tune_decode').
- Niko1221#1151 SIMT scorer: ADOPTED (STRATA_SELECT_SIMT=1) - +3.9% at 16K and +4.5% at 4K on top of the WMMA
  select, measured at matched budgets after the leak below was cleared.
- Niko1221#1324 LRU: off. 2 GiB is a wash (16K -0.8%, budget -1.4 GiB); 6 GiB costs 14% and crushes the budget to 4.9 GiB.
- Niko1221#1167 rocBLAS table: inert on gfx1100 - prompt_f16() is gfx103x-only ('on gfx103x it is ~2x faster').
- A5 hipBLASLt rows: deferred (our 45-row table already beats upstream's 34; the tuner needs a GPU-exclusive run).
B: Niko1221#1838/Niko1221#1803/Niko1221#1876 applied and NEUTRAL (-2..+2% at both sizes, so kept); its conversational test shows no
   measurable difference either.
C: Niko1221#1913 does not reproduce here - per-entry host cost is flat at 0.77-0.86 ms (their box jumps 3-5x).
   Niko1221#1903's placement axis answered: --expert-cache-per-layer costs 3%. Issue Niko1221#1910 does not apply: the
   interleaved 4K pairs put 0.1.42 +2.1% AHEAD of 0.1.41 (923.6/923.5/962.2 vs 958.7/957.4/953.2).
   Niko1221#1906 answered: reuse works, up to 96% of a turn's prompt reused (1286/1341).

Bug found and fixed: stop-server.bat killed a fixed list of old binary names, so newer A/B engines leaked -
one held 11.4 GiB and crushed the next measurement's RAM budget to 0.0 GiB. It now kills any strata*.exe
(matching tasklist) plus tune_decode; that leak is what made the first group-B/SIMT/per-layer readings unusable.
gt50 added a commit to gt50/Strata that referenced this pull request Oct 14, 2026
…Niko1221#1155)

The ready-made Windows AMD zip carries no image encoder. setup now uses one
built from tools/vision: --vision cpu with a CPU build (build-vision), and
--vision gpu / yes with a Vulkan build (-DGGML_VULKAN=ON, build-vision-vulkan),
which runs on the Radeon. place_windows_encoder() puts the right build beside
the engine, also after an engine update replaced the folder; without one,
images stay off as before. docs/AMD_HIP.md: "Images on Windows", both builds
and the measurements.

On a Radeon 8060S, 1224 x 1584 photos of documents at 1024 image tokens: about
1 s to encode with Vulkan against about 23 s on the CPU, the same text read.

The other changes this PR carried are now Niko1221#1803-Niko1221#1807. All serve and
tools/test_setup_* test files pass on main fb58e0d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qiuzan2001

Copy link
Copy Markdown

Two points (serve.test_server and serve.test_structured pass here, 329 tests): (1) the new repetition message in serve/structured.py:197 tells users to set structured_plain_string, which exists only in the unmerged #1804; git grep structured_plain_string upstream/main finds nothing, so on its own this PR points users at an option that does not exist. (2) stop_cause is also set when the existing #606 one-token guard or the reasoning-loop stop fires, so default responses (and the default structured error text) change even with repeat_stop_period unset; AGENTS.md asks for the default to stay byte-identical, so gating it with the opt-in or splitting it out would match.

@gt50

gt50 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@qiuzan2001 thanks, both points were right. Fixed in c720feb:

  1. The repetition error no longer mentions structured_plain_string. If structured: one-string-field json_schema answered as plain text (opt-in), progress in structured keep-alives #1804 lands, it can add that pointer itself.
  2. stop_cause is now added only when repeat_stop_period is set (2 or more). With the default config, a reply ended by the After a 36,689-token request at 155k, every later request answers one repeated token until the engine reloads #606 one-token guard or by reasoning_loop_recovery is the same as on main, and so is the structured error text. New tests check both. They fail on the previous commit.

serve.test_server and serve.test_structured pass (330 tests). docs/DETAILS.md now says the field comes only with the opt-in.

gt50 and others added 2 commits October 18, 2026 22:48
…d name repetition stops (stop_cause)

Split out of Niko1221#1789. All serve and tools/test_setup_* test files pass on main fb58e0d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ror names no unmerged option

stop_cause was also set when the existing one-token guard (Niko1221#606) or
reasoning_loop_recovery ended a reply, so a default config's replies gained
the field and structured errors changed their text. It is now added only when
repeat_stop_period is 2 or more; with the default, replies and the structured
error are as on main (tests for both). The structured error for a repetition
no longer points at structured_plain_string, which exists only in Niko1221#1804.
Reported by qiuzan2001.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Niko1221

Copy link
Copy Markdown
Owner

Thanks for the pull request.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to review properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Rebase on main if it no longer applies, and re-run your checks on 0.2.0-beta.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the pull request template: the problem and result, and the validation (what you ran, on which revision, what you saw).
  4. Comment /reopen. A check runs and either reopens the pull request or lists what is still missing.

The rules are in CONTRIBUTING.md.

@Niko1221 Niko1221 closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants