Files
leleka/scripts/e2e/decode/single-copy-holder.sh
T
Pavlo RatushnyiandClaude Sonnet 5.5 9c77d603d7 single-copy RAM: refuse a full sealed memfd for a ple_only profile, lab holder seals sparse, design page
The 2026-11-09 server reading (Shmem 58.6 GB, MemAvailable 7-8 GB) is the lab holder's full 55.3 GB memfd
(single-copy-holder.sh sealed without --sparse-ple), not the sparse memfd of leleka up. The supervisor
now checks the allocated bytes (st_blocks) of an inherited descriptor against the profile and refuses a
ple_only profile on a full copy (LELEKA_ALLOW_FULL_MEMFD=1 overrides, logged); the holder script seals
--sparse-ple by default (HOLDER_MEMFD=full keeps the old form). Design, candidates and the ordered
measurements: docs/design/single-copy-ram-2026-11-09.md. No GPU/server run; identity/A-B pending.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 11:13:17 +01:00

21 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# Start the lab holder with the fast, page-cache-free seal (see single-copy-holder.py). Same MODEL.lock contract as run_holder2.sh.
# single-copy-holder.sh [BIN_DIR] BIN_DIR holds `leleka` (default /data/leleka-e2e/decode/dt/bin-singlecopy)
# The memfd is SPARSE by default (`--sparse-ple`: only the 14.9 GiB the serve path reads; holes elsewhere), the form of profile rtx5090-32g. A full 55.3 GB memfd is a second
# copy of model bytes next to the resident expert bank (36.6 GiB nobody reads; the 2026-11-09 server measurement, docs/design/single-copy-ram-2026-11-09.md), and `leleka run`
# now refuses it for a ple_only profile. HOLDER_MEMFD=full restores the full copy (jobs whose profile is memfd_extents=full, with LELEKA_ALLOW_FULL_MEMFD=1 where needed).
# Run it detached: cd ~/work/gpu-runs/holder2 && rm -f jobs/STOP && setsid nohup bash /data/leleka-e2e/single-copy/tools/single-copy-holder.sh > holder3.out 2>&1 &
set -u
BIN=${1:-/data/leleka-e2e/decode/dt/bin-singlecopy}
T=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
KAR=/home/para/work/leleka/models/leleka-gates/assets/qwen-iq3-s-l2-v4.kar
JOBS=$HOME/work/gpu-runs/holder2/jobs
until mkdir "$HOME/work/gpu-runs/MODEL.lock" 2>/dev/null; do sleep 20; done
trap 'rmdir "$HOME/work/gpu-runs/MODEL.lock"' EXIT
cd "$HOME/work/gpu-runs/holder2" || exit 1
rm -f "$JOBS/READY"
exec_start=$(date +%s)
SPARSE=--sparse-ple; [ "${HOLDER_MEMFD:-sparse}" = full ] && SPARSE=
LELEKA_LOAD_THREADS=${LELEKA_LOAD_THREADS:-8} "$BIN/leleka" seal-exec --file "$KAR" --expect-bytes 55295529472 $SPARSE -- python3 "$T/single-copy-holder.py" '{FD}' "$JOBS"
echo "holder3 ended rc=$? after $(( $(date +%s) - exec_start )) s"