Merge claude/baseline-pair (part e complete): fresh-boot reboot series, 9 cycles, ours 155.4 vs v1 137.0 vs v2 144.7 tok/s
Linux / keyless-cuda-gate (push) Skipped
Rust port / port-fast (push) Failing after 9s
Rust port / port-typecheck (push) Failing after 9s
Desktop foundation / core (ubuntu-latest) (push) Failing after 13s
Rust port / port-linux-tests (push) Failing after 14s
Linux / verify (push) Failing after 18s
Linux / keyless-cuda (push) Skipped
Linux / static-cuda-package (push) Skipped
Linux / hosted-cuda-package (push) Skipped
Linux / linux-static-cli (push) Skipped
Linux / linux-cli-container (push) Skipped
Linux / release-cli (push) Skipped
Rust port / port-oracles (push) Failing after 11s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-02 07:29:33 +01:00
co-authored by Claude Sonnet 5.5
5 changed files with 137 additions and 21 deletions
+46 -1
View File
@@ -19,6 +19,8 @@ Ours rounds are 0.66 ms shorter than this series' vanilla and carry 0.23 more to
**The vanilla state matters and I cannot call the +17 % "the" gap.** In part d five of the six vanilla runs were in the poor state (started after an ours run, 44.5-45.2 GiB of the arena as huge pages): 131.0 tok/s; the one full-coverage run was 142.3. Pooling all 34 vanilla runs of parts a-d (uptime 29.9-43.6 h): full-coverage n=14 **146.9 tok/s (sd 12.5, best runs 160-174)**, poor n=20 **136.8 (sd 11.6)**. Against those, current-main ours at 155.6-156.4 is **ahead by about 6 % of vanilla's good-state mean and 14 % of its poor-state mean**, and still **behind vanilla's best single runs** (160.3, 161.2, 162.4, 162.5, 174.2: 5 of 34 runs above 160 tok/s). The good-state comparison is across parts and uptimes (vanilla's good-state mean was 149.3 in part a, and one run at 142.3 in part d), so it carries the time confound of section 5; the within-block comparison above is the clean one.
**Part e (section 10, one arm per fresh boot, page cache of the files read so far evicted per file, vanilla at full huge-page coverage in all 6 runs):** ours 155.4 tok/s (sd 2.4, n=3), v1 137.0 (sd 5.6), v2 144.7 (sd 23.0, one run at 171.2). Block-paired ours - v1 **+18.4 tok/s (+13.5 %)**, 3 of 3 blocks; ours - v2 **+10.7 (+9.2 %)**, 2 of 3 blocks (block 2: v2 171.2 against ours 152.6, ours 10.8 % behind). So: ahead of vanilla in vanilla's good THP state on average, behind its occasional fast mode; n=3 blocks and the fast mode is unexplained.
**How ours moved over the work (same harness, ours only):** main e381c3082 (parts a, b) 143.4 (sd 2.0, n=11) at PCIe 0.55; main 11e021161 (part c) 151.5 at 0.55 and 148.4 at 0.45; main ffd9322c7 (part d) 155.6 at 0.45. Against vanilla in the same part: parts a-b e381c3082 level with v2/v1 (-0.9 % / +0.8 % paired, n=6); part c 11e021161 vs v2 +7.6 % (0.55) and +5.4 % (0.45), ahead in 5 of 6 and 4 of 6 blocks; part d +17.2 %. Part c's vanilla was also mostly poor-state (5 of 6), so its +5..8 % understates the good-state gap.
**Vanilla is the unstable arm; ours is not.** Vanilla sd 11-17 tok/s per part (5.5 in part d), ours 1.6-2.5 in every part and arm. ms/round of ours has sd 0.07-0.17 ms, vanilla 1.0-1.2 ms.
@@ -152,7 +154,7 @@ Caveats of part d: the first build of this binary came from a CRLF checkout and
`scripts/e2e/decode/baseline-install.sh` (on the server) installs the tools; stubs `bp-a.sh`, `bp-b2.sh`, `bp-c.sh`, `bp-d2.sh` in `~/work/gpu-runs/holder2/jobs/` hold the environment of each part (`BLOCKS`, `SEQ`, `OUTR`, `BINDIR`, `SUBST_V1`). Analysis: `baseline-analyze.py`, `baseline-turns.py`, `baseline-compact.py`, `baseline-pred.py` (outputs in `/data/leleka-e2e/baseline-pair/analysis/`). Data: `/data/leleka-e2e/runs/baseline-pair{,-b,-c,-d}/<run>/` (`long-session.json`, `client.ts.log`, `engine.log` or `inference.log`, `pre/state/post.jsonl`, `startup.txt`, `VALIDITY.txt`).
## 9. Part e: one arm per fresh boot (owner-authorised reboots, 2026-11-01/02): STOPPED after cycle 1, cost problem
## 9. Part e, first attempt (owner-authorised reboots, 2026-11-01/02): stopped after cycle 1, cost problem; completed in section 10
Driver: `scripts/e2e/decode/baseline-reboot-series.sh` (runs on the laptop; per cycle: wait until no foreign job, `sync`, `sudo -n systemctl reboot`, wait for a new boot id, check the safety net, pre-read the KAR file, restart the holder the way `notes.md` did after the boot of 2026-10-29, pre-read the model shard / MTP / pack, queue one holder job with `ENTRIES`, wait for it). Arms: ours = `dt/bin-main-ffd9322` (main d29e3dba2 has the same code outside docs/scripts), PCIe 0.45 pinned, defaults; v1; v2. Per run the job also writes `hook.txt` (boot id and time, uptime at the hook, rescue sshd :2222, `/dev/watchdog0`, `hung_task_panic`, swap, NVMe dmesg hits, holder pid and READY time, buddyinfo) next to the usual `pre/state/post.jsonl`.
@@ -173,3 +175,46 @@ Results so far (only ours ran on fresh boots):
Ours on a fresh boot is 157.1-157.8 against 155.6 (sd 1.6, n=6) at 42-44 h uptime in part d: boot state moves ours by about 1 %, inside its own spread. The vanilla arms, which are the ones that depend on the boot state (section 5), have not been run on fresh boots, so the question "is fresh-boot vanilla in its good state (arena THP >= 46.4 GiB)" is **not answered here**: on the fresh boots the free memory in 2 MiB+ blocks was recorded in `pre.jsonl` / `hook.txt` but no vanilla launch followed. Cycle 2's boot was not used.
**One vanilla run on a fresh boot (`runs/baseline-pair-e/b01p2-v1`, boot age 0.74 h, same boot as cycle 1, holder up, model shard pre-read; the cycle-2 slot, not a clean cycle):** valid, **130.6 tok/s** (113.9 147.9 138.1 125.9 127.4; 1.84 tokens/round, 14.13 ms/round). Its engine log says "expert arena: ... transparent huge pages NOT requested: only 0 GiB of free 2 MiB blocks for a 46 GiB arena": vanilla checks the free 2 MiB blocks before asking for huge pages, and with the holder's 55 GB memfd plus the page cache that the KAR read and the pre-read leave behind (Cached 115 GB, MemFree 10 GB, buddyinfo order 9+ about 8 GiB) there were none. AnonHugePages of the process was 0 (Rss 65.7 GiB), the worst vanilla state seen in 36 runs. So **fresh-boot vanilla is not in its good state when the holder has just been loaded**: a fresh boot is not an unfragmented machine, it is a machine whose RAM is full of page cache. This also reads back on the partial-coverage class of section 5: that class is vanilla's own guard (huge pages only where free 2 MiB blocks exist) meeting the page-cache and 4 KiB-page footprint an ours run leaves behind, not a defect of the launch. I did not test dropping the cache of the KAR file after the holder load (a read-only `posix_fadvise(DONTNEED)` on that one file would be the obvious next step) and did not run vanilla on a boot without the pre-read.
## 10. Part e completed: one arm per fresh boot, page cache evicted, vanilla in its good THP state (M, `runs/baseline-pair-e`, 2026-11-02 00:29Z to 06:28Z)
Resumed after section 9 with three changes: 3 blocks (9 cycles, permutations 1-3: ours v1 v2 / v2 v1 ours / v1 v2 ours), per-file `posix_fadvise(DONTNEED)` (`baseline-evict.py`; not `drop_caches`) of the KAR file, both model shards, the MTP files and the vanilla pack after the holder load and before every arm (the holder's read otherwise leaves ~50 GB of page cache and vanilla found "only 0 GiB of free 2 MiB blocks" and ran without huge pages), and a THP gate for vanilla arms (`baseline-thpcheck.py`: AnonHugePages >= 46.4 GiB, else the run is moved to `_poor/` and the cycle repeated once). Holder-load timeout 90 min. No sysfs, readahead or other setting changed; the only privileged call was `sudo -n systemctl reboot` (and read-only `sudo -n dmesg`). Ours = `dt/bin-main-ffd9322` (code of main d29e3dba2), PCIe 0.45 pinned.
All 9 runs VALID on the first attempt; no run was repeated, no poor state occurred. Every boot: ssh back in 255-257 s, rescue sshd :2222 up, `/dev/watchdog0`, `hung_task_panic=1`, swap off, no NVMe error lines in dmesg. Cycles took 23-55 min (the cold holder load of the 55 GB KAR file, 10-39 min, dominates). After eviction every cycle showed MemFree 68.0-68.3 GiB, Cached 52.0-52.2 GiB (the holder's 51.5 GiB memfd), free 2 MiB+ blocks 54.0-55.3 GiB (`_cycles/series.log`).
| run (block, position) | boot age at start | tok/s T1..T5 | all-turn | tok/round | ms/round | AnonHugePages GiB | THP fallback pages | note |
| --- | ---: | --- | ---: | ---: | ---: | ---: | ---: | --- |
| b01p1 ours | 0.8 h | 159.8 151.4 173.9 153.9 144.2 | 156.6 | 2.11 | 13.44 | 0 | 0 | |
| b01p2 v1 | 0.3 h | 142.8 136.7 129.4 131.2 162.8 | 140.6 | 2.00 | 14.29 | 46.5 | 158 | |
| b01p3 v2 | 0.5 h | 127.3 137.2 132.8 120.0 132.1 | 129.9 | 1.95 | 15.05 | 46.7 | 77 | pcie_frac retuned 0.35 -> 0.30 mid-run |
| b02p1 v2 | 0.3 h | 176.5 174.5 174.1 153.7 177.0 | **171.2** | 1.94 | **11.38** | 46.7 | 66 | engine ready in 76 s (others 102-132 s) |
| b02p2 v1 | 0.8 h | 139.7 122.3 135.6 132.2 123.0 | 130.6 | 1.92 | 14.68 | 46.6 | 105 | |
| b02p3 ours | 0.8 h | 158.5 155.2 149.5 153.2 146.6 | 152.6 | 2.07 | 13.54 | 0 | 0 | |
| b03p1 v1 | 0.8 h | 143.9 146.1 135.1 126.5 147.7 | 139.9 | 1.95 | 13.92 | 46.7 | 65 | |
| b03p2 v2 | 0.4 h | 136.9 117.6 139.7 133.9 137.4 | 133.1 | 1.92 | 14.41 | 46.7 | 66 | |
| b03p3 ours | 0.3 h | 159.7 151.3 173.7 151.1 149.1 | 157.0 | 2.15 | 13.72 | 0 | 0 | |
THP per vanilla run: 46.5, 46.7, 46.7, 46.6, 46.7, 46.7 GiB of the 46.8 GiB arena, fallback 65-158 pages (the engine log says "transparent huge pages requested (MADV_HUGEPAGE)" in all six). Fresh-boot vanilla with the page cache evicted is in its good state every time, so the 130-171 tok/s spread below is not the huge-page coverage of section 5.
| arm | n | all-turn tok/s mean (sd) | min..max | tokens/round | ms/round (sd) |
| --- | ---: | ---: | --- | ---: | ---: |
| ours | 3 | 155.4 (2.4) | 152.6..157.0 | 2.11 | 13.57 (0.14) |
| v1 | 3 | 137.0 (5.6) | 130.6..140.6 | 1.95 | 14.30 (0.38) |
| v2 | 3 | 144.7 (23.0) | 129.9..171.2 | 1.94 | 13.61 (1.96) |
Block-paired differences (same block, a - b):
| pair | block 1 | block 2 | block 3 | mean | blocks a faster | ms/round | tok/round |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| ours - v1 | +16.1 | +22.0 | +17.1 | **+18.4 tok/s (+13.5 %)**, se 1.8 | 3 of 3 | -0.73 | +0.15 |
| ours - v2 | +26.8 | -18.6 | +23.9 | **+10.7 tok/s (+9.2 %)**, se 14.6 | 2 of 3 | -0.04 | +0.17 |
| v1 - v2 | +10.7 | -40.6 | +6.8 | -7.7 tok/s (-3.5 %), se 16.5 | 2 of 3 | +0.68 | +0.02 |
Reading (n=3 blocks, intervals wide):
* **Ours is ahead of vanilla in vanilla's good state, with one exception.** Against v1 in 3 of 3 blocks (+13.5 %, tight: se 1.8). Against v2 in 2 of 3 blocks; in block 2 vanilla v2 ran 171.2 tok/s (11.38 ms/round) and ours 152.6, ours 10.8 % behind. Ours itself did not move (152.6-157.0, sd 2.4; 155.6 at 42 h uptime in part d, 143.4 on the older main of parts a-b).
* **Vanilla has two speeds that nothing recorded separates.** v2 b02p1 (171.2, ready in 76 s, boot age 0.3 h, full huge pages, free 2 MiB blocks 55.0 GiB, PCIe probe 49.4 GB/s) and the other five (130-141) have the same huge-page coverage, memory state, CPU clocks (5.49-5.53 GHz busy cores) and PCIe probe (46.4-50.7 GB/s). The pooled record has the same shape: 5 of 34 earlier vanilla runs were above 160 tok/s. I cannot say what puts vanilla into its fast mode; a fresh boot does not (5 of 6 fresh-boot vanilla runs were slow).
* **v1 against v2** is noise again (-3.5 %, signs split), as in part a.
* Fresh-boot vanilla is slower on average (140.9, n=6, sd 15.5) than the 146.9 of the good-THP class pooled over uptimes 30-43 h in section 1 (n=14): within the noise of both.
What the series does not show: whether eviction itself changes vanilla (the pre-eviction state was measured only once, 130.6 tok/s with 0 huge pages, section 9). Statements about the earlier poor-state class (section 5) rest on that one fresh-boot run plus the predecessor analysis of parts a-d.
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Evict the page cache of the given files (a directory = every regular file in it) with posix_fadvise(DONTNEED). Per-file, user level, read-only files; this is NOT drop_caches.
python3 -I baseline-evict.py FILE_OR_DIR [...]
Clean unmapped pages are dropped; pages that are mapped or dirty stay. Prints how much of each file is still resident (mincore through fincore is done by the caller).
"""
import os, sys
for a in sys.argv[1:]:
paths = [os.path.join(a, f) for f in sorted(os.listdir(a))] if os.path.isdir(a) else [a]
for p in paths:
if not os.path.isfile(p):
continue
fd = os.open(p, os.O_RDONLY)
os.posix_fadvise(fd, 0, 0, os.POSIX_FADV_DONTNEED)
os.close(fd)
print("evicted %s" % p, flush=True)
+1 -1
View File
@@ -10,7 +10,7 @@ D=/data/leleka-e2e/decode/dt
SRC=$(cd "$(dirname "$0")" && pwd)
mkdir -p "$BP/tools"
chmod -R u+w "$BP/tools" 2>/dev/null || true
for f in baseline-pair-ab.sh baseline-sampler.py ts-wrap.sh cycle-hook.sh baseline-prefetch.py; do install -m 0444 "$SRC/$f" "$BP/tools/$f"; done
for f in baseline-pair-ab.sh baseline-sampler.py ts-wrap.sh cycle-hook.sh baseline-prefetch.py baseline-evict.py baseline-thpcheck.py; do install -m 0444 "$SRC/$f" "$BP/tools/$f"; done
chmod a-w "$BP/tools"
ENG=$(ls -d /home/para/.local/share/strata/components/engine/*/strata | head -1)
{
+53 -19
View File
@@ -1,21 +1,30 @@
#!/usr/bin/env bash
# baseline-pair part e: ONE ARM PER FRESH BOOT. Runs on the LAPTOP (git bash), drives rnr5090 over ssh. Owner-authorised (chat, 2026-11-01): rebooting rnr5090 between runs.
# Allowed on the server: `sudo -n systemctl reboot` and nothing else privileged (no systemd units, sysctl, grub; sudo -n dmesg is read-only).
# Allowed on the server: `sudo -n systemctl reboot` and nothing else privileged (no systemd units, sysctl, grub, drop_caches, compact_memory; `sudo -n dmesg` is read-only).
#
# [START_CYCLE=2] bash baseline-reboot-series.sh [BLOCKS="1 2 3 4 5 6"] env: SERIES_LOG (local log), STOPFILE (touch it to stop after the current cycle), START_CYCLE (resume)
# [START_CYCLE=2] bash baseline-reboot-series.sh [BLOCKS="1 2 3"] env: SERIES_LOG (local log), STOPFILE (touch it to stop after the current cycle), START_CYCLE (resume)
#
# Per cycle: (1) nothing foreign may run (jobs pending/running other than our stubs, gpu.lock, a GPU process); wait otherwise, never reboot under a job;
# (2) `sync`, reboot, wait for ssh (new boot_id) up to 10 min; on timeout try the rescue sshd (:2222, `rboot`) once, then STOP; (3) safety net check (rescue sshd :2222, /dev/watchdog0,
# hung_task_panic=1, swap off, no NVMe errors in dmesg): any failure STOPs the series; (4) restart the KAR holder the way decode/notes.md did after a boot (remove the empty stale
# MODEL.lock, delete jobs/READY, `setsid nohup bash run_holder2.sh`), wait for READY; (5) queue ONE holder job (the arm) via ENTRIES, wait for its .done, read VALIDITY.txt; (6) next reboot.
# Arms: ours = dt/bin-main-ffd9322 (main d29e3dba2, same code outside docs/scripts), PCIe 0.45 pinned, defaults; v1 = vanilla shipped defaults; v2 = tail skip off + prefill CPU share 0.
# hung_task_panic=1, swap off, no NVMe errors in dmesg): any failure STOPs the series; (4) pre-read the KAR file (large WILLNEED requests), restart the KAR holder the way decode/notes.md did
# after a boot (remove the empty stale MODEL.lock, delete jobs/READY, `setsid nohup bash run_holder2.sh`), wait for READY (90 min);
# (5) EVICT the page cache of the files read so far with per-file posix_fadvise(DONTNEED) (KAR file, both model shards, MTP files, vanilla pack; read-only files, user level): the holder's read
# leaves ~50 GB of page cache that makes vanilla find no free 2 MiB blocks and run without huge pages; record MemFree and the free 2 MiB blocks; (6) queue ONE holder job (the arm) via
# ENTRIES, wait for its .done, read VALIDITY.txt; (7) a vanilla arm must show AnonHugePages >= 46.4 GiB (baseline-thpcheck.py), otherwise the run is moved to _poor/ and the cycle is
# repeated ONCE (a second poor run is kept and flagged); an invalid run is moved to _invalid/ and the cycle repeated once, a second failure STOPs the series; (8) next reboot.
# Arms: ours = dt/bin-main-ffd9322 (main d29e3dba2 has the same code outside docs/scripts), PCIe 0.45 pinned, defaults; v1 = vanilla shipped defaults; v2 = tail skip off + prefill CPU share 0.
# The job (baseline-pair-ab.sh) records settle.txt, pre.jsonl (uptime = time since boot, buddyinfo, meminfo), state.jsonl, post.jsonl, hook.txt (cycle-hook.sh: boot id/time, safety net, nvme dmesg hits).
set -uo pipefail
BLOCKS=${1:-"1 2 3 4 5 6"}
BLOCKS=${1:-"1 2 3"}
SSH="ssh -o ConnectTimeout=6 -o BatchMode=yes rnr5090"
OUTR=/data/leleka-e2e/runs/baseline-pair-e
PF=/data/leleka-e2e/baseline-pair/tools/baseline-prefetch.py
TOOLS=/data/leleka-e2e/baseline-pair/tools
PF=$TOOLS/baseline-prefetch.py
EV=$TOOLS/baseline-evict.py
TC=$TOOLS/baseline-thpcheck.py
JOBS='$HOME/work/gpu-runs/holder2/jobs'
KAR=/home/para/work/leleka/models/leleka-gates/assets/qwen-iq3-s-l2-v4.kar
MODELDIR=/home/para/work/leleka/models/leleka-gates/assets/model
SERIES_LOG=${SERIES_LOG:-./baseline-reboot-series.log}
STOPFILE=${STOPFILE:-./baseline-reboot-series.STOP}
perm() { case $1 in 1) echo "ours v1 v2";; 2) echo "v2 v1 ours";; 3) echo "v1 v2 ours";; 4) echo "ours v2 v1";; 5) echo "v2 ours v1";; 6) echo "v1 ours v2";; esac; }
@@ -59,6 +68,9 @@ wait_boot() { # $1 old boot_id ; up to 10 min after the reboot command
done
die "server did not come back after reboot and rboot"
}
memstate() { # MemFree / Cached / free 2 MiB+ blocks (buddyinfo orders 9-10, Normal + DMA32)
$SSH 'echo "MemFree_GiB=$(awk "/^MemFree/{printf \"%.1f\",\$2/2^20}" /proc/meminfo) Cached_GiB=$(awk "/^Cached/{printf \"%.1f\",\$2/2^20}" /proc/meminfo) Shmem_GiB=$(awk "/^Shmem:/{printf \"%.1f\",\$2/2^20}" /proc/meminfo) free2M_GiB=$(awk "/Normal|DMA32/{for(o=9;o<=10;o++) s+=\$(5+o)*4096*2^o} END{printf \"%.1f\",s/2^30}" /proc/buddyinfo)"'
}
mkdir -p "$(dirname "$SERIES_LOG")" 2>/dev/null
$SSH 'sudo -n true' || die "passwordless sudo not available"
@@ -69,10 +81,10 @@ for b in $BLOCKS; do
pos=$((pos + 1)); cyc=$((cyc + 1)); tag=$(printf "b%02dp%d-%s" "$b" "$pos" "$arm")
[ $cyc -lt ${START_CYCLE:-1} ] && continue # resume after a stopped series
[ -e "$STOPFILE" ] && die "stop file present before $tag"
tries=0
tries=0; attempt=0; fails=0
while :; do
tries=$((tries + 1)); [ $tries -gt 3 ] && die "cycle $cyc ($tag) kept getting foreign work"
log "=== cycle $cyc $tag (try $tries)"
tries=$((tries + 1)); attempt=$((attempt + 1)); [ $tries -gt 4 ] && die "cycle $cyc ($tag) kept getting foreign work / retries"
log "=== cycle $cyc $tag (attempt $attempt)"
wait_quiet
old=$($SSH 'cat /proc/sys/kernel/random/boot_id') || die "ssh failed before reboot"
$SSH 'sudo -n true' || die "passwordless sudo vanished"
@@ -89,30 +101,52 @@ for b in $BLOCKS; do
done
log "safety net: $net"
[ $ok = 1 ] || die "safety net check failed after boot ($net)"
# cold page cache + this NVMe = ~30 MB/s for buffered reads (measured); pre-read the KAR file with large WILLNEED requests (~600 MB/s) before the holder reads it
$SSH "python3 -I $PF /home/para/work/leleka/models/leleka-gates/assets/qwen-iq3-s-l2-v4.kar" 2>&1 | while read -r l; do log "prefetch: $l"; done
# cold page cache + this NVMe = ~30 MB/s for buffered reads (measured); pre-read the KAR file with large WILLNEED requests before the holder reads it
$SSH "python3 -I $PF $KAR" 2>&1 | while read -r l; do log "prefetch: $l"; done
# KAR holder, as after the boot of 2026-10-29 (notes.md): stale empty MODEL.lock removed, ONE holder started, READY rewritten
$SSH 'pgrep -f "[k]ar_holder2" >/dev/null && echo HOLDER_ALREADY_RUNNING; rm -f '"$JOBS"'/READY; [ -d $HOME/work/gpu-runs/MODEL.lock ] && { rmdir $HOME/work/gpu-runs/MODEL.lock || echo MODEL_LOCK_NOT_EMPTY; }
cd $HOME/work/gpu-runs/holder2 && { setsid nohup bash run_holder2.sh >> holder2.out 2>&1 < /dev/null & } ; sleep 1; echo started' | while read -r l; do log "holder: $l"; done
for _ in $(seq 1 480); do $SSH 'test -s '"$JOBS"'/READY' 2>/dev/null && break; sleep 10; done
$SSH 'test -s '"$JOBS"'/READY' || die "KAR holder not READY within 90 min"
log "holder READY: $($SSH 'cat '"$JOBS"'/READY; echo " uptime_s=$(cut -d" " -f1 /proc/uptime)"')"
log "memory before eviction: $(memstate)"
# evict the page cache of every file read so far (per-file posix_fadvise DONTNEED, twice), then record what is left
$SSH "python3 -I $EV $KAR $MODELDIR \$HOME/.local/share/strata/Strata-data/mtp \$HOME/.local/share/strata/Strata-data/packs/iq3_s; python3 -I $EV $KAR $MODELDIR; fincore $KAR | tail -1" 2>&1 | while read -r l; do log "evict: $l"; done
ms=$(memstate); log "memory after eviction: $ms"
f=$(foreign | grep -v '^proc:' | tr '\n' ' ')
if [ -n "${f// /}" ]; then log "foreign work appeared after boot ($f): waiting for it, then redoing the reboot for a fresh state"; wait_quiet; continue; fi
# same page-cache state for every arm: the model shard that holds the experts, the MTP files, the vanilla pack
$SSH "python3 -I $PF /home/para/work/leleka/models/leleka-gates/assets/model/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf \$HOME/.local/share/strata/Strata-data/mtp \$HOME/.local/share/strata/Strata-data/packs/iq3_s" 2>&1 | while read -r l; do log "prefetch: $l"; done
stub="bpe-$(printf '%02d' $cyc)"
stub="bpe-$(printf '%02d' $cyc)-a$attempt"
$SSH "mkdir -p $OUTR; cat > $JOBS/$stub.sh <<EOF
#!/usr/bin/env bash
# baseline-pair part e, cycle $cyc: one arm on a fresh boot
export OUTR=$OUTR BINDIR=bin-main-ffd9322 PCIE_FRAC=0.45 ENTRIES=\"$b:$pos:$arm\" PRE_ARM_HOOK=/data/leleka-e2e/baseline-pair/tools/cycle-hook.sh
exec bash /data/leleka-e2e/baseline-pair/tools/baseline-pair-ab.sh
# baseline-pair part e, cycle $cyc attempt $attempt: one arm on a fresh boot (memory after eviction: $ms)
export OUTR=$OUTR BINDIR=bin-main-ffd9322 PCIE_FRAC=0.45 ENTRIES=\"$b:$pos:$arm\" PRE_ARM_HOOK=$TOOLS/cycle-hook.sh
exec bash $TOOLS/baseline-pair-ab.sh
EOF"
log "queued $stub ($tag)"
for _ in $(seq 1 270); do $SSH "test -e $JOBS/$stub.done" 2>/dev/null && break; sleep 10; done
$SSH "test -e $JOBS/$stub.done" || die "$stub did not finish within 45 min"
log "$stub done rc=$($SSH "cat $JOBS/$stub.done") validity: $($SSH "cat $OUTR/$tag/VALIDITY.txt 2>&1 | cut -c1-160")"
val=$($SSH "cat $OUTR/$tag/VALIDITY.txt 2>&1 | cut -c1-160")
log "$stub done rc=$($SSH "cat $JOBS/$stub.done") validity: $val"
$SSH "mkdir -p $OUTR/_cycles; cp $JOBS/$stub.log $OUTR/_cycles/$stub.log" 2>/dev/null
case "$val" in
VALID*) ;;
*) fails=$((fails + 1)); $SSH "mkdir -p $OUTR/_invalid && mv $OUTR/$tag $OUTR/_invalid/$tag-a$attempt"
[ $fails -ge 2 ] && die "cycle $cyc ($tag) failed twice: $val"
log "invalid run moved to _invalid; repeating the cycle once"; push_log; continue;;
esac
case $arm in
v1|v2)
thp=$($SSH "python3 -I $TC $OUTR/$tag")
log "THP check $tag: $thp"
case "$thp" in
*POOR*) if [ $attempt -lt 2 ]; then
$SSH "mkdir -p $OUTR/_poor && mv $OUTR/$tag $OUTR/_poor/$tag-a$attempt"
log "poor state (no full huge-page coverage): run moved to _poor; repeating the cycle once"; push_log; continue
else
$SSH "echo 'POOR STATE after the repeat: kept' > $OUTR/$tag/POOR.txt"; log "poor state again after the repeat: kept and flagged"
fi;;
esac;;
esac
push_log
break
done
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""THP coverage of a vanilla run: python3 -I baseline-thpcheck.py RUNDIR
Prints the largest AnonHugePages (GiB) of the GPU process over state.jsonl, the engine-log line about huge pages, and OK (>= 46.4 GiB) or POOR."""
import json, os, re, sys
d = sys.argv[1]
best = 0.0
for ln in open(os.path.join(d, "state.jsonl"), errors="replace"):
try:
s = json.loads(ln)
except Exception:
continue
for p in s.get("procs", []):
best = max(best, p.get("smaps_rollup_kb", {}).get("AnonHugePages", 0) / 2**20)
note = ""
lp = os.path.join(d, "engine.log")
if os.path.exists(lp):
for ln in open(lp, errors="replace"):
if "transparent huge pages" in ln:
m = re.search(r"transparent huge pages[^;]*", ln)
note = (m.group(0) if m else "")[:140]
break
print("%s AnonHugePages_max=%.1f GiB [%s]" % ("OK" if best >= 46.4 else "POOR", best, note))