Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/TODO.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[ ] Run end-to-end `flare run <core> --prefix-cache-memory <size> --prefix-cache-disk <dir>`
A/B startup timing checks against `main` under Linux THP `enabled=madvise,
defrag=madvise` on fragmented and unfragmented memory, plus live RDMA
`ibv_reg_mr` registration and 16 KiB/64 KiB ARM64 Linux kernel validation
for `eos::map_host` (#616). Also audit `selene-manager/src/arena.rs` for
unconditional `MADV_HUGEPAGE` under synchronous THP defragmentation.

[ ] Fix native TP4 shutdown reporting "free(): double free detected in tcache 2"
after server drain with Inkling 2 cores. Reproduces with compiled and
uncompiled graphs; preserve the successful request drain and GPU release.
Expand Down
31 changes: 25 additions & 6 deletions docs/prefix-cache-offload.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,24 @@ offload event.

Transfers move records in windows of at most 64 pages plus the multi-slot row.
The pool contains warm checkpoint slots plus automatic intake slots. It is one
4 KiB aligned anonymous mapping (`MAP_PRIVATE`, `MAP_ANONYMOUS`, advised for
transparent huge pages with `MADV_HUGEPAGE` before prefaulting via
`MADV_POPULATE_WRITE`), registered once at startup. Rows use each
page-aligned anonymous mapping (`MAP_PRIVATE`, `MAP_ANONYMOUS`), prefaulted
writable (in bounded chunks on Unix) and registered once at startup. On Linux,
`eos::map_host` inspects
`/sys/kernel/mm/transparent_hugepage/{enabled,defrag,hpage_pmd_size}` to choose
how to request transparent huge pages without triggering sustained synchronous
memory compaction: non-blocking defragmentation policies (`defer` or `never`)
advise `MADV_HUGEPAGE` across the single mapping upfront, while `enabled=always`
with `defrag=madvise` or `defer+madvise` uses the kernel's opportunistic
hugepage path without `MADV_HUGEPAGE`. Under policies where `MADV_HUGEPAGE` can
trigger synchronous direct compaction, `eos::map_host` anchors one shared
`anon_vma` on the unsplit mapping, walks PMD-aligned chunks up to
`max(16 MiB, hpage_pmd_size)` while checking `/proc/buddyinfo` free hugepage
supply across NUMA nodes allowed by `/proc/self/status` (`Mems_allowed_list`),
chunk fault latency, and consecutive `/proc/vmstat` `compact_stall` increments,
falls back to base pages for the remainder of the slab when huge pages are scarce
or compaction stalls begin, and applies a whole-range `madvise` (`MADV_NOHUGEPAGE`
after fallback, `MADV_HUGEPAGE` otherwise) once all pages are populated so Linux
merges the mapping back into one contiguous VMA before CUDA registration. Rows use each
rank's page share across as many slots as needed; their pieces need not be
contiguous. CPU readers traverse pieces in rank order, preserving disk bytes
and streaming xxh3 checksum values. After copy-out, Selene compares local ranks'
Expand Down Expand Up @@ -972,9 +987,13 @@ Offload limits interference through bounded work and explicit ownership:
rejects unknown keys, including `disk_transport`.
- `LoadOptions` carries `prefix_cache: PrefixCacheOffload` with the
memory size, directory, disk limit, shutdown drain, max age, and pool.
- The `Prepare host prefix cache` startup phase reports the slot pool's size
and slot count, CPU input limits, the record directory, the disk limit, the
scanned record count, and the `staged` transport.
- The `Prepare host prefix cache` startup phase updates its live step detail as
it allocates a split host slab or populates and CUDA-registers a contiguous
host slab and scans existing disk records. On completion, it reports the slot
pool's size, slot count, and separate elapsed durations (`allocate` for split
pools, or `populate` and `register` for contiguous registered pools), CPU
input limits, and the record directory, disk limit, scanned record count,
`staged` transport, and `scan` duration.
- Metrics expose `flare_host_cache_slots_in_use`, `flare_host_cache_slots_total`
(including intake), and `flare_host_cache_intake_slots`. Used slots include
pages, every row piece, and staging allocations from the same local pool.
Expand Down
Loading
Loading