mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4538] [Engine] preserve periodic retry after a low-benefit prefetch closure #5080
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#5080
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/4538
Author: @cmdruid
Created: 10/28/2026
Status: 🔄 Open
Base:
main← Head:bench/prefetch-benefit-retry📝 Commits (1)
48f6fd4[Engine] retain benefit closure reason for periodic prefetch retry📊 Changes
3 files changed (+162 additions, -1 deletions)
View changed files
📝
docs/DETAILS.md(+2 -0)📝
src/core/expert_source.cpp(+3 -1)➕
tools/test_prefetch_gate.py(+157 -0)📄 Description
A prefetch gate closed for low benefit can stay closed indefinitely at a stable cache-room ratio inside the 0.55–0.65 hysteresis band. The next decision incorrectly clears the benefit reason by applying the capacity-reopening threshold. Preserve that reason so the existing 256-window probe runs; a real capacity drop still cancels the probe and requires recovery above the high watermark.
Fixes #4537.
This changes one decision expression, documents the distinction, and adds a CPU regression test that compiles the production decision method with synthetic capacity/counter inputs. No new state, switches, defaults or call sites are introduced.
Validation at commit
48f6fd4, based on release5e8a4cca7d690ac60ca37eb09e7d0e010099ad6d:python3 tools/test_prefetch_gate.py: 31 checks, 0 failures. Includes exact threshold edges, a real capacity drop during a pending benefit retry, repeated benefit closures, unknown room and disabled gating.STRATA_ENABLE_CUDA=ON,CMAKE_CUDA_ARCHITECTURES=120; unchanged toolchain and flags for unpatched/patched controls, GGML3cf03257f219afbe7334045ff7c6a06ac68c627d.conversation_cache_test,conversation_split_failure_test,conversation_memory_test,conversation_file_test,session_save_reclaim_test(5/5).python3 -B -m unittest serve.test_context_overflow serve.test_chat_tool_results serve.test_quiet_cancel serve.test_request_accounting serve.test_session_save_retry(39 tests).Hardware qualification on two RTX 5070 Ti cards is ongoing and will be reported separately from CPU proof. No measured speedup or broad output-equivalence claim is made at submission. The state-transition test does not exercise the full expert source, concurrency or real memory pressure. Targeted HIP/SYCL build help would be useful before marking this ready for review.
AI assistance was used for investigation and implementation; the results above were executed locally and checked against retained output.
Local CUDA qualification results (2026-10-28)
Four independent-boot U/P pairs, ordered UP, PU, PU, UP, on two RTX 5070 Ti 16 GiB cards. U and P use the same CUDA 13.2 Release build, architecture 120, serving layer, weights, expert seed, 262144 context/int8 KV, native MTP spec 4 / threshold 0.5, mmap, prompt checkpoints, and RAM conversation parking. Each boot had cold ~16K input, a natural ~24K appended input with 4096 output tokens, a cached 512-token follow-up, another session, and return to the first. OS caches were preserved; the memory guard was 40 GiB / no swap.
The median paired changes are +3.41% / +1.82%, below the predeclared 10% target. An identical-build four-boot check with identical inputs and outputs ranged from 667.8 to 1202.7 tokens/s in cold prefill and 49.8 to 70.8 tokens/s in 512-token decode. No meaningful throughput improvement is established.
The first slow U run had an open gate with zero closures, 540.4 GB of OS reads and 83.4 seconds of fetch wait; later runs read much less. Other U and P runs both closed and reopened their gates. The GPU sequence did not isolate the stable-band retry failure proven by the CPU regression test. Aggregate end-of-request ratios/flip counts do not prove the reason for a particular closure.
A frozen 16-task quality panel compared native token IDs: all 21 matched U/P generations had identical input and output token IDs. This is a bounded regression check, not broad quality equivalence. Both builds failed mandatory strict-output cases (mostly Markdown fences or extra prose; two schema rubrics were also underspecified), so the campaign did not advance either to full-context, additional lifecycle or gateway candidate qualification. No runtime safety failure occurred in the U/P comparison, and the original production configuration was restored. The patch remains an upstream correctness contribution, not a qualified production performance recommendation.
HIP/SYCL builds are still untested; this PR remains draft. The independent Linux md/NVMe planner assumption is reported separately and is not part of this patch.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.