mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #640] [CLOSED] STRATA_ARENA_MMAP=1: the expert arena as a read-only mapped file (Linux), for small-RAM machines #2738
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#2738
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/640
Author: @JeanP00l
Created: 10/3/2026
Status: ❌ Closed
Base:
main← Head:pr-arena-mmap📝 Commits (1)
6e35335STRATA_ARENA_MMAP=1: the expert arena as a read-only mapped file (Linux), for small-RAM machines📊 Changes
4 files changed (+226 additions, -4 deletions)
View changed files
📝
include/strata/core/expert_source.hpp(+9 -0)📝
include/strata/hip_compat/cuda_runtime.h(+1 -0)📝
src/core/expert_source.cpp(+91 -1)📝
src/program/generate.cpp(+125 -3)📄 Description
What
STRATA_ARENA_MMAP=1(opt-in, Linux; nothing changes without it) maps the host expert arena read-only from the pack'sexperts.bininstead of reading it into pinned, locked RAM. This is for machines whose GPUs already hold most experts and whose RAM is small.--mmap-expertsrefuses native packs (the Coder), so this path is for them.Without it, the Coder (25 GB arena) on 2x 16 GB GPUs with 32 GB of RAM left ~1-3 GB available at 128K context. In long sessions the kernel swapped, and re-reading a multi-turn checkpoint took 25-80 s.
experts.bin(padded by one blob, so a whole-slot copy may start at any expert). Later starts map it.--pcie-frac 0.MADV_DONTNEED;STRATA_ARENA_RELEASE=0keeps them), and the rest are prefetched (MADV_WILLNEED). An adaptive swap releases the expert that went to VRAM and prefetches the one that came back.GPU_PINNED_MIN_XFER_SIZE(an explicit setting wins). It locks an adaptive swap's source pages itself, only until the copy lands. The ranges are merged first, because a copy from a range only partly registered fails withinvalid argument.STRATA_RSS_TRACE=1: printsRssFileat the startup steps.madvisereports success on locked pages and frees nothing, soRssFileis the honest check.cudaHostRegisterReadOnly.Measured
2x AMD Instinct MI50 16 GB + 32 GB DDR4 (gfx906, see #638), Coder IQ1_M, 128K context, layer split:
STRATA_ARENA_MMAP=1Status
Re-run on 2x MI50 with this branch on current
main, results in the comment below.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.