Merge remote-tracking branch 'origin/main' into claude/laptop-vs-vanilla

This commit is contained in:
Pavlo Ratushnyi
2026-10-27 23:44:44 +01:00
4 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -510,7 +510,7 @@ mod tests {
let server = Profile::builtin("rtx5090-32g").unwrap();
assert_eq!(
server.memory.args(),
["--prefix-cache-mib", "auto", "--prefix-cache-tail", "reply"].map(str::to_owned).to_vec()
["--prefix-cache-mib", "auto", "--prefix-cache-tail", "reply", "--prefix-cache-block", "8192"].map(str::to_owned).to_vec()
);
let mut bad = server.memory.clone();
bad.prefix_cache_tail = Some("always".into());
+7 -7
View File
@@ -572,8 +572,8 @@ mod tests {
fn runtime_settings_become_profile_fields_with_the_engines_ranges() {
let mut profile = Profile::builtin("rtx5090-32g").unwrap();
let settings = json!({
"context_tokens": 131072, "prefill_capacity": 8192, "kv_resident": 0, "prefix_cache_mib": "20480",
"prefix_cache_tail": "reply", "prefix_cache_block": 8192, "prefix_retention_min": 30, "cpu_workers": 6, "spec_min_p": 0.5
"context_tokens": 131072, "prefill_capacity": 4096, "kv_resident": 0, "prefix_cache_mib": "20480",
"prefix_cache_tail": "reply", "prefix_cache_block": 4096, "prefix_retention_min": 30, "cpu_workers": 6, "spec_min_p": 0.5
});
let changed = apply_settings(&mut profile, settings.as_object().unwrap()).unwrap();
for name in [
@@ -593,7 +593,7 @@ mod tests {
profile.prefill_capacity,
profile.kv_resident
),
(131072, Some(8192), Some(0))
(131072, Some(4096), Some(0))
);
assert_eq!(profile.memory.prefix_cache_mib.as_deref(), Some("20480"));
assert_eq!(profile.memory.prefix_cache_tail.as_deref(), Some("reply"));
@@ -602,7 +602,7 @@ mod tests {
profile.memory.prefix_cache_block,
profile.memory.prefix_retention_min
),
(Some(8192), Some(30))
(Some(4096), Some(30))
);
assert_eq!(
profile.engine_env.get(CPU_WORKERS_ENV).map(String::as_str),
@@ -634,7 +634,7 @@ mod tests {
let args = config.engine_args(crate::config::KarArg::Fd).join(" ");
assert!(
args.contains("--context-tokens 131072")
&& args.contains("--original-prefill-capacity 8192"),
&& args.contains("--original-prefill-capacity 4096"),
"{args}"
);
assert!(
@@ -643,7 +643,7 @@ mod tests {
);
assert!(
args.contains("--prefix-cache-tail reply")
&& args.contains("--prefix-cache-block 8192"),
&& args.contains("--prefix-cache-block 4096"),
"{args}"
);
assert!(args.contains("--spec-min-p 0.5"), "{args}");
@@ -670,7 +670,7 @@ mod tests {
(json!({"prefix_cache_mib": "lots"}), "prefix_cache_mib"),
(json!({"prefix_cache_block": 300}), "multiple of 256"),
(
json!({"prefix_cache_block": 8192}),
json!({"prefill_capacity": 4096, "prefix_cache_block": 8192}),
"larger than the prefill chunk",
),
(json!({"nonsense": 1}), "unknown setting"),
@@ -1,11 +1,12 @@
{
"name": "rtx5090-32g",
"description": "RTX 5090 class server (sm_120, 32 GB VRAM, >= 100 GiB RAM). The 55 GB level-2 KAR archive is copied once into a sealed memfd and the 50 GB routed-expert bank is a page-locked RAM copy (the bring-up smoke form). Reference-equivalent agent configuration (docs/e2e-run.md 7d: 30 GiB GPU budget, expert tier auto-sized per layer from data/expert-profile.bin, adaptive speculative window with spec-min-p 0, MTP draft vocabulary, prefix cache auto with request-end checkpoints (reply), chain kernels): weighted decode 129-130 tok/s in the reference-equivalent real Codex sessions on the 5090, +5 % from the adaptive window in the CRM replay. Not a formally quality-gated profile.",
"description": "RTX 5090 class server (sm_120, 32 GB VRAM, >= 100 GiB RAM). The 55 GB level-2 KAR archive is copied once into a sealed memfd and the 50 GB routed-expert bank is a page-locked RAM copy (the bring-up smoke form). Reference-equivalent agent configuration (docs/e2e-run.md 7d: 30 GiB GPU budget, expert tier auto-sized per layer from data/expert-profile.bin, adaptive speculative window with spec-min-p 0, MTP draft vocabulary, prefix cache auto with request-end checkpoints (reply), chain kernels): weighted decode 129-130 tok/s in the reference-equivalent real Codex sessions on the 5090, +5 % from the adaptive window in the CRM replay. Prompt chunk and prefix-cache grid 8192 (paired 256k session on the 5090: TTFT sum 131 s at 2048 against 55-60 s at 8192, docs/upstream-port-plan.md). Not a formally quality-gated profile.",
"select": {"sm_min": 120, "sm_max": 130, "vram_mib_min": 30000, "vram_mib_max": 1000000},
"gpu_budget_bytes": 32212254720,
"spec_min_p": 0.0,
"expert_profile": "data/expert-profile.bin",
"context_tokens": 262144,
"prefill_capacity": 8192,
"kar_source": "memfd",
"expert_source": "resident",
"min_driver_major": 595,
@@ -13,5 +14,5 @@
"min_ram_total_bytes": 107374182400,
"min_ram_available_bytes": 113000000000,
"engine_env": {"LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER": "yes", "LELEKA_CHAIN": "all"},
"memory": {"prefix_cache_mib": "auto", "prefix_cache_tail": "reply", "soft_floor_mib": 4096, "hard_floor_mib": 2048, "reserve_mib": 2048, "lock": "try", "heal": true}
"memory": {"prefix_cache_mib": "auto", "prefix_cache_tail": "reply", "prefix_cache_block": 8192, "soft_floor_mib": 4096, "hard_floor_mib": 2048, "reserve_mib": 2048, "lock": "try", "heal": true}
}
+1 -1
View File
@@ -162,7 +162,7 @@ leleka status # prints "settings in force" with the engine telemetry
| setting | meaning | note |
| --- | --- | --- |
| `--context-tokens N` | context length (prompt plus output of one request) | 1..262144; bounded by the VRAM left for the K/V window |
| `--prefill-capacity N` | prefill chunk (256 ... 8192) | 8192 prefills a cold 100k prompt about twice as fast as 2048; takes VRAM from the expert cache |
| `--prefill-capacity N` | prefill chunk (256 ... 8192) | 8192 prefills a cold 100k prompt about twice as fast as 2048; takes VRAM from the expert cache. The `rtx5090-32g` profile ships 8192 (with `--prefix-cache-block 8192`): 256k session TTFT sum 131 s at 2048 against 55-60 s |
| `--kv-resident N` | K/V cells per layer kept in VRAM | fixed for the life of the process: only the value in force is accepted (a different one needs a restart; 9r1 showed the engine refuses it) |
| `--prefix-cache-mib auto\|off\|N` | host-RAM budget of the cross-session prefix cache | `off` drops the cache |
| `--prefix-cache-tail off\|prompt\|reply` | request-end checkpoints | `docs/prefix-cache.md` |