mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4808] [Engine] register the partial-pin prefix in slices on Windows (STRATA_PARTIAL_PIN_SLICED) #5194
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#5194
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/4808
Author: @nmqx
Created: 10/31/2026
Status: 🔄 Open
Base:
main← Head:pr/partial-pin-sliced📝 Commits (1)
df4c3c9[Engine] register the partial-pin prefix in slices on Windows (STRATA_PARTIAL_PIN_SLICED)📊 Changes
3 files changed (+80 additions, -3 deletions)
View changed files
📝
docs/UNSLOTH_Q4.md(+1 -0)📝
include/strata/core/expert_source.hpp(+2 -0)📝
src/core/expert_source.cpp(+77 -3)📄 Description
Problem and result
On Windows the RAM-budget complement (
--resident-budget-gib N) is refused bycudaHostAllocas one block once it passes the driver's single-allocation limit, so it falls back to pageable memory.STRATA_PARTIAL_PIN=1helps, but it also registers one block: it steps down 2 GiB at a time until the driver accepts. On this PC that stops at ~20 GiB of a 34.7 GiB complement, while the expert arena on the same PC pins 41 GiB in 43 slices of 1 GiB.With
STRATA_PARTIAL_PIN_SLICED=1(together withSTRATA_PARTIAL_PIN=1), the same hottest prefix is registered slice by slice. All 34.73 GiB were registered in 35 slices.Related discussion
#2535 (closed in the 0.2.0-beta tracker reset, not rejected) measured this limit with two NVIDIA cards and suggested exactly this: slices of 1 GiB or less, keeping the hottest ones granted. This PR is a focused, opt-in fix, so I did not open a new scope issue first; happy to move it to one if you prefer.
Approach
STRATA_PARTIAL_PIN_SLICE_MIB(default 1024). Each is cut at an expert boundary, so a blob never straddles two registrations. It stops atSTRATA_PARTIAL_PIN_GIBor at the first refusal.cudaHostGetDevicePointeron a registered slice does not return its host address. My first version assumed it did and registered nothing. So each slice keeps its own device alias, andFileExpertSource::device_alias()picks the blob's slice with anupper_boundover the slice offsets. This is the same idea asArenaExpertSource'sdev_slice_andpin_dev_.close()and the error-pathrelease) unregisters each slice.complement_partial_/pinned()are unchanged: the slices form one contiguous prefix ofcomplement_pin_limit_bytes.docs/UNSLOTH_Q4.mdswitch table, next toSTRATA_PARTIAL_PIN.Validation
Environment:
"gpu": [1]) + RTX 3080 10 GB (drives the display, unused by Strata).--resident-budget-gib 35 --conversation-cache-mib 1536 --max-context 262144 --kv int8 --kv-resident 32768 --spec 4 --vram-reserve-later-mib 1000, plusSTRATA_STAGE_TRIM=1 STRATA_KV_PREFETCH=1 STRATA_CACHE_MESSAGE_BOUNDARY=1.-DCMAKE_CUDA_ARCHITECTURES=86 -DSTRATA_BUILD_TESTS=OFF.Speed: my own script, not the benchmark protocol, run through
serve/server.py's OpenAI endpoint.STRATA_PARTIAL_PIN_*=1,_GIB=34=1,_GIB=40,_SLICED=0=1,_GIB=40,_SLICED=1Passed:
cmake --build build --target strata), no new warnings in the touched file.34.73 GiB of it registered for the GPU in 35 slices (the hottest), with no errors in the log.is_prime, and a coherent French paragraph.Failed: the first version, with the UVA assumption, registered 0 slices. That is fixed by the per-slice alias above, and the numbers are from the fixed build.
Not run:
cudaHostRegister/cudaHostGetDevicePointer/cudaHostUnregister, which this file already calls, but I have no AMD toolchain. That is why this is a draft.!corruption that #2535 associated with pageable complements.Limits
STRATA_PARTIAL_PIN=1, as before.STRATA_PARTIAL_PIN_GIBstill caps the prefix (default 24), so it must be raised to cover the whole budget.STRATA_PARTIAL_PINalready does. I am not proposing a default change.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.