feat(moe): add heterogeneous NVMe expert streaming tier - #560
Conversation
|
Follow-up validation at
The published IQ1_S checkpoint defaults to Strix as primary in this comparison because its approximately 58 GiB non-routed allocation does not fit the 32 GiB R9700. R9700-primary remains an explicit harness option for a future non-routed placement or smaller compiled checkpoint. Fresh CI for the exact head SHA: https://github.com/Luce-Org/lucebox/actions/runs/30671619387 |
Lucebox3 qualification: adaptive fused resident decodeCommit 3450da3 adds a model-neutral hot-path optimization for routed MoE decode.
Paired Kimi-K3-shaped routed-core microbenchmarks (896 experts, top-16, 92 MoE layers, 3584 to 3072 to 3584, IQ1_S, SiTU; one cold token followed by 49 route-reuse tokens):
Graph submissions fell from 73,600 to 5,980 over the run: 1,472 cold first-token expert graphs plus 4,508 fused layer graphs. A 0%-cache-hit guard run activated zero fused launches and retained the original cold path. Fresh HIP/gfx1151 and CUDA/sm_86 builds pass the expanded numerical test suite, including F32/MXFP4, cold fallback, cache-pointer rebinding, and changed routes/weights. These are routed-core measurements, not full-model Kimi generation results. |
# Conflicts: # server/docs/DS4.md # server/docs/ENVIRONMENT.md # server/src/deepseek4/deepseek4_backend.cpp # server/src/server/server_main.cpp
|
Mixed-vendor update (Lucebox4):
CUDA execution and the full heterogeneous Kimi measurement remain pending because the Lucebox4 RTX 3090 reported Xid 79 / fallen off bus. Driver reset and PCI function reset did not recover it; a reboot or power cycle is required. No mixed-vendor speed claim is made yet. |
|
Lucebox4 post-reset qualification (2026-08-04):
The full run was stopped during startup after auto-sizing a 59.24 GiB Strix cache: whole-pool zero initialization remained active beyond 180 seconds and left only about 5.5 GiB RAM headroom. This is now a concrete software issue to fix before reporting heterogeneous Kimi throughput; it is not an RTX failure. |
|
Cache/allocation update (
Full Kimi-K3 UD-IQ1_S, Lucebox4 mixed HIP/CUDA, one NVMe, identical 29-token prompt + 8-token completion:
That is 16.8% lower decode time and 13.7% lower wall time, with byte-identical generated text. Automatic caches now initialize directly at approximately 32.7 GiB on Strix and 21.6 GiB on CUDA instead of probing/hanging on an unsafe approximately 59 GiB Strix allocation. Validation on Lucebox4: mixed HIP/CUDA interop and native-memory query pass; streamed-expert numerical tests pass independently on HIP and CUDA; NVMe scheduler/package tests pass; benchmark script tests pass (7/7). The allocation bug is resolved. The remaining approximately 0.4 target tok/s limit is the single-NVMe, tensor-major three-read expert layout, not cache initialization. |
Summary
The model's native router remains authoritative. Placement and caching decide where selected expert contributions execute; they do not substitute routes.
Dual-owner execution
MoeStreamDualOwnerExecutorcomposes two ordinary stream engines:(layer, expert)has one stable ownerMoeHybridPlacementplan selects primary-owned hot experts; a deterministic hash is the bring-up fallbackio_uring, pinned staging, device cache, and persistent expert graphsFor a dual-owner layer, the measured target is therefore
max(primary branch, secondary branch)rather than their sum.Kimi-K3 integration
-NNNNN-of-NNNNN.ggufsets, including the normal case where only shard 1 has global metadataProduction Kimi defaults to file-backed routed experts. Resident mode remains a deterministic oracle for small fixtures.
Deployment modes
Strix Halo only
Leaving
DFLASH_MOE_TP_GPUunset keeps resident text tensors, the warm expert cache, and selected-expert compute on the selected Strix device. No R9700 or peer access is required.Full Lucebox
The speed-oriented topology is:
Set
DFLASH_MOE_TP_GPU=<strix-gpu>and select the R9700 with--target-device hip:<r9700-gpu>. This is functional ownership within every routed layer, not a contiguous layer split, so it does not use--target-devices.This routed-owner feature does not solve placement of a non-routed core larger than R9700 VRAM. The current full Kimi quant has approximately 58 GiB of non-routed text weights, so running that exact topology at full scale also requires a separate non-routed tensor/layer plan. The Strix-only SSD path remains capacity-safe today.
Validation
Lucebox4/gfx1151:
326/326 server unit tests pass
the model-neutral streamed MoE GPU numerical test passes
the real two-shard
Kimi-K3-0.40B-MXFP4fixture runs with native MXFP4 expert tensorsresident and file-backed execution produce the same eight greedy output IDs:
318 57195 11 1459 387 1495 2189 261a forced 1 MiB device cache causes 163 evictions, proving the result uses the split-GGUF SSD path
the same single-device adapter reaches 157.49 tok/s decode on the tiny fixture; this is not a full-model estimate
Lucebox5/gfx1201+gfx1151:
R9700 primary + Strix secondary initializes two independent
io_uring/cache/compute enginesstable ownership exercises both devices; top-2 layers that naturally land on one owner take the direct path
dual-owner and single-R9700 runs produce the same eight greedy IDs for the test prompt:
289 646 108263 30 374 5058 667 13after warm-up, traced dual-branch layer wall time matches the slower branch to within a few microseconds
two pre-existing Qwen servers occupied both GPUs during qualification, so no controlled end-to-end dual-owner speedup is claimed from this tiny fixture
The generic data plane was separately qualified at 4.202 GiB/s raw scheduler throughput, 4.275 GiB/s SSD-to-Strix, and 2.940 GiB/s SSD-to-R9700. A full Kimi IQ1_S-shaped fully-cold workload sustains 0.430 storage-limited token/s at 3.804 GiB/s.
Current boundaries
Controls
DFLASH_MOE_TP_GPU=<secondary-gpu>DFLASH_MOE_PLACEMENT=<placement.json>DFLASH_MOE_PRIMARY_SHARE_PER_MILLE=<0..1000>DFLASH_MOE_DUAL_STREAM_TRACE=1DFLASH_MOE_NVME_BACKEND=auto|uring|pread|mmapDFLASH_MOE_NVME_DEVICE_CACHE_MB=<MiB>DFLASH_MOE_NVME_SLOTS=<count>DFLASH_MOE_NVME_IO_THREADS=<count>DFLASH_MOE_NVME_GRAPH_CACHE=<count>See
server/docs/MOE_NVME_STREAMING.mdandserver/docs/KIMI_K3_HETERO.mdfor architecture, operation, measurements, and qualification details.