xinfer-ai 0.13.7 → 0.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -329,7 +329,7 @@ xinfer --m mistralai/Ministral-3-3B --ui-server
329
329
  ```bash
330
330
  # Prerequisites: Rust compiler, CUDA Toolkit (optional) or Metal Xcode command line tool
331
331
  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
332
- sudo apt-get install -y git build-essential libssl-dev pkg-config
332
+ sudo apt-get install -y git build-essential
333
333
 
334
334
  export XINFER_REPO="https://github.com/guoqingbao/xinfer"
335
335
  # MacOS/Metal: replace features to `metal`
@@ -500,7 +500,7 @@ xinfer --m Qwen/Qwen3.6-27B-FP8 --ui-server --enable-tool-grammar
500
500
  | `--max-num-seqs` | Max concurrent requests (default: 32, macOS: 8) |
501
501
  | `--max-tokens` | Max tokens per response (default: 16384) |
502
502
  | `--kv-fraction` | GPU memory fraction for KV cache |
503
- | `--cpu-mem-fold` | CPU swap memory ratio (default: 0.2) |
503
+ | `--cpu-mem-fold` | CPU swap memory ratio (default: 0.5) |
504
504
  | `--pd-server` | Run as PD prefill server |
505
505
  | `--pd-client` | Run as PD decode client |
506
506
  | `--pd-url` | PD connection URL (`tcp://`, `http://`, `file://`) |
@@ -46,6 +46,31 @@ snapshot capture remains dense.
46
46
  - Cached KV reuse is automatic; no `session_id` is required.
47
47
  - Sliding window attention limits how much cached context is effectively used.
48
48
 
49
+ ## CPU swap with prefix cache
50
+
51
+ When prefix cache is enabled, live sequence preemption is partial:
52
+
53
+ - Leading prefix/shared blocks stay on GPU and keep their sequence reference.
54
+ - Only the sequence-owned suffix blocks are copied to CPU swap.
55
+ - Swap-in reuses the retained GPU prefix blocks, allocates new suffix blocks,
56
+ and copies only the suffix KV back from CPU.
57
+
58
+ This is different from prefix-cache offload. Prefix-cache offload only helps when
59
+ an evicted cached prefix is requested again later. Partial sequence swap helps
60
+ immediately under memory pressure because it avoids recomputing the active
61
+ sequence suffix after preemption, even when no future request reuses that suffix.
62
+ For hybrid Mamba/GDN models, the active recurrent state remains tied to the
63
+ swapped sequence lifecycle and is not released until the sequence finishes or is
64
+ cancelled. On CUDA, Mamba/GDN prefix snapshots use a separate two-tier cache:
65
+ device snapshots are the fast path, and snapshots evicted from device memory are
66
+ spilled to CPU so a later KV prefix hit can promote the matching recurrent state
67
+ back instead of falling back to a shorter partial hit. Metal uses unified memory,
68
+ so this CPU spill tier is disabled there. The CUDA CPU snapshot tier is 4x the
69
+ device snapshot capacity. Prompt/prefill snapshots and final decode-boundary
70
+ snapshots are protected from ordinary decode-time snapshot churn. When the CPU
71
+ snapshot tier is full, LRU eviction frees at least 10% of the tier in one batch
72
+ before accepting new GDN/Mamba snapshot offloads.
73
+
49
74
  ## Inspecting cache hits
50
75
 
51
76
  Chat completion responses include the prefix-cache hit count under
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xinfer-ai",
3
- "version": "0.13.7",
4
- "assetVersion": "0.13.7",
3
+ "version": "0.13.8",
4
+ "assetVersion": "0.13.8",
5
5
  "description": "xInfer — a high-performance LLM inference engine in Rust with CUDA/Metal acceleration",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/guoqingbao/xinfer#readme",