interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / docs / persistent-kv / BENCH.md

96 lines · 10594 bytes Raw Blame History Source

Persistent KV benchmark (cut C9, sc#485)

Binding design: ADR 0003 (sections 10, 15.1, 16.5). Cut and schema: CUTS.md C9 (B6, B7, B8). Evidence rules: ADR 0001 decisions 2 and 3.

What this measures

bench_persistent_kv runs conversations through the real runtime: the spine, the scheduler, NativeTransformerBackend over ReferenceCpuBackend (host CPU arithmetic, bf16 KV pool) with the synthetic reference test weights, and, for the restore mode, the C4 host filesystem store switched on through the daemon wiring (shared_kv::enable_persistent_kv). Host only: no GPU, no CUDA, no root.

Each row is one mode at one concurrency (1, 2, 4, 8 conversations) and one prompt length (512, 2048 tokens), repeated for a number of rounds:

modeworkloadwhat happenscache_state
resident-onlysingle_turnone request per conversation, store off; nothing ever leaves memorynone
cold-prefillsecond_turnturn 1, then turn 2 (turn-1 prompt + turn-1 output + 16 new tokens), store off; turn 2 prefills everythingnone
restore-from-page-cachesecond_turnthe same turns with the store on: turn 1 parks, turn 2 restores the stored prefix and prefills only the rest. The objects were written moments before and no cache was dropped. A row is refused unless every measured request committed a restorepage_cache
restore-from-deviceNOT_RUN: a device read needs the page cache dropped (root) and verified empty (ADR 15.1); the harness never uses sudodevice
native-physical (Spark, Pi 5)NOT_RUN in every report (B8): a host run cannot speak for native hardwaredevice

Only the turn-2 requests (or the single turn of resident-only) are timed. Every report records, per row: completed and failed requests, request latency p50/p95, time to first token p50/p95, decode tokens per second, the KV pool allocation, the peak holder bytes, the staging bytes, the peak RSS, the store dispatch depth, the restored token count, and every raw sample. The exact definition of each field is written into the report itself (definitions).

Rules the binary enforces (tests in crates/aien-kv-bench/tests/bench_persistent_kv_test.rs):

How to reproduce

cargo build --release -p aien-kv-bench --bin bench_persistent_kv
nice -n 19 ./target/release/bench_persistent_kv \
  --modes resident-only,cold-prefill,restore-from-page-cache,restore-from-device \
  --concurrency 1,2,4,8 --prompt-tokens 512,2048 --rounds 10 \
  --out benchmarks/data/persistent_kv_host_<UTC stamp>.json --store-root target/pkv-bench-store
./target/release/bench_persistent_kv --render benchmarks/data/persistent_kv_host_<UTC stamp>.json

--render re-checks the report (schema, labels, NOT_RUN rows, samples digest) and prints the table below.

Where the numbers live (ADR 0001)

The canonical record is the JSON file in benchmarks/data/, named by its measurement id. ADR 0001 names benchmarks/data/benchmarks_latest.json and a sync-docs tool; neither exists in the repository (also recorded in docs/plans/public-surface-cleanup.md). DOCS SILENT choice, narrowest rule: this bench writes its own file and never edits latest.json, master_benchmark_results.json or the inference sweep files, and the table below is generated by --render from that file, not typed by hand.

Results (host, generated from benchmarks/data/persistent_kv_host_20261014T010721Z.json)

Measurement BENCH-PKV-HOST-20261014T010721Z-5a07c36, commit 5a07c36ab753276f760494863f9a2b7585bb57ff, 2026-10-14T01:07:21Z UTC, platform hosted, backend NativeTransformerBackend over ReferenceCpuBackend (host CPU, FP32 arithmetic, bf16 KV pool), host: the DGX Spark (aarch64, 20 CPUs, kernel 7.0.0-1019-nvidia, nice 19).

Command: bench_persistent_kv --modes resident-only,cold-prefill,restore-from-page-cache,restore-from-device --concurrency 1,2,4,8 --prompt-tokens 512,2048 --rounds 10 --out benchmarks/data/persistent_kv_host_20261014T010721Z.json --store-root target/pkv-bench-store

modestatuscache_stateconcpromptdone/failedp50 usp95 usttft p50 usttft p95 usdecode tok/srestored tokpool bytesholder peakstagingpeak RSSqueue depth
resident-onlyOKnone151210/026885307652170327365350305283840069140480
resident-onlyOKnone251220/067801773904392250057124708601600072826880
resident-onlyOKnone451240/012031412833686016912131692015237120080076800
resident-onlyOKnone851280/02125632361901585251881982343028508160094126080
resident-onlyOKnone1204810/022423622934421102321672111800141312000138321920
resident-onlyOKnone2204820/04770434860854227824352215920262963200151715840
resident-onlyOKnone4204840/09446579592014471678668411160506265600176783360
resident-onlyOKnone8204880/0185060218864128626841730094840992870400227901440
cold-prefillOKnone151210/0259473020221395253013562052838400133898240
cold-prefillOKnone251220/0733858525545830595461151086016000137216000
cold-prefillOKnone451240/01152921393588536710055017580152371200143851520
cold-prefillOKnone851280/023992525034117200218968517420285081600157122560
cold-prefillOKnone1204810/023247023695621978922424811630141312000151511040
cold-prefillOKnone2204820/04913995198644372174561144310262963200164085760
cold-prefillOKnone4204840/09486559620568396608703381130506265600189480960
cold-prefillOKnone8204880/01871585190611812677481753110820992870400243834880
restore-from-page-cacheOKpage_cache151210/0100631188437124969268251205283841013763072153190404
restore-from-page-cacheOKpage_cache251220/03338638450376973291020102408601602027523072158433284
restore-from-page-cacheOKpage_cache451240/04549156199123471419613562048015237124055043072165068804
restore-from-page-cacheOKpage_cache851280/07584782291237892865016344096028508168110083072178544644
restore-from-page-cacheOKpage_cache1204810/0363604026911278153917492048014131203962883072164167684
restore-from-page-cacheOKpage_cache2204820/0762988714412971237964474096026296327925763072176455684
restore-from-page-cacheOKpage_cache4204840/0135964156081388425396548681920506265615851523072200949764
restore-from-page-cacheOKpage_cache8204880/02151892487437213091416560163840992870431703043072250224644
restore-from-device (hosted)NOT_RUNdevice--------------
native-physical (native_physical)NOT_RUNdevice--------------
native-physical (native physical (Pi 5))NOT_RUNdevice--------------

NOT_RUN reasons:

What the run shows, and what it does not