[PR #2476] [CLOSED] [Engine] skip file lookahead when serial decode stays resident #4062

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2476
Author: @KeyanHu-git
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/1922-resident-lookahead


📝 Commits (3)

  • 1477f70 serve: skip file lookahead when experts stay resident
  • ba49149 serve: decide resident lookahead after startup plans are final
  • ad947fb merge current main for resident decode prefetch validation

📊 Changes

5 files changed (+132 additions, -0 deletions)

View changed files

📝 CMakeLists.txt (+3 -0)
➕ include/strata/core/resident_decode_prefetch.hpp (+31 -0)
📝 src/program/generate.cpp (+15 -0)
📝 sycl/src/program/generate.cpp (+14 -0)
➕ tests/core/resident_decode_prefetch_test.cpp (+69 -0)

📄 Description

Outcome

Closing this candidate after testing it against 0.2.2 (011c9e60, engine 0.1.47). The redundant prediction work still exists, and the coverage check engages correctly on a fully resident workload. The current measurements do not establish a repeatable throughput gain, and the default-auto comparison has an unexplained output divergence. #1922 remains open.

Problem and approach

RouterLookahead starts before the resident RAM complement is built. Once every expert is in GPU or RAM, prefetch already skips resident data, but decode still submits router predictions and computes their dot products and rankings.

This candidate checks the final GPU map and RAM membership immediately before READY. It disconnects prediction for fully covered serial serving. Partial coverage, batching, elastic KV, independent prediction consumers, and explicit lookahead settings retain prediction. Adaptive exchanges and returned serial prompt loans preserve the coverage required by the decision.

CUDA/HIP and SYCL use the same predicate. Related issue: #1922.

Current-version validation

Candidate ad947fbd against 011c9e60, Ryzen 5 7600X, RX 7900 XTX 24 GiB, Windows, approximately 32 GiB RAM; Coder IQ1_M through the supported GGUF in-place expert source. Both arms used 128K context, int8 KV, MTP, temperature 0, and seed 1922. Each process ran a 64-token warmup followed by 256-token English and code requests. Timing and lookahead statistics were disabled.

Passed

  • 81,552 coverage/lifecycle checks with ASan/UBSan; these include 20,000 modeled exchange cycles.
  • Full CUDA, HIP, SYCL and Metal builds for this revision.
  • Runtime partial coverage retained prediction. Runtime complete coverage disabled it as intended; decode file reads remained zero through adaptive exchanges and the code prompt's loan/return path.
  • Executable hashes, model-pack hashes, source differences and runtime DLLs were checked. Only the five PR files differ between the two source trees.

Throughput evidence

With the installed default --expert-cache auto, both versions allocated 6,885 GPU slots and about 12.92 GiB of resident RAM:

English request Original tok/s Candidate tok/s Change
First randomized pair, candidate then original 66.268 71.659 +8.13%
Diagnostic repeats, original then candidate 73.243 71.999 -1.70%

English output tokens and execution counters matched. The second row was a repeatability check, not another randomized sample. Original-to-original throughput varied by 10.53%, exceeding the first pair's apparent gain. Whole-request CPU time was lower in both candidate runs, but these samples do not establish an end-to-end throughput improvement.

Unresolved output comparison

The code request first diverged at output token 246. Each version reproduced its own sequence on a fresh process. Original MTP acceptance was 155/239; candidate acceptance was 158/231. The planned four-pair benchmark stopped at that first mismatch, so code timings are not treated as equal-work speed comparisons. No answer-quality score was measured.

An explicit lookahead-on control with the candidate binary allocated a different number of auto cache slots and was excluded. A subsequent three-arm control fixed the CLI cache budget to 5,445: original, candidate with prediction disabled, and the same candidate with prediction retained. All three allocated 7,094 slots and produced identical tokens and execution counters for all three requests. That control completed in 203 seconds; it does not explain the 6,885-slot auto result or qualify as a randomized speed comparison.

The specific cause of the auto-path divergence remains unresolved. This candidate therefore has neither a completed output-equivalence check for that configuration nor a demonstrated stable throughput gain. The branch and experiment records are retained for a future evaluation on a current-version CPU-constrained workload.


🔄 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/2476 **Author:** [@KeyanHu-git](https://github.com/KeyanHu-git) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/1922-resident-lookahead` --- ### 📝 Commits (3) - [`1477f70`](https://github.com/Niko1221/Strata/commit/1477f703c01bfea98c64aeb06a65d06c4395879a) serve: skip file lookahead when experts stay resident - [`ba49149`](https://github.com/Niko1221/Strata/commit/ba49149288eedd6208d8086c36b9043a1c08b8cf) serve: decide resident lookahead after startup plans are final - [`ad947fb`](https://github.com/Niko1221/Strata/commit/ad947fbd5a7cd15adf369ba85401d1e450800aac) merge current main for resident decode prefetch validation ### 📊 Changes **5 files changed** (+132 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+3 -0) ➕ `include/strata/core/resident_decode_prefetch.hpp` (+31 -0) 📝 `src/program/generate.cpp` (+15 -0) 📝 `sycl/src/program/generate.cpp` (+14 -0) ➕ `tests/core/resident_decode_prefetch_test.cpp` (+69 -0) </details> ### 📄 Description ## Outcome Closing this candidate after testing it against 0.2.2 (`011c9e60`, engine 0.1.47). The redundant prediction work still exists, and the coverage check engages correctly on a fully resident workload. The current measurements do not establish a repeatable throughput gain, and the default-auto comparison has an unexplained output divergence. #1922 remains open. ## Problem and approach RouterLookahead starts before the resident RAM complement is built. Once every expert is in GPU or RAM, prefetch already skips resident data, but decode still submits router predictions and computes their dot products and rankings. This candidate checks the final GPU map and RAM membership immediately before READY. It disconnects prediction for fully covered serial serving. Partial coverage, batching, elastic KV, independent prediction consumers, and explicit lookahead settings retain prediction. Adaptive exchanges and returned serial prompt loans preserve the coverage required by the decision. CUDA/HIP and SYCL use the same predicate. Related issue: #1922. ## Current-version validation Candidate `ad947fbd` against `011c9e60`, Ryzen 5 7600X, RX 7900 XTX 24 GiB, Windows, approximately 32 GiB RAM; Coder IQ1_M through the supported GGUF in-place expert source. Both arms used 128K context, int8 KV, MTP, temperature 0, and seed 1922. Each process ran a 64-token warmup followed by 256-token English and code requests. Timing and lookahead statistics were disabled. **Passed** - 81,552 coverage/lifecycle checks with ASan/UBSan; these include 20,000 modeled exchange cycles. - Full CUDA, HIP, SYCL and Metal builds for this revision. - Runtime partial coverage retained prediction. Runtime complete coverage disabled it as intended; decode file reads remained zero through adaptive exchanges and the code prompt's loan/return path. - Executable hashes, model-pack hashes, source differences and runtime DLLs were checked. Only the five PR files differ between the two source trees. **Throughput evidence** With the installed default `--expert-cache auto`, both versions allocated 6,885 GPU slots and about 12.92 GiB of resident RAM: | English request | Original tok/s | Candidate tok/s | Change | |---|---:|---:|---:| | First randomized pair, candidate then original | 66.268 | 71.659 | +8.13% | | Diagnostic repeats, original then candidate | 73.243 | 71.999 | -1.70% | English output tokens and execution counters matched. The second row was a repeatability check, not another randomized sample. Original-to-original throughput varied by 10.53%, exceeding the first pair's apparent gain. Whole-request CPU time was lower in both candidate runs, but these samples do not establish an end-to-end throughput improvement. **Unresolved output comparison** The code request first diverged at output token 246. Each version reproduced its own sequence on a fresh process. Original MTP acceptance was 155/239; candidate acceptance was 158/231. The planned four-pair benchmark stopped at that first mismatch, so code timings are not treated as equal-work speed comparisons. No answer-quality score was measured. An explicit lookahead-on control with the candidate binary allocated a different number of auto cache slots and was excluded. A subsequent three-arm control fixed the CLI cache budget to 5,445: original, candidate with prediction disabled, and the same candidate with prediction retained. All three allocated 7,094 slots and produced identical tokens and execution counters for all three requests. That control completed in 203 seconds; it does not explain the 6,885-slot auto result or qualify as a randomized speed comparison. The specific cause of the auto-path divergence remains unresolved. This candidate therefore has neither a completed output-equivalence check for that configuration nor a demonstrated stable throughput gain. The branch and experiment records are retained for a future evaluation on a current-version CPU-constrained workload. --- <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:54 +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#4062
No description provided.