mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4844] [CLOSED] [Engine] fix lost experts when an adaptive round ends after the pipelined loop #5208
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#5208
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/4844
Author: @uvlad23
Created: 10/31/2026
Status: ❌ Closed
Base:
main← Head:fix-adaptive-round-after-pipeline-drain📝 Commits (1)
7faa5b9Adaptive tier: mark a round's experts when it ends after the pipelined loop📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
src/program/generate.cpp(+4 -0)📄 Description
Problem and result
With
--pipeline-windows 2and--adapt-async 1on a layer split, in the resident RAM mode, the engine slowly loses experts. A lost expert is in neither the GPU cache nor the RAM copy, so decode reads it from the GGUF. A fresh engine never does that.On my machine this took decode from about 60 to about 40 tok/s over 4.5 days of agent use.
How it happens:
a_lo/a_hi. The pipelined path never set them, so they still hold an older round's values.The old range can also run past the end of
aswaps.The fix: the pipelined path sets
a_lo = 0anda_hi = a_bi = aswaps.size(), so the serial path marks exactly this round.Related discussion
none
Approach
Two lines and a comment in the pipelined branch of step 2 (
AState::CopyBack). A round that ends inside the pipelined loop works as before, because that path does not reada_lo/a_hi. The serial path and the arena are unchanged.I did not compare tokens, because the adaptive tier is not bit-exact between runs (docs/DETAILS.md).
Validation
Setup: RTX 4070 12 GB + Tesla V100 32 GB, layer split 14, 64 GB RAM, Debian 13, driver 580. Qwen3.8-Flash-Next Q5_K_S with
--resident-experts --resident-budget-gib 48 --pipeline-windows 2 --adapt-async 1 --spec 3.Test: a scripted chat through the API with short replies (30 to 70 tokens), long prompts (up to 150K tokens) and conversation switches. Every 10 turns, a probe turn with a tiny prompt checks the
blob reads from the filecounter. On a fresh engine the probe reads 0. A debug build (not part of this PR) also counted lost experts after every round.Passed:
aswaps.c62d5e3) for CUDA:generate.cppcompiles with no errors and no new warnings.Failed:
Not run:
Debug log without the fix: the round that lost 22 experts
Limits
STRATA_ADAPT_ASYNC_BATCH.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.