Commit Graph
532 Commits
Author SHA1 Message Date
Pavlo Ratushnyi 7b17d50bdc docs(memory): queued job 914 2026-10-18 05:08:21 +02:00
Pavlo Ratushnyi 8896b458b4 docs(memory): inventory, tests and laptop results; soak session length bounded by the context 2026-10-18 04:47:02 +02:00
Pavlo Ratushnyi 4f796d2d80 docs(memory): knobs and mapped-bank reserve 2026-10-18 04:08:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f53d54d122 test(control-plane): http_surface golden ignores the Rust-only status keys prefix_cache and memory; docs results
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 04:04:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 82d7734dde test(memory): reader scenario decodes a fixed number of tokens and lasts until the reader has streamed its volume
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:57:43 +02:00
Pavlo Ratushnyi d20c2a67af chore(memory): shed2 job script 2026-10-18 03:55:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e345a7fe56 test(memory): shed smoke re-centres the floors before the recovery phase
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:50:33 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 052a2fcc22 feat(memory): reserve the hot part of a file-mapped expert bank out of the elastic budget; measured fixed-footprint constant
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:12:02 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 1255374c2a fix(memory): PSI only counts while available memory is below 3x the soft floor (a page-cache reader raised PSI full to 5.2% with 68 GiB free in job 910)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:42:00 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e4f4e1e9a9 fix(control-plane): chat completions keeps Retry-After on a memory_pressure 503; gate test covers chat and messages
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:35:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 0b10800141 fix(control-plane): memory_view test deadlocked on its own read guard
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:33:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 51c82250f1 feat(memory): inventory totals separate file-mapped bytes from RAM; swap-out and PSI thresholds are tunable (LELEKA_MEMORY_SWAPOUT_PAGES_PER_S, _PSI_SOME_SHED, _PSI_FULL_REJECT)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:19:52 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c38042e8e3 chore(memory): job scripts and laptop runner under scripts/memory
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:03:09 +02:00
Pavlo Ratushnyi ed389d4de8 Merge branch 'claude/memory-safety-unsafe' into claude/memory-safety 2026-10-18 02:03:00 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 6413c9a3dd docs(memory-safety): unsafe and host-buffer lifetime review
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 95475335be docs(native-cpu-expert): SAFETY invariants, bounds asserts at the unsafe leaves, pool lifecycle tests
Documents the epoch-claim protocol behind the Shared Send/Sync impls, adds row-length, destination and alignment
asserts at the SIMD leaves and quantize_raw/float_dot/convert_bf16, and tests pool Drop joining and idle-gap stability.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 218afcda94 docs(cuda-driver): SAFETY invariants for FFI, mapped-host owners, file maps; checked_add in index import; audit tests
Comments only, plus: CUDA_MEMCPY2D layout asserts, checked_add in OriginalQsaResidentIndex::import span validation,
and model-free tests (mapped_audit_*, Records bounds, stager copy-job and file-map bounds, arena bounds, resident
span bounds after truncation).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 74f4ee07dd fix(cuda-driver): fence the cuMemsetD8 of the full-forward scratch before the first launch
cuMemsetD8_v2 is asynchronous with respect to the host and only ordered on the legacy default stream; the original=false
construction path had no later synchronous copy, so a kernel on a non-blocking stream could race the zeroing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:04 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3d9af8a0eb fix(cuda-driver): store-buffering races in the expert stager stop and MMQ host-stage finish, bound host-stage wait
stop/finish stored 'head' then loaded 'active' while a worker raised 'active' then claimed from 'head'; on x86 the
fence could return while a worker still copied from a source the caller then released. SeqCst on the four accesses.
HostStage::finish also let a helper waiting on 'released' overwrite a ring buffer still being read (re-check head after
the wait), and wait() now refuses a length beyond the bytes the job copied (page-locked buffers are uninitialised).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:04 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 0af0bfaed4 feat(memory): return evicted heap to the OS after a shed, planned-vs-measured column in the inventory table, docs draft
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:57:55 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3f2e85ea9 test(memory): prefix serve shed/restore and a churn test under random shed directives (exact resumes, store inside its budget)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:53:11 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 713235d8ed feat(memory): residency guard on its own thread, read-only remap of the archive, dead-sampler recovery, cgroup v1, swap A/B tool, lint fixes
- guard_archive maps a private read-only reopen of the descriptor (a write-sealed memfd refuses a shared mapping that could become writable on
  kernels up to 5.15); the residency read runs on its own thread; the sampler survives a panic and a stale level is re-evaluated by the
  requests themselves; cgroup v1 memory controller limits (WSL2 hybrid, old container hosts) are honoured.
- examples/swap_ab + scripts/memory/swap_ab.sh: A/B (unlocked, heal, mlock) of the memfd under real pressure fenced into one cgroup.
- Miri: procfs/host/plan/pressure/inventory/census/ledger/governor run clean (61 tests).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:51:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 eead818051 feat(memory): real-model memory smoke (inventory, soak, shed, reader), deploy profiles carry the memory budget
- backend_original_serve_memory_smoke.rs: scenarios inventory / soak / shed / reader and a model-free archive guard probe; floors
  moved next to the memory the host has now so the shed path runs far from the real limit; abort guard at 15 GiB.
- Governor::set_floors; stack prefix_bytes / prefix_budget_bytes accessors.
- leleka-deploy: Profile.memory (prefix_cache_mib, floors, reserve, share, lock, heal, resident budget) -> engine args and
  LELEKA_MEMORY_* environment; built-in profiles carry it; tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:40:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5ebd939b6f feat(memory): wire the governor into the runtime, the gRPC status and the control plane
- leleka-runtime: memory_governor glue (startup plan with refusal, KAR memfd lock/residency guard, VRAM check, load-ledger stages,
  inventory classes), prefix budget from the governor (auto/explicit clamped), shed directive applied per request and per prefill chunk,
  engine-side admission (503 memory_pressure text), page-cache release of the shards after the resident bank load, cgroup-aware
  available_memory.
- backend-api: Backend::memory_report (default None) and ScriptedEngine support; proto Snapshot.memory_json; desktop-core runtime_rpc and
  runtime-client carry it.
- control-plane: MemoryView, /v1/status `memory`, /metrics `memory`, 503 memory_pressure + Retry-After gate before queueing, engine-side
  refusal text mapped to the same 503; tests incl. a 600-request model-free soak (threads/fds/RSS flat).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:33:34 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7da6a63e61 feat(memory): leleka-memory crate: procfs/cgroup/PSI facts, inventory, load ledger, budget planner, pressure monitor, governor, memfd lock/residency guard, census
Model-free and CUDA-free. 64 unit tests (parsers, planner refusals with numbers, shed order and hysteresis, admission, sampler thread,
mlock/mincore/madvise over a descriptor, flatness check).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:20:21 +02:00
Pavlo Ratushnyi 7330ddb6d5 Merge branch 'claude/prefix-cache' into claude/port-gpu-bringup 2026-10-18 00:57:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 44e57ee30e docs(prefix-cache): final-policy agent trace (job 927), measured restore costs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 00:07:02 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 25538a8300 docs(prefix-cache): design, protocol, knobs, results (5090 jobs 921-926, laptop), remaining; 180k policy simulation; port-status row
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 23:54:47 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 dba10288dc fix(prefix-cache): a hit counts as shared evidence only on a branch point (histories fork below it), not because another session ran in between
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 22:12:25 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5b4c817f60 docs: decode parity findings, flags and paired A/B (jobs 980-985)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 21:33:35 +02:00
Pavlo Ratushnyi 8daba240d7 Merge branch 'claude/port-gpu-bringup' into claude/decode-parity
# Conflicts:
#	crates/leleka-runtime/src/qwen_forward/original_serve_residency.rs
2026-10-17 21:31:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3da9af763 feat(prefix-cache): default block/grid = prefill capacity (prefill at the chosen chunk speed)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 21:19:50 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 42f1edaf70 perf(serve): CPU leg: validated spans of admitted experts are reused without the per-expert source scope (LELEKA_OPEN_CACHE=off controls); spans inside the CPU leg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 20:49:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c32cfed135 fix(prefix-cache): a miss clears the live claim (the empty-prompt reset rewrites the first index row), budget profiles for the real RAM picture, import profiling spans
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 20:34:53 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 8af18396b8 feat(prefix-cache): pool protocol (summary through runtime gRPC, /v1/status, /v1/prefix_match), --prefix-cache-mib/--prefix-cache-block, laptop profile in the smoke, docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 19:47:53 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 d53db650fd test(prefix-cache): GPU smoke harness for interleaved agent sessions, model-free GPU round-trip of the K/V and index transfer
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 19:12:17 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 8ad4dd5d75 feat(prefix-cache): content-addressed multi-session prefix store, grid-aligned prefill, K/V+state park/import
Model-free store (block hash chain, shared blocks, adaptive admission/eviction by expected tokens saved
per byte, byte budget, pool summary/prefix_match), the grid option of PromptPlan, the driver/session
export+import of the host K/V image and index rows, and the stack binding (opt-in StackConfig::prefix).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 19:08:12 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 6b94e7c14f perf(serve): prompt-routing seed is on by default when the tier config is read from the environment (LELEKA_ORIGINAL_SERVE_SEED=off disables)
Operator decision: long-running agent sessions; a fresh process starts from the prompt's own routing. Measured first-request gain: docs/original-serve.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 18:31:11 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 a21198c5d9 perf(serve): DMA flag B / batch fall back to the plain calls when the driver refuses them; both opt-in on WSL
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 17:31:49 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5c8e9d91ca perf(serve): PCIe staging by DMA is the default (one batched submit, stream-write flag B); the copy kernel is --pcie-mode kernel
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 16:29:53 +02:00
Pavlo Ratushnyi 0b0d128fe2 Merge branch 'claude/deploy' into claude/port-gpu-bringup 2026-10-17 15:44:41 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 05d189f006 chore: executable bit on install.sh and package-release.py
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:41:32 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 71a4f95991 docs: map deploy.md to charter goal G2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:41:19 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3c1d75ec37 docs: deploy.md results, findings and open items
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:38:47 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b9fb5d0160 test(deploy): fake engine reports a refused load on its own stderr; summary hint for user units; ignore dist/
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:35:42 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 d70c1d8dca docs(serve): seed replicate on the merged base
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:26:49 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e03d97dd86 fix(runtime): production Original Load admits the routed-expert bank; deploy: operation polling, expert-source profile field
The Original serve Load never admitted an expert source (the serve smokes call
load_resident_expert_source themselves), so the stack's prompt arena failed with
InputRead on the first real Load through leleka-inference. leleka-inference gains
--expert-source resident|mapped; backend.rs admits the chosen bank before the
driver. leleka up passes it per profile and the supervisor stops waiting when the
load operation is FAILED/INDETERMINATE.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:18:02 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 361220b89f feat(deploy): --trust-archive, archive step covers shard verification, test robustness
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:00:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5bc008122b feat(deploy): API bind, --kar-fd, release packaging, install.sh and OCI recipe
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 14:42:17 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 d84e1a12c9 feat(deploy): leleka up/run - preflight, profiles, assets, install, supervisor, readiness
New crate leleka-deploy (binary leleka): idempotent one-command deployment with
preflight (driver, sm_120/sm_86, VRAM/RAM/disk, WSL2, cuBLAS 12, memfd), memory
profiles, plan/dry-run, stamped asset steps, systemd unit, and a native supervisor
that seals the KAR archive itself and hands it to the engine (no Python holder).
leleka-inference gains --kar-archive-file for the low-RAM read-only archive form.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 14:34:49 +02:00