Pavlo RatushnyiandClaude Sonnet 5.5 40fc3eab2b Fast cold load: large-block, deep-queue reads for the sealed archive copy, the expert bank and the hash passes
The cold start of the 5090 server is dominated by reading two things: the 55 GB KAR archive (copied into the sealed memfd) and the 50 GB of
routed-expert tensors of shard 0 (copied into the page-locked bank). A plain read() loop asks the NVMe for one 128 KiB readahead window
at a time (queue depth 1-2; the drive's max_sectors_kb is 128): 8-35 MB/s after a reboot, 2003.8 s for the first holder
(docs/experiments/baseline-pair-5090.md section 9).

* model-format/bulk_read.rs (new, no unsafe): N threads each read blocks of 8 MiB. Direct (default): O_DIRECT through the open file's
  /proc/self/fd entry (no path lookup) into 4 KiB-aligned bounce buffers, so the page cache is never touched and nothing has to be evicted;
  Advise: buffered pread with POSIX_FADV_WILLNEED ahead and DONTNEED behind (a bounded window); Plain: large pread + DONTNEED. Direct falls
  back to Advise where O_DIRECT is refused. Memory is threads x 8 MiB. Switches for A/B in one binary: LELEKA_LOAD_READ=direct|advise|plain,
  LELEKA_LOAD_THREADS, LELEKA_LOAD_CHUNK_MIB, LELEKA_LOAD_AHEAD_MIB; LELEKA_LOAD_READ=legacy keeps the old sequential loop for the bank.
* deploy/sealed.rs: the memfd fill uses it (seal_file_report also returns how the file was read; seal_file_with_identity is unchanged).
* gguf.rs read_file_span_into: spans of 64 MiB and more (the expert tensors) use it; smaller spans and every failure mode are as before.
* readahead.rs (the SHA-256/CRC passes of a first verification): WILLNEED 512 MiB ahead of the reader thread.
* examples/bulk_read_bench.rs + bulk_read_digest.py: offline cold-read measurement with a reproducible digest (SHA-256 over the SHA-256 of
  consecutive blocks), device-level read/write accounting so a shared disk shows.

Measured on rnr5090 (Lexar NM610PRO, DRAM-less, HMB; kernel 7.0.0-38; another agent's jobs share the drive, so every figure carries its
"other" volume; page cache of the span evicted first with posix_fadvise(DONTNEED), never drop_caches):
* whole KAR file, 51.5 GiB, new default (direct, 32 x 8 MiB): 152.9 s (362 MB/s) and 159.8 s (346 MB/s, with the digest), nothing else on the
  drive; Cached 62 -> 59 GiB (no cache growth). Target < 5 min met.
* old patterns, same day: one thread, 16-32 MiB reads (the holder's pattern) 65, 86, 105, 154 MB/s on 2-8 GiB cold slices (55 GB in 6-14 min);
  8 threads x 32 MiB buffered (the old sealed.rs pattern) 240 MB/s while sharing the drive; the recorded cold-after-reboot holder 2003.8 s.
* strategy matrix (4 rounds x 7 configs, fresh 2 GiB regions, MB/s per round, median of 4): advise 16x16 MiB 230 574 194 1126 (402);
  direct 32x8 185 554 1133 113 (369); advise 32x8 277 454 229 510 (365); plain 16x16 385 257 979 207 (321); direct 16x8 180 311 351 174 (245);
  direct 8x32 149 317 271 138 (210); one thread 65 201 123 86 (105). The drive's speed varies 10x between regions and moments whatever the
  strategy, so the multi-thread configs are indistinguishable here; every one of them beats one thread. Direct is the default because it
  leaves the page cache untouched (nothing to evict, the machine's free-memory state is not changed), not because it is faster.
* identity: an 8 GiB slice read with the new code has the same block-digest chain as a plain sequential pass in Python
  (8b8b21b830cf938b1f0cec60a5a8127d2489e33e1f853cd792b18497b2b081a6, both); unit tests compare every strategy with the source for aligned and
  ragged spans. The engine's own SHA-256/CRC check of the sealed memfd and the replay gate are in the GPU run recorded in docs/unattended.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 20:54:28 +01:00

Leleka / Strata Next

Leleka is the independent Rust NVIDIA inference runtime being developed from this repository. The complete tracked Strata Next source tree was imported from paveldhq/strata-next commit 1263e88f8947b9796924eb7e8d8d7af08b589049; see docs/upstream.md for the pinned Strata engine provenance. The imported desktop application, Rust control plane, deployment code, model tooling, tests, and reference engine are all here.

The migration is staged: Leleka must eventually run without a Strata process, Strata source, Python, or a separately installed CUDA Toolkit on the target host. Until the replacement passes the same protocol, model-quality, and operational gates, Strata remains the behavior baseline. No model family or performance gain is claimed for Leleka until its real-model gates pass.

Repository layout

  • crates/backend-api/ — Leleka's versioned Rust backend contract.
  • crates/tokenizer/ — the Qwen35 byte-level BPE tokenizer extracted as a backend-independent Rust crate.
  • desktop/, desktop-core/ — current desktop application and its Rust core.
  • control-plane/ — current Rust API, Responses handling, and worker supervisor.
  • engine/strata/ — pinned upstream Strata reference; retained during migration.
  • gpu/ — experimental optimization components, including KAR.
  • integrations/, manifests/, deploy/, scripts/ — client integration, model profiles, packaging, and development/test tooling.
  • PROJECT_CHARTER.md, docs/ — requirements, provenance, decisions, and performance/quality gates.

Model weights, request captures, credentials, local logs, and generated build artifacts remain outside Git or under ignored paths.

Current Leleka scope

Leleka currently has a versioned backend contract and a standalone Qwen35 BPE tokenizer crate. The existing Rust control plane now consumes that shared tokenizer crate instead of maintaining a second copy; its oracle-parity tests remain in the workspace. Leleka still has no independent inference backend or CUDA integration, so this does not yet serve a model independently. The desktop app and the rest of the control plane remain available as migration source in this repository.

Development

Run the Rust workspace tests and lint:

cargo test --workspace --locked
cargo clippy --workspace --all-targets --all-features -- -D warnings

For the Linux release requirements, see PROJECT_CHARTER.md and the independent engine design.

S
Description
No description provided
Readme MIT
77 MiB
Languages
Rust 69.4%
Python 12.1%
Cuda 10.1%
Shell 4%
C++ 2.3%
Other 1.8%