[GH-ISSUE #4355] [Engine] Save a DeepSeek shared-prefix checkpoint when a suffix starts exactly at pin_at #1924

Closed
opened 2026-11-04 01:55:21 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @moniljo on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4355

Area

[Engine] (speed, kernels, models, the server and API)

What do you want to do?

Would you accept a focused fix and regression for the case where a DeepSeek continuation starts exactly at the requested shared-prefix boundary? This is relevant when many questions share a long document, including near-1M inputs. The concern below is source-confirmed control flow; an isolated official-runtime failure has not been reproduced.

Runtime-effect status: unconfirmed static analysis, with combined custom-candidate validation below.

At current main 5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d (v0.2.7), ds4_main.cpp calculates pin_at and checkpoints slot 3 when prompt feeding reaches it (done == pin_at). If an already-held/restored seed ends exactly at that boundary, feeding starts with from == pin_at; a nonempty suffix moves done past it, so that post-feed condition does not save the already-present prefix. Suffix feeding also replaces the ordinary end checkpoints. I am asking whether the dedicated prefix should be saved before that happens.

What do you do today instead?

My custom recipe inserts this one guarded statement immediately after the existing pin_at calculation, before suffix feeding:

if (pin_at != 0 && from == pin_at) m.checkpoint(3);

The original validity rules (r.pin >= 256 and a boundary before the prompt's last token) remain unchanged. The public implementation is four added lines including comments. An upstream patch would contain only this checkpoint concern, separate from Q6 compatibility, GPU expert misses and broader 1M prefill optimizations.

Actual validation and missing regression

A fresh minimal v0.2.7 build containing this statement and two Q6 compatibility additions, without V6b performance features, produced executable 6b78b6ce264dbf790e01c14714f3e0df92668ea6e2fa3b2a793d43c8e1ac7c00 (BUILD receipt cbbbebc0153ab4106b2441da7b619f766a595000a8fae69ab96a0c447e70786e). It passed 1,248 numeric cases in eight fresh owned runs and three short coding smoke requests on Windows/CUDA/SM120a, at 1,048,576-token capacity, with natural EOS/native-zero cleanup. Smoke report SHA: e10cde9562d2c7e3aaf85ed154b3de4f28a6893d77ef8a8be37c16021031ff09.

These combined-candidate results do not isolate the checkpoint fix or establish a full-1M speed gain. The official binary was not model-loaded; no standalone failing-before/passing-after prefix test or HIP build/run has been performed. Recipe provenance is available.

Proposed regression, not yet run: seed a prefix of at least 256 tokens, continue with pin=N, then send a different suffix and check that the exact N-token prefix remains restorable after the ordinary end checkpoints change. Cover zero/invalid pins and boundaries reached during feeding as controls. Would you prefer that isolated test before a small draft PR, and is checkpoint slot 3 the intended owner for this boundary case?

Related: #4206 discusses Qwen's generate.cpp checkpoint density and semantic body-end cuts. This proposal concerns a different DeepSeek ds4_main.cpp equality boundary; I am not claiming the same cause or that the Qwen report validates this change.

Originally created by @moniljo on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4355 ### Area [Engine] (speed, kernels, models, the server and API) ### What do you want to do? Would you accept a focused fix and regression for the case where a DeepSeek continuation **starts exactly at the requested shared-prefix boundary**? This is relevant when many questions share a long document, including near-1M inputs. The concern below is **source-confirmed control flow; an isolated official-runtime failure has not been reproduced**. Runtime-effect status: **unconfirmed static analysis**, with combined custom-candidate validation below. At current main `5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d` (v0.2.7), [`ds4_main.cpp`](https://github.com/Niko1221/Strata/blob/5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d/src/dsv41/ds4_main.cpp#L777) calculates `pin_at` and checkpoints slot 3 when prompt feeding reaches it (`done == pin_at`). If an already-held/restored seed ends exactly at that boundary, feeding starts with `from == pin_at`; a nonempty suffix moves `done` past it, so that post-feed condition does not save the already-present prefix. Suffix feeding also replaces the ordinary end checkpoints. I am asking whether the dedicated prefix should be saved before that happens. ### What do you do today instead? My custom recipe inserts this one guarded statement immediately after the existing `pin_at` calculation, before suffix feeding: ```cpp if (pin_at != 0 && from == pin_at) m.checkpoint(3); ``` The original validity rules (`r.pin >= 256` and a boundary before the prompt's last token) remain unchanged. The [public implementation](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/source/strata/src/dsv41/ds4_main.cpp#L889) is four added lines including comments. An upstream patch would contain only this checkpoint concern, separate from Q6 compatibility, GPU expert misses and broader 1M prefill optimizations. ### Actual validation and missing regression A fresh minimal v0.2.7 build containing this statement **and two Q6 compatibility additions**, without V6b performance features, produced executable `6b78b6ce264dbf790e01c14714f3e0df92668ea6e2fa3b2a793d43c8e1ac7c00` (BUILD receipt `cbbbebc0153ab4106b2441da7b619f766a595000a8fae69ab96a0c447e70786e`). It passed 1,248 numeric cases in eight fresh owned runs and three short coding smoke requests on Windows/CUDA/SM120a, at 1,048,576-token capacity, with natural EOS/native-zero cleanup. Smoke report SHA: `e10cde9562d2c7e3aaf85ed154b3de4f28a6893d77ef8a8be37c16021031ff09`. These combined-candidate results do not isolate the checkpoint fix or establish a full-1M speed gain. The official binary was not model-loaded; no standalone failing-before/passing-after prefix test or HIP build/run has been performed. [Recipe provenance](https://github.com/moniljo/deepseek-uncensored-rtx6000/blob/5a26a9a2efc64e4fbcc5abf17c0d38299926c643/docs/update-027.md) is available. Proposed regression, **not yet run**: seed a prefix of at least 256 tokens, continue with `pin=N`, then send a different suffix and check that the exact N-token prefix remains restorable after the ordinary end checkpoints change. Cover zero/invalid pins and boundaries reached during feeding as controls. Would you prefer that isolated test before a small draft PR, and is checkpoint slot 3 the intended owner for this boundary case? Related: #4206 discusses Qwen's `generate.cpp` checkpoint density and semantic body-end cuts. This proposal concerns a different DeepSeek `ds4_main.cpp` equality boundary; I am not claiming the same cause or that the Qwen report validates this change.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660303151 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1924
No description provided.