mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2566] [CLOSED] SYCL: Fix concurrent prefix cache #4132
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4132
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2566
Author: @rriggs
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:issue-2518-concurrent-prefix-cache📝 Commits (4)
6b6d499sycl: port the #1906 slot-checkpoint fix to the SYCL enginea94780bsycl: message-boundary checkpoints reach past a long final turnd731d04sycl: mirror each read's checkpoints into its batch slot as they are taken7e63236sycl: an admission carries every checkpoint that prefixes the conversation📊 Changes
1 file changed (+48 additions, -5 deletions)
View changed files
📝
sycl/src/program/generate.cpp(+48 -5)📄 Description
SYCL: Fix concurrent prefix cache
Issue: Resolves #2518, #1906 for SYCL
Summary
Concurrent requests stop using the prompt cache: with --batch 2 or more, a client whose prompts share a prefix gets a full re-read on every request after the first, where --concurrency 1 reuses the cache. Three changes fix it: the message-boundary scan now reaches past a long final turn, each batch slot keeps the checkpoints its read takes, and an admission carries every checkpoint that prefixes the conversation instead of only the longest.
Builds on #2384 (the slot → solo → slot checkpoint fix) and ports it to SYCL; that and the two remaining failure shapes it left open are the ones here.
What changed
include/strata/program/message_boundary.hpp(via the sycl/ copy's call site; the header is shared)message_checkpoint_boundary()scanned back from the new assistant turn-token for the previous turn-token, giving up after max_tail = 1024 tokens. A final user turn longer than that — a 2,048-token question over a shared context: a benchmark's depth cell, or a RAG request — meant the boundary between the shared context and the question was never found, so no checkpoint was taken there and every later request over the context re-read all of it. The call site now passes max_tail = 16384; the scan is token comparisons, so the cost is trivial.sycl/src/program/generate.cppExtra Notes
Measured on an Arc Pro B70 (32 GB), Flash-Next IQ3_S, --batch 4, --max-context 131072, four concurrent conversations of ~20.9K tokens each sharing context with distinct questions:
The message-boundary checkpoint is behind STRATA_CACHE_MESSAGE_BOUNDARY=1 (opt-in, as before); the two new paths only matter when that is on. Nothing outside the listed files changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.