Skip to content

prefill: release copied Windows expert pages after host staging - #1520

Closed
W1nge wants to merge 1 commit into
Niko1221:mainfrom
W1nge:codex/windows-prefill-staging-release
Closed

W1nge wants to merge 1 commit into
Niko1221:mainfrom
W1nge:codex/windows-prefill-staging-release

Conversation

@W1nge

@W1nge W1nge commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

On Windows, prefill copies expert weights from file mappings into the Stager's buffers, but the source pages can remain in the process working set after the copy. With a resident CPU expert pool, these duplicate pages can consume the remaining RAM during a long prompt.

Keep the source and expert identity on stable-pointer jobs and call the existing ExpertSource::release after the host copies complete, before publishing each job as ready. Stable pointers still use memcpy; transient blobs keep 0.1.41's copy_blobs batching. The mapping, resident RAM copies and CUDA-registered buffers remain intact. This uses the existing opt-in STRATA_FILE_RELEASE=1; it adds no setting or numerical change.

Validation:

  • Rebased onto 0.1.41 (fb58e0d); three files, +22/-13. The Stager definition matches the model-tested integrated build byte for byte.
  • Windows, CUDA 12.4.131, SM60/SM75, RTX 2080 Ti + Tesla P100, driver 537.13: engine build, file_expert_source_test and gr_parity --selftest pass.
  • The integrated 0.1.41 build passed a bounded 100-response comparison/regression, including scalar mmap staging, batched unbuffered reads, shared-prefix replacement and code generation/editing. Matching responses and token counts were retained. This is integration validation, not a separate full-model run of this standalone PR branch.
  • The original 0.1.40.4 experiment measured median available RAM during long prompts increasing from about 0.45 to 11.40 GiB. That measurement concerns source-page release. The newer batched-read speedup belongs to upstream 0.1.41 and is not claimed as this patch's result.

Full model validation was on this Windows helper-GPU configuration and native IQ3_XXS pack. Other backends, GGUF-in-place staging and concurrent layer-split batches were not exercised by those model runs.

@W1nge
W1nge force-pushed the codex/windows-prefill-staging-release branch from 9ee824e to 83d4f1a Compare October 8, 2026 23:44
Maddoxkkm added a commit to Maddoxkkm/Strata that referenced this pull request Oct 10, 2026
…1221#1520 (release staged pages), Niko1221#1107 (grouped gather on short prompts)

Three of the candidates we read apply and are not superseded by upstream:
- Niko1221#1660 lets the MMQ resident sort take native-layout packs (slot/src/off are built the same way for both
  layouts; the PR measures 1.2K prompt 7.27 -> 5.32 s and 35K 63.3 -> 54.1 s on 4xGP100, same bits).
- Niko1221#1520 extends STRATA_FILE_RELEASE to prefill staging copies (opt-in; the PR's own numbers: +11.7 GiB
  available RAM for 3.7-4.4% prefill - a trade worth testing on this 32 GB box).
- Niko1221#1107 stages the short-prompt walk through a grouped ring (STAGE_GRP=32) instead of one slot at a time.

Not applied, and why: Niko1221#1101 and Niko1221#1237 are already upstream in newer form (upstream has the stager sleep
plus a stager_sleep helper and a batched copy_blobs loop, and pinned stage buffers behind
STAGE_PIN_DEFAULT=0 - the PR's older always-pin revision would re-arm the IQ3_S decode corruption the
release gate found).
Maddoxkkm added a commit to Maddoxkkm/Strata that referenced this pull request Oct 10, 2026
…batch

Niko1221#1416 is superseded by upstream 0.1.41 (which carries STRATA_PREFILL_CPU_SHARE_MAX and a newer
two-argument arm_cpu_share the PR lacks); Niko1221#1101 and Niko1221#1237 are upstream already, and Niko1221#1237's older
always-pin revision would re-arm the IQ3_S decode corruption the 0.1.41 gate found. Applied instead:
Niko1221#1660 (native-layout MMQ resident sort), Niko1221#1520 (release staged pages, opt-in) and Niko1221#1107 (grouped
gather on short prompts) - +4.7% prefill at 4K, +4.3% at 16K, with STRATA_FILE_RELEASE measured at
-6.3% and left off. Adds pr-triage.py, pr-check.py, the report and the cached candidate diffs.
@W1nge
W1nge marked this pull request as draft October 11, 2026 02:05
@Niko1221

Copy link
Copy Markdown
Owner

Thanks. Windows-only memory behaviour; we have no Windows box to verify it, so it is not ported for now.

@Niko1221

Copy link
Copy Markdown
Owner

Thanks for the pull request.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to review properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Rebase on main if it no longer applies, and re-run your checks on 0.2.0-beta.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the pull request template: the problem and result, and the validation (what you ran, on which revision, what you saw).
  4. Comment /reopen. A check runs and either reopens the pull request or lists what is still missing.

The rules are in CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants