[PR #2384] [CLOSED] Batch slots keep a conversation's turn checkpoints across slot -> solo -> slot moves (#1906) #4017

Closed
opened 2026-11-07 15:32:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2384
Author: @davidbhoward
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix-1906-slot-checkpoints


📝 Commits (2)

  • 7917a62 Batch slots keep a conversation's turn checkpoints across slot -> solo -> slot moves (#1906)
  • 12b35a9 pick_slot: the turn-boundary match only where the slot and the prompt part ways; tests

📊 Changes

3 files changed (+60 additions, -4 deletions)

View changed files

📝 serve/server.py (+25 -4)
📝 serve/test_parallel.py (+22 -0)
📝 src/program/generate.cpp (+13 -0)

📄 Description

Issue: Resolves #1906

Summary

With "parallel": 2 on a layer split (pipelined groups of one slot) and thinking on, most turns of a two-agent session read their whole history again. Two causes, both small:

  1. A request that leaves its slot for the solo path and comes back (the hand-back to the solo path when a slot is left alone) loses the slot's turn checkpoints. The client's next turn comes back without the reply's thinking, so it only matches up to that turn boundary, finds no checkpoint, and reads from token 0.
  2. pick_slot skips the held-prefix choice whenever groups are pipelined (if gs:), so the returning request can be admitted over the other conversation's slot. Groups of one slot have no pad rows and keep their conversation, so this now only applies to gs > 1, and a slot that matches up to its last turn boundary counts as holding the conversation.

What changed

  • src/program/generate.cpp: when a slot gives back all it holds, its checkpoints move into the main session's chain with the conversation (they stay valid, the main session holds the same tokens).
  • serve/server.py: if gs: -> if gs > 1:, and held_prefix also counts a common start that covers at least half of what the slot holds.

Nothing else. Output is unchanged: this only decides which cached state a turn continues from.

Extra Notes

This PR was written and posted by Claude (an AI assistant), at the request of the fork's owner, @davidbhoward.

Measured on 2x RTX 3090, layer split 25, IQ3_S, 262144, "parallel": 2, on 296b59d2 with and without this change. Two clients with reasoning_effort: low, 6 turns each on a ~31K history, history sent back without the thinking, two runs each:

turns that read the whole history (2 expected) time reading
main 10, 10 95 s, 95 s
this change 2, 2 27 s, 28 s

At 235-245K histories the same miss costs about 57 s per turn. Built and tested on CUDA only; the change is host code, but I did not build HIP or SYCL. The reproduction script is small and I can attach it if useful.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2384 **Author:** [@davidbhoward](https://github.com/davidbhoward) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-1906-slot-checkpoints` --- ### 📝 Commits (2) - [`7917a62`](https://github.com/Niko1221/Strata/commit/7917a626bce900ad68ae97aa5bb93f134a2d234b) Batch slots keep a conversation's turn checkpoints across slot -> solo -> slot moves (#1906) - [`12b35a9`](https://github.com/Niko1221/Strata/commit/12b35a93dffaa461ce354b8db05e2fd8a1362c1b) pick_slot: the turn-boundary match only where the slot and the prompt part ways; tests ### 📊 Changes **3 files changed** (+60 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+25 -4) 📝 `serve/test_parallel.py` (+22 -0) 📝 `src/program/generate.cpp` (+13 -0) </details> ### 📄 Description Issue: Resolves #1906 ## Summary With `"parallel": 2` on a layer split (pipelined groups of one slot) and thinking on, most turns of a two-agent session read their whole history again. Two causes, both small: 1. A request that leaves its slot for the solo path and comes back (the hand-back to the solo path when a slot is left alone) loses the slot's turn checkpoints. The client's next turn comes back without the reply's thinking, so it only matches up to that turn boundary, finds no checkpoint, and reads from token 0. 2. `pick_slot` skips the held-prefix choice whenever groups are pipelined (`if gs:`), so the returning request can be admitted over the other conversation's slot. Groups of one slot have no pad rows and keep their conversation, so this now only applies to `gs > 1`, and a slot that matches up to its last turn boundary counts as holding the conversation. ## What changed - `src/program/generate.cpp`: when a slot gives back all it holds, its checkpoints move into the main session's chain with the conversation (they stay valid, the main session holds the same tokens). - `serve/server.py`: `if gs:` -> `if gs > 1:`, and `held_prefix` also counts a common start that covers at least half of what the slot holds. Nothing else. Output is unchanged: this only decides which cached state a turn continues from. ## Extra Notes This PR was written and posted by Claude (an AI assistant), at the request of the fork's owner, @davidbhoward. Measured on 2x RTX 3090, layer split 25, IQ3_S, 262144, `"parallel": 2`, on `296b59d2` with and without this change. Two clients with `reasoning_effort: low`, 6 turns each on a ~31K history, history sent back without the thinking, two runs each: | | turns that read the whole history (2 expected) | time reading | |---|---|---| | main | 10, 10 | 95 s, 95 s | | this change | 2, 2 | 27 s, 28 s | At 235-245K histories the same miss costs about 57 s per turn. Built and tested on CUDA only; the change is host code, but I did not build HIP or SYCL. The reproduction script is small and I can attach it if useful. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:30 +07:00
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#4017
No description provided.