mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3509] [Engine] arena: attach a complete shared arena instead of re-copying (STRATA_ARENA_REUSE=1, opt-in) #4661
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#4661
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/3509
Author: @Jerry-Lee661
Created: 10/20/2026
Status: 🔄 Open
Base:
main← Head:arena-reuse📝 Commits (1)
1bd6178arena: attach a complete shared arena instead of re-copying (STRATA_ARENA_REUSE=1, opt-in)📊 Changes
3 files changed (+38 additions, -5 deletions)
View changed files
📝
include/strata/core/pinned.hpp(+6 -0)📝
src/core/expert_source.cpp(+15 -1)📝
src/core/pinned.cu(+17 -4)📄 Description
Problem
With
--shared-expert-arena, every engine start re-copies the whole expert arena into the shared file even when a previous start already wrote it completely. On our machine (2x RX 7900 XTX gfx1100, ROCm 10.1, E5-2673 v3, 128 GB DDR3, Qwen3.8-Flash-Next IQ3_S pack, 46.84 GiB arena on /dev/shm) that copy takes 75-100 s per start and dominates every restart and form switch. The existing pack-hash check in pinned.cu already proves the existing file belongs to this pack; nothing reuses its contents.Change
STRATA_ARENA_REUSE=1(off by default):reserve()reports whether the shared arena file already existed and whether the header's completion flag (reserved[0]) is set;mark_shared_complete()sets the flag (MAP_SHARED, so it lands in the file);ArenaExpertSource::open()attaches the mapped pages and skips the copy, and the load note says it attached;experts.binpack path reuses; the GGUF /--mmap-expertspaths are excluded.Validation
cbfd5b92):ninja CMakeFiles/strata_engine.dir/src/core/expert_source.cpp.o CMakeFiles/strata_core.dir/src/core/pinned.cu.o, HIP/gfx1100 (ROCm 10.1), 0 errors.477ac13c+ this patch, the machine above): first start copies the arena (75 s) and writes the flag; the second start attaches: engine logexpert arena attached from /dev/shm/strata-shared-arena.bin (STRATA_ARENA_REUSE: no copy)andloaded 46.84 GiB at 0.00 GiB/s, total start 45 s, zero pack reads; the arena content sha256 is identical before and after the attach; greedy outputs identical.Limits and compatibility
reserve()).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.