Repository navigation
Releases
v0.2.4
What's New
DFlash2 Speculative Decoding Preserved Across Prefix Cache Hits (Metal + CUDA)
- Snapshot & restore DFlash2 5-layer SWA draft KV cache:
save_boundary_snapshotandrestore_boundary_snapshotnow also save and restore DFlash2's 5-layer SWA KV cache on both Apple Silicon (src/metal/model_metal.mm, ~40.5 MiB/snapshot accounted for inest_kv_gib_with_snaps) and CUDA / DGX Spark (src/dspark.hpp,src/dspark.cu,src/model.cu). - Seamless
spec=df2continuation on cached turns:OpenAIServertracks per-snapshot DFlash2 validity and position (snap_dspark_valid/snap_dspark_pos), resumingcommit_dspark_contexton the uncached suffix when restoring a valid DFlash2 snapshot. - Verified live on Apple M4 16 GiB Mac Mini:
- Turn 2 (2,246 tokens,
cached=2176, omittingreasoning_content): TTFT1.48 s(vs43.76 scold, 29.6× faster) and decode24.99 tok/swithspec=df2(mean_a=5.25)(vs13.19 tok/swithspec=offinv0.2.3, +89.5% faster decode) with 100% bit-exact greedy parity against cold prefill.
- Turn 2 (2,246 tokens,
v0.2.3
What's New
Prefix Caching on 16 GiB Apple Silicon Macs
- Adaptive 1-snapshot RadixPrefixCache on
low_memsingle-slot Macs: On single-slot 16 GiB Macs (gpu_low_mem && max_slots == 1), automatically allocate 1 boundary snapshot (~0.20 GiB) when it fits within the existing KV memory budget without reducingmax_seq_len(e.g. Apple M4 16 GiB:est KV 0.95 GiB <= 1.12 GiB, actual0.91 GiBat full32,768context). Multi-turn chats (including clients likepithat omit priorreasoning_content) now reuse the full block-aligned prompt prefix with 100% bit-exact greedy parity — verified live on Apple M4 16 GiB dropping 2.2K-token Turn 2 TTFT from 43.1 s -> 1.49 s (28.9× faster,cached=2176/2246). - 0-byte in-place slot prefix caching fallback (
num_snapshots == 0): When a tighter memory budget requiresnum_snapshots == 0, single-slot servers retain the idle slot's KV/SConv/DFlash2 state and track exact forwarded tokens (match_inplace_slot_prefix) for lossless exact-extension reuse with 0 bytes of extra GPU memory.
v0.2.2
What's Fixed & Improved
Server Reliability
- Clamp
max_tokensto remaining context capacity: Only return HTTP 400 (prompt exceeds max_seq_len) whenprompt_len >= max_seq_len; otherwise clampmax_tokensto[1, max_seq_len - prompt_len]at both HTTP intake and prefill initialization (fixes HTTP 400 rejections for clients likepithat sendmax_tokens: 32768on top of a prompt). - SSE keepalives & prefill/queue cancellation: Send SSE
: keepalive\n\ncomments every 5 seconds while waiting for prefill or buffering long tool calls so reverse proxies / CDNs (e.g. Cloudflare 100s idle timeout) and clients do not drop long-context streams mid-prefill withStream ended without finish_reason. Detect broken client sockets (while preservingSHUT_WRhalf-closed clients), cancel abandoned requests during queueing and chunked prefill, and synchronize cancellation telemetry with worker completion.
Apple Silicon (Metal) Performance
- Tiled
simdgroup_matrixFP8 GEMM (fp8_gemm_tiled_kernel): Added a 32x32 tiled FP8->BF16simdgroup_matrixGEMM kernel forM >= 9inencode_linear_fp8, replacing the 1-token-per-rowfp8_gemv_kernelfallback onlow_mem(16 GiB) Apple Silicon GPUs where BF16 dense weights are released. Measured +22.4% faster 16K prefill on Apple M4 16 GiB (35.6 -> 43.5 tok/s, saving ~83 s on a 16K prompt) with 0 bytes extra GPU memory.
warpgrid v0.2.1
warpgrid v0.2.1 optimizes Apple Metal KV memory usage and budgeting for 16 GB Apple Silicon Macs, cutting single-slot Q3 + DFlash 2 KV overhead by ~270 MiB and unlocking 16K context out of the box — and 32K context (--max-seq-len 32768, 0.71 GiB KV, 722 ms warm TTFT, 23.06 tok/s) with sudo sysctl -w iogpu.wired_limit_mb=14336.
What's New & Fixed
- Skip duplicate local-SWA snapshot pool on single-slot 16 GB Macs: Avoids allocating ~240 MiB of redundant local-SWA prefill snapshots when
low_mem && max_slots == 1, freeing GPU wired memory directly for longer global context. - Actual checkpoint size + exact 5-layer DFlash 2 KV budgeting: Uses the real safetensors file size on disk, accounts for
low_memBF16-dense release, and models DFlash 2's fixed 5-layer × 2072-token sliding window accurately. - Hardware-verified on 16 GB Apple M4 Mac mini with
cglab-org/Inkling-2-Mini-Q3-warpgrid+incoai/Inkling-2-Mini-DFlash2(--max-chunk 256 --max-seq-len 32768withiogpu.wired_limit_mb=14336):0.71 GiBKV,722 mswarm TTFT,23.06 tok/s(mean_a = 4.00), exact Canary323, 8% free system memory with desktop apps running.
Prebuilt Binaries
| Asset | Platform | Requirements |
|---|---|---|
warpgrid-v0.2.1-macos-arm64.tar.gz |
Apple Silicon (arm64, Metal) |
macOS 15.0+ (embedded precompiled .metallib, links Apple system frameworks only) |
warpgrid-v0.2.1-linux-aarch64-dgx-spark-cuda13.tar.gz |
NVIDIA DGX Spark (aarch64, GB10 sm_121a) |
Linux aarch64 with CUDA 13.0 runtime (libcublas.so.13, libcublasLt.so.13) |
Verify checksums with SHA256SUMS.txt:
shasum -a 256 -c SHA256SUMS.txtwarpgrid v0.2.0
warpgrid v0.2.0 introduces Cross-Slot Paged Global KV (Radix Prefix Cache) and Chunked Prefill Interleaving across both NVIDIA Blackwell CUDA (sm_121a) and Apple Silicon Metal.
What's New
- Cross-Slot Paged Global KV (
block_size = 64):- Shared physical FP8 E4M3 global KV block pool with
d_block_tablesindirection across all CUDA (CUDA-graph-safe) and Apple Metal global attention kernels. - Reference-counted
RadixPrefixCachewith LRU leaf eviction and pinned boundary snapshots (local SWA ring +sconvstates) so concurrent slots share identical system prompts with zero global KV duplication. - Leader/follower concurrent prefix deduplication: when multiple queued requests share an uncached system prompt, the leader prefills and publishes the shared prefix once before followers are admitted.
- Shared physical FP8 E4M3 global KV block pool with
- Chunked Prefill Interleaving:
- Shortest-remaining-prefill-first admission combined with chunked prefill (
--max-chunk) interleaved with 4-step decode bursts so cache-hit and active decoding streams are no longer head-of-line blocked behind incoming 30K+ cold prefills.
- Shortest-remaining-prefill-first admission combined with chunked prefill (
- HTTP Hardening:
- Case-insensitive
Content-Lengthheader parsing (parse_content_length) fixing large POST bodies from clients like Pythonurllibthat sendContent-length:.
- Case-insensitive
DGX Spark Benchmark (c = 8 @ ~30K, 4 shared system prompt / 4 unshared)
| Scenario | Shared Half (29,992 tok) |
Unshared Half (30,011 tok) |
Shared vs. Unshared TTFT Gap |
|---|---|---|---|
| Round 1 (cold shared, leader + 3 followers) | 34.86s med (3/4 hit 29,952) |
107.62s med (61.9–150.4s) |
3.1× faster TTFT |
| Round 2 (warm shared vs. fresh unshared) | 1.58s med (4/4 hit 29,952, 99.87%) |
80.49s med (34.8–123.2s) |
51× faster TTFT |
Prebuilt Binaries
| Asset | Platform | Requirements |
|---|---|---|
warpgrid-v0.2.0-macos-arm64.tar.gz |
Apple Silicon (arm64, Metal) |
macOS 15.0+ (embedded precompiled .metallib, links Apple system frameworks only) |
warpgrid-v0.2.0-linux-aarch64-dgx-spark-cuda13.tar.gz |
NVIDIA DGX Spark (aarch64, GB10 sm_121a) |
Linux aarch64 with CUDA 13.0 runtime (libcublas.so.13, libcublasLt.so.13) |
Verify checksums with SHA256SUMS.txt:
shasum -a 256 -c SHA256SUMS.txtwarpgrid v0.1.0
Initial public release of warpgrid — a standalone C++20/GPU LLM inference engine for unified-memory workstations and local accelerators with native NVIDIA Blackwell CUDA (sm_121a) and Apple Silicon Metal backends.
Highlights
- Native
Inkling-2-MiniNVFP4/MXFP8 &Q3_G64/Q2_G64inference with zero Python/PyTorch/MLX runtime dependencies. - Native DFlash 2 block-diffusion speculative drafter (
--dflash2) on both CUDA (100% CUDA-graphed) and Apple Metal — loadsincoai/Inkling-2-Mini-DFlash2directly. - 16 GB Apple Silicon support via
cglab-org/Inkling-2-Mini-Q3-warpgrid(25.45 tok/scode with DFlash 2,90.0%HumanEval on M4 Mac mini). - Continuous batching (up to 8 slots × 139K context) with FP8 E4M3 global KV cache and exact prefix caching (
usage.prompt_tokens_details.cached_tokens). - Observability & Auth: OpenAI-compatible HTTP/SSE server (
/v1/chat/completions,/v1/models),/health,/status, Prometheus/Datadog/metrics, optional OTLP/HTTP tracing (--otlp-endpoint), and optional API key auth (--api-key/WARPGRID_API_KEY).
Prebuilt Binaries
| Asset | Platform | Requirements |
|---|---|---|
warpgrid-v0.1.0-macos-arm64.tar.gz |
Apple Silicon (arm64, Metal) |
macOS 15.0+ (embedded precompiled .metallib, links Apple system frameworks only) |
warpgrid-v0.1.0-linux-aarch64-dgx-spark-cuda13.tar.gz |
NVIDIA DGX Spark (aarch64, GB10 sm_121a) |
Linux aarch64 with CUDA 13.0 runtime (libcublas.so.13, libcublasLt.so.13) |
Verify checksums with SHA256SUMS.txt:
shasum -a 256 -c SHA256SUMS.txt