[PR #818] [CLOSED] Windows: opt-in release of mapped expert pages after GPU uploads #2850

Closed
opened 2026-11-04 02:03:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/818
Author: @jordicor
Created: 10/4/2026
Status: ❌ Closed

Base: main ← Head: codex/windows-mapped-expert-release


📝 Commits (1)

  • 929b90e Add opt-in Windows mapped expert page release

📊 Changes

11 files changed (+2450 additions, -0 deletions)

View changed files

➕ bench/results/2026-10-04-windows-mapped-release/README.md (+144 -0)
➕ bench/results/2026-10-04-windows-mapped-release/benchmark.py (+381 -0)
➕ bench/results/2026-10-04-windows-mapped-release/measurements.json (+1463 -0)
➕ bench/results/2026-10-04-windows-mapped-release/monitor_windows.py (+139 -0)
➕ bench/results/2026-10-04-windows-mapped-release/test_benchmark.py (+179 -0)
📝 docs/DETAILS.md (+9 -0)
📝 include/strata/core/expert_source.hpp (+3 -0)
📝 src/core/expert_source.cpp (+52 -0)
📝 src/program/generate.cpp (+9 -0)
📝 tests/core/expert_layout_test.cpp (+11 -0)
📝 tests/core/file_expert_source_test.cpp (+60 -0)

📄 Description

On a 32 GB Windows 11 laptop with an RTX 4080 Laptop and a Thunderbolt RTX 3090, file-backed expert pages remained in the engine's working set after their GPU copies. With IQ2_XS and the existing layer split, available RAM stayed near 0.5 GiB during the measured workload.

This adds opt-in Windows mapped-page release via STRATA_ARENA_RELEASE=1. Unset or 0 preserves the current behavior.

  • Implement FileExpertSource::release() for experts.bin and direct GGUF file views using Windows working-set trimming. Preserve shared boundary pages and never trim private/pinned staging buffers.
  • Release pages after prefill's lent expert slots have finished refilling, in both serving and one-shot generation. Existing completed-upload release calls also use the implementation.
  • Add focused C++ coverage, document the switch and tradeoff, and include the benchmark scripts and scoped measurements.

Measured result

The same prototype executable was run with explicit release OFF and ON: one warmup and three fresh requests each at 1K, 4K and 16K prompt tokens, 256 output tokens, context 32768, int8 KV, MTP, --mmap-experts --layer-split 12 --trim-stage-weights.

Metric OFF ON
Available physical RAM, median 0.512 GiB 12.187 GiB
Available physical RAM, minimum 0.277 GiB 6.110 GiB
Engine working set, median 23.379 GiB 11.946 GiB
System commit, median 51.880 GiB 51.973 GiB
Physical SSD reads, total 16.750 GiB 16.809 GiB

Prefill throughput was 3.7-4.4% lower. This improves physical-memory availability on this machine; it does not reduce commit, demonstrate fewer SSD reads, or establish a general speed improvement. Runs were sequential, the OS file cache was retained, and generated code-explanation responses differed. The submitted patch defaults to OFF; the measured prototype defaulted to ON, but both benchmark arms set the switch explicitly.

Full configuration, individual timings, hashes, reproduction commands and limitations: measurement report.

Validation

  • Fresh Windows Release build with MSVC 2019 and CUDA 13.1, SM 86/89, native experts enabled.
  • file_expert_source_test and expert_layout_test pass in separate processes with the switch unset, 0, and 1: page alignment and working-set behavior, unchanged bytes after repeated reads, invalid indices, closed sources, and three GGUF roles across two shards.
  • Eight benchmark-harness tests pass.
  • Final rebuilt engine completes fresh 1K/4K inference requests on both GPUs with release enabled.

The prototype also completed 30 functional requests without runtime errors. All 24 objective responses/statuses matched the official engine at the same placement: 21 passes and three unchanged Markdown-fenced-JSON failures; six prose responses were unscored. These limited checks do not prove general output parity.

Related prior work: #467 and #640. The existing multi-GPU implementation is reused; this PR contributes Windows mapped-page release.


🔄 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/818 **Author:** [@jordicor](https://github.com/jordicor) **Created:** 10/4/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/windows-mapped-expert-release` --- ### 📝 Commits (1) - [`929b90e`](https://github.com/Niko1221/Strata/commit/929b90eca848bdc0a42302358279e3d12c1d01f8) Add opt-in Windows mapped expert page release ### 📊 Changes **11 files changed** (+2450 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `bench/results/2026-10-04-windows-mapped-release/README.md` (+144 -0) ➕ `bench/results/2026-10-04-windows-mapped-release/benchmark.py` (+381 -0) ➕ `bench/results/2026-10-04-windows-mapped-release/measurements.json` (+1463 -0) ➕ `bench/results/2026-10-04-windows-mapped-release/monitor_windows.py` (+139 -0) ➕ `bench/results/2026-10-04-windows-mapped-release/test_benchmark.py` (+179 -0) 📝 `docs/DETAILS.md` (+9 -0) 📝 `include/strata/core/expert_source.hpp` (+3 -0) 📝 `src/core/expert_source.cpp` (+52 -0) 📝 `src/program/generate.cpp` (+9 -0) 📝 `tests/core/expert_layout_test.cpp` (+11 -0) 📝 `tests/core/file_expert_source_test.cpp` (+60 -0) </details> ### 📄 Description On a 32 GB Windows 11 laptop with an RTX 4080 Laptop and a Thunderbolt RTX 3090, file-backed expert pages remained in the engine's working set after their GPU copies. With IQ2_XS and the existing layer split, available RAM stayed near 0.5 GiB during the measured workload. This adds **opt-in Windows mapped-page release** via `STRATA_ARENA_RELEASE=1`. Unset or `0` preserves the current behavior. - Implement `FileExpertSource::release()` for `experts.bin` and direct GGUF file views using Windows working-set trimming. Preserve shared boundary pages and never trim private/pinned staging buffers. - Release pages after prefill's lent expert slots have finished refilling, in both serving and one-shot generation. Existing completed-upload release calls also use the implementation. - Add focused C++ coverage, document the switch and tradeoff, and include the benchmark scripts and scoped measurements. ### Measured result The same prototype executable was run with explicit release OFF and ON: one warmup and three fresh requests each at 1K, 4K and 16K prompt tokens, 256 output tokens, context 32768, int8 KV, MTP, `--mmap-experts --layer-split 12 --trim-stage-weights`. | Metric | OFF | ON | | --- | ---: | ---: | | Available physical RAM, median | 0.512 GiB | 12.187 GiB | | Available physical RAM, minimum | 0.277 GiB | 6.110 GiB | | Engine working set, median | 23.379 GiB | 11.946 GiB | | System commit, median | 51.880 GiB | 51.973 GiB | | Physical SSD reads, total | 16.750 GiB | 16.809 GiB | Prefill throughput was **3.7-4.4% lower**. This improves physical-memory availability on this machine; it does not reduce commit, demonstrate fewer SSD reads, or establish a general speed improvement. Runs were sequential, the OS file cache was retained, and generated code-explanation responses differed. The submitted patch defaults to OFF; the measured prototype defaulted to ON, but both benchmark arms set the switch explicitly. Full configuration, individual timings, hashes, reproduction commands and limitations: [measurement report](https://github.com/jordicor/Strata/blob/codex/windows-mapped-expert-release/bench/results/2026-10-04-windows-mapped-release/README.md). ### Validation - Fresh Windows Release build with MSVC 2019 and CUDA 13.1, SM 86/89, native experts enabled. - `file_expert_source_test` and `expert_layout_test` pass in separate processes with the switch unset, `0`, and `1`: page alignment and working-set behavior, unchanged bytes after repeated reads, invalid indices, closed sources, and three GGUF roles across two shards. - Eight benchmark-harness tests pass. - Final rebuilt engine completes fresh 1K/4K inference requests on both GPUs with release enabled. The prototype also completed 30 functional requests without runtime errors. All 24 objective responses/statuses matched the official engine at the same placement: 21 passes and three unchanged Markdown-fenced-JSON failures; six prose responses were unscored. These limited checks do not prove general output parity. Related prior work: #467 and #640. The existing multi-GPU implementation is reused; this PR contributes Windows mapped-page release. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:03:34 +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#2850
No description provided.