Repository navigation
Conversation
Linux MemAvailable already excludes fallocated tmpfs arena and staging bytes, but pool approval subtracted the same bytes again. Track physically backed bytes on planned regions and charge the host only the unbacked remainder while preserving full per-GPU registration metadata cost. This prevents valid shared-pool attachments from being rejected without weakening GPU budget accounting or host observation failures. Validation: cargo test -p flare-selene pool::budget on Hades Linux aarch64: 4 passed, 0 failed, 551 filtered out. The Linux backed_shm_bytes branch compiled but its statfs helper was not directly executed by these tests; no fresh manager attachment reproduction was run for this submission. Signed-off-by: Eduardo Fonseca <ebf@ebf.io> Design-Signed-Off-By: Iris; design-review=2e5b Signed-off-by: Iris (Eduardo's coding agent)
Collaborator
|
A case file has been opened for 699. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Collaborator
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe core diagnosis and architectural placement are sound, but the PR breaks three existing Linux CI integration tests that run against real
Walkthrough
Merge Risk: Medium · up to
|
Derive manager integration expectations from actual arena and staging backing, approve zero-host-budget pools when fully backed, and preserve device-budget rejection coverage. Add a direct tmpfs test using the host page size so partial backing and declared-size clamping are measured on 4 KiB and 64 KiB systems. Validation on Hades Linux aarch64 with 64 KiB pages: - full selene suite: 556 passed, 0 failed - manager builder: 3 passed; manager offload: 2 passed - Helios peer registration budget: 1 passed - selene pool::budget: 4 passed The manager host-rejection branch is unexercised on Hades because fallocate fully backs both regions. No GPU admission or RDMA test was run. Signed-off-by: Eduardo Fonseca <ebf@ebf.io> Design-Signed-Off-By: Iris; design-review=2e5b Signed-off-by: Iris (Eduardo's coding agent)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Linux,
selene-managerpreallocates its sharedarenaandstagingfiles in/dev/shm/selene/<name>-<hash>/usinglibc::fallocate(fd, 0, 0, size)(selene-manager/src/local.rs). Ontmpfs,fallocateimmediately commits physical RAM blocks (st_blocks * 512 == size), charging them toShmemand deducting the full size from Linux/proc/meminfoMemAvailable.When a local Flare instance subsequently attaches to the pool:
host_pool_budget()reads LinuxMemAvailable(which has already hadarena + stagingsubtracted) and subtracts the system reserve (2 GiB + 5% MemTotal) plus the instance's local--prefix-cache-memoryand intake.register_memory()populatesPlannedRegionwith the fullarena_bytesandstaging_bytes, andBudget::approve()requiresarena + staging <= available_hosta second time.selene-managerpool effectively requires2× (arena + staging)of host RAM on single-instance hosts (and(N + 1)×when multiple instances map the same shared files), rejecting valid configurations that have tens of GiB of real host headroom remaining.Observed on a 494.5 GiB unified-memory host with
230.2 GiBhost weights,128 GiBlocal prefix cache, and a32Garena +8Gstaging local pool (~69 GiBreal free host RAM after weights + pool):Changes
selene/src/pool/startup.rs:pub backed_bytes: u64toPlannedRegionandRegisteredRegionto distinguish bytes already committed in memory-resident shared storage from new physical host RAM required at registration.selene/src/pool/conn.rs:backed_shm_bytes(path, declared_bytes): verifies vialibc::statfsthat the file resides onlibc::TMPFS_MAGICand returnsmetadata.blocks().saturating_mul(512).min(declared_bytes). Fails conservatively to0on non-Linux hosts, non-tmpfs filesystems, or any I/O error.backed_bytesfor localarenaandstagingPlannedRegion/RegisteredRegionentries, and0for anonymous remotedata-staging.selene/src/pool/budget.rs&selene/src/pool/builder.rs:Budget::costsandPreparedPool::registration_coststo charge host memory only forbytes.saturating_sub(backed_bytes.min(bytes))while still charging fullbytes.div_ceil(512)per GPU for CUDA host-memory registration metadata (and still propagatingBudget.host = Err(...)errors).selene/src/pool/budget/tests.rs:/dev/shm(0additional host charge, full device charge preserved, GPU shortfall & missing host observation still rejected) and partially backed / mixed remotedata-stagingplans.Verification
selene-manager'sfallocatebehavior against live/proc/meminfo(Shmemimmediately equalsarena + staging, fully deducted fromMemAvailablebeforeflare runattaches).cargo test -p flare-selene pool::budgetSubmission validation
On Hades Linux aarch64 (kernel 6.17.0-1029-nvidia-64k):
The Linux
backed_shm_bytesbranch compiled. The budget tests exerciseBudgetarithmetic throughPlannedRegionvalues; they do not directly execute thestatfshelper or a fresh manager attachment reproduction.Discord: ebfio