diff --git a/docs/Dankserver System Specs.md b/docs/Dankserver System Specs.md index 42c56b2..22bf366 100644 --- a/docs/Dankserver System Specs.md +++ b/docs/Dankserver System Specs.md @@ -51,11 +51,11 @@ Dankserver is an NVIDIA GPU server for vLLM inference. The host runs Ubuntu 24.0 ### Active Services -The active `frank-default-small` service (llama.cpp, `b10108+`) serves the HauhauCS Qwen3.6-35B-A3B uncensored `Q6_K_P` model on port 7770 with **ngram-mod** speculative decoding. It runs **4 parallel slots** at 200000 context each (pool 800000). Of the 40 layers' MoE expert weights, **32 sit on CPU** (`--n-cpu-moe 32`) while the remaining **8 layers' expert weights** are resident on GPU along with all non-expert tensors (`--gpu-layers all`). KV stays on GPU with K=`q8_0`, V=`f16`. Batch 8192 / ubatch 1024, `--ctx-checkpoints 4`, `--no-mmap`. At idle ~23.0 GB VRAM used, leaving an estimated **~1.0 GiB** headroom (chosen by benchmark, see [[frank-default-small-benchmark]]). Idle RAM ~32 GB of 62 GB. +The active `frank-default-small` service (llama.cpp, `b10108+`) serves the HauhauCS Qwen3.6-35B-A3B uncensored `Q6_K_P` model on port 7770 with **ngram-mod** speculative decoding. It runs **4 parallel slots** at 200000 context each (pool 800000). Of the 40 layers' MoE expert weights, **35 sit on CPU** (`--n-cpu-moe 35`) while the remaining **5 layers' expert weights** are resident on GPU along with all non-expert tensors (`--gpu-layers all`). KV stays on GPU with K=`q8_0`, V=`f16`. Batch 8192 / ubatch 3072, `--ctx-checkpoints 4`, `--no-mmap`. At idle ~22.8 GB VRAM used, leaving an estimated **~1.2 GiB** headroom (chosen by benchmark for prefill speed, see [[frank-default-small-benchmark]]). Idle RAM ~32 GB of 62 GB. ## Hardware Relevance -- 24 GB VRAM is close to saturated with this config. At idle ~23.0 GB used, leaving an estimated **~1.0 GiB** headroom at `--n-cpu-moe 32` (8 layers' experts on GPU) with `ubatch 1024`. A llama-bench sweep ([[frank-default-small-benchmark]]) chose this state: it maximises decode (~48.7 t/s) while staying above the OOM boundary that `ncmoe 32 - ubatch 2048` crossed (24.4 GiB). If headroom proves too thin for production bursts, reduce `ubatch` to 768 (~1.3 GiB headroom) or dial `--n-cpu-moe` back to 34 at `ubatch 1536` (~2.0 GiB headroom) by editing `scripts/frank-default-small.env`. +- 24 GB VRAM is close to saturated with this config. At idle ~22.8 GB used, leaving an estimated **~1.2 GiB** headroom at `--n-cpu-moe 35` (5 layers' experts on GPU) with `ubatch 3072`. A llama-bench sweep ([[frank-default-small-benchmark]]) chose this state because prefill is the priority: `ubatch 3072` reaches ~1458 t/s prefill, the top tier, and generation is independent of ubatch. If decode speed matters more, use `ncmoe 32 - ubatch 1024` (gen ~48.7 t/s). By editing `scripts/frank-default-small.env`. - 62 GB system RAM holds the ~29 GB of MoE expert weights with room to spare (~57 GB available after load). - 127 GB swap is available for CPU KV cache paging if GPU KV offload is disabled. - Root disk has approximately 140 GB free. Store the GGUF models under `/home/dank/models` (about 32 GB total). diff --git a/docs/deployment.md b/docs/deployment.md index a9d58e6..32b0e05 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -143,7 +143,7 @@ The active service on Dankclaw runs llama.cpp serving the HauhauCS Qwen3.6-27B u ### Dankserver — frank-default-small -The active service on Dankserver runs llama.cpp (upstream, `b10108+`) and serves the HauhauCS Qwen3.6-35B-A3B uncensored `Q6_K_P` model under the alias `frank-default-small` on port 7770. It uses **ngram-mod** speculative decoding (`--spec-ngram-mod-n-min 48 / n_max 64 / n_match 24`), **4 parallel slots** at 200000 context each (pool 800000), and mmproj vision. **32 of 40 MoE expert layers** stay on CPU (`--n-cpu-moe 32`); 8 expert layers' weights are back on GPU alongside all non-expert tensors (`--gpu-layers all`). KV stays on GPU (K=`q8_0`, V=`f16`). Batch 8192 / ubatch 1024, `--ctx-checkpoints 4`, `--no-mmap`. The unit file is `scripts/frank-default-small.service`, symlinked to `/etc/systemd/system/`. It launches through `scripts/serve-llama-frank-small.sh`, which reads tunables from `scripts/frank-default-small.env`. +The active service on Dankserver runs llama.cpp (upstream, `b10108+`) and serves the HauhauCS Qwen3.6-35B-A3B uncensored `Q6_K_P` model under the alias `frank-default-small` on port 7770. It uses **ngram-mod** speculative decoding (`--spec-ngram-mod-n-min 48 / n_max 64 / n_match 24`), **4 parallel slots** at 200000 context each (pool 800000), and mmproj vision. **35 of 40 MoE expert layers** stay on CPU (`--n-cpu-moe 35`); 5 expert layers' weights are back on GPU alongside all non-expert tensors (`--gpu-layers all`). KV stays on GPU (K=`q8_0`, V=`f16`). Batch 8192 / ubatch 3072, `--ctx-checkpoints 4`, `--no-mmap`. The unit file is `scripts/frank-default-small.service`, symlinked to `/etc/systemd/system/`. It launches through `scripts/serve-llama-frank-small.sh`, which reads tunables from `scripts/frank-default-small.env`. > Note: this service replaced the retired `vllm-awq-qwen36` (AWQ 4-bit, port 34401) and the earlier `vllm-qwen36` (FP8) / `llama-server` (ROCmFPX) units. The repo tracks `main` on Dankserver at `/home/dank/vLLM`. diff --git a/docs/frank-default-small-benchmark.md b/docs/frank-default-small-benchmark.md index 45f55d2..cbd7d69 100644 --- a/docs/frank-default-small-benchmark.md +++ b/docs/frank-default-small-benchmark.md @@ -101,19 +101,24 @@ and fails, which matches the recorded OOMs at `ncmoe 32` and `33`. ## Chosen State -The chosen state balances generation speed against prefill speed and OOM -headroom: +Prefill speed is the priority for this workload, so the final state takes +the top prefill tier while keeping a safe headroom margin: ``` ---n-cpu-moe 32 # 8 expert layers on GPU +--n-cpu-moe 35 # 5 expert layers on GPU --batch-size 8192 ---ubatch-size 1024 +--ubatch-size 3072 ``` -This gives generation about 48.7 t/s (7 percent above the previous -`ncmoe 35`) while keeping the box above the OOM boundary. If prefill speed -matters more than generation, use `ncmoe 34 - ubatch 2048`. If stability -headroom matters most, use `ncmoe 34 - ubatch 1536`. +This gives prefill about 1458 t/s at 16384 prompt tokens, generation about +45.4 t/s, and about 1.2 GiB of headroom at the 800000-token pool. Both are +chosen because generation does not depend on `ubatch`: `ubatch 3072` reaches +the best prefill speed with no cost to decode. + +If decode speed matters more than prefill, swap to `ncmoe 32 - ubatch 1024` +(generation about 48.7 t/s, prefill about 766 t/s, about 1.0 GiB headroom). +If stability headroom matters most, use `ncmoe 34 - ubatch 1536` (about 2.0 +GiB headroom). ## Limitations diff --git a/scripts/frank-default-small.env b/scripts/frank-default-small.env index 1f85d46..a9a2103 100644 --- a/scripts/frank-default-small.env +++ b/scripts/frank-default-small.env @@ -8,17 +8,17 @@ PORT=7770 # (Increased from 3×200k to add a 4th parallel stream.) CTX_SIZE=800000 PARALLEL=4 -# Spec: ngram-mod. n_min=48, n_max=64, n_match=24 (defaults). 8 expert -# layers back on GPU; 32 on CPU. Batch 8192 / ubatch 1024. +# Spec: ngram-mod. n_min=48, n_max=64, n_match=24 (defaults). 5 expert +# layers back on GPU; 35 on CPU. Batch 8192 / ubatch 3072. SPEC_TYPE=ngram-mod NGRAM_MOD_N_MIN=48 NGRAM_MOD_N_MAX=64 NGRAM_MOD_N_MATCH=24 -# Expert offload: 32 of 40 layers keep MoE weights on CPU; remaining -# 8 layers have their expert weights resident on GPU for faster routing. -# Benchmark-chosen (see frank-default-small-benchmark.md): max decode at -# the headroom that stays above the historical OOM boundary. -N_CPU_MOE=32 +# Expert offload: 35 of 40 layers keep MoE weights on CPU; remaining +# 5 layers have their expert weights resident on GPU for faster routing. +# Benchmark-chosen (see frank-default-small-benchmark.md): prefill-max. +# gen ~45.4 t/s, pp ~1458 t/s, ~1.2 GiB headroom. +N_CPU_MOE=35 N_GPU_LAYERS=all # KV cache on GPU, K quantized to q8_0, V stays f16 (user-locked decision). CACHE_TYPE_K=q8_0 @@ -27,10 +27,10 @@ CACHE_TYPE_V=f16 # larger batch/ubatch (leaves headroom for ctx-checkpoints operation). CTX_CHECKPOINTS=4 # Larger batches / ubatch for big prefill workloads. -# ubatch 1024 (benchmark-chosen): decode is flat vs ubatch; 1024 frees -# compute-graph VRAM to afford ncmoe 32 while keeping prefill ~766 t/s. +# ubatch 3072 (benchmark-chosen): prefill is the priority; this is the top +# prefill tier (~1458 t/s) with ~1.2 GiB headroom. Decode is independent. BATCH_SIZE=8192 -UBATCH_SIZE=1024 +UBATCH_SIZE=3072 # Load the model into RAM rather than lazy-mapping it. The MoE experts live on # CPU, so eager RAM load avoids page faults during decode (uses ~31GB RAM). NO_MMAP=1 diff --git a/scripts/serve-llama-frank-small.sh b/scripts/serve-llama-frank-small.sh index 1a06a81..bb94cf3 100755 --- a/scripts/serve-llama-frank-small.sh +++ b/scripts/serve-llama-frank-small.sh @@ -32,10 +32,10 @@ fi : "${NGRAM_MOD_N_MATCH:=24}" : "${CACHE_TYPE_K:=q8_0}" : "${CACHE_TYPE_V:=f16}" -: "${N_CPU_MOE:=32}" # 32 of 40 layers: MoE expert weights stay on CPU; 8 on GPU +: "${N_CPU_MOE:=35}" # 35 of 40 layers: MoE expert weights stay on CPU; 5 on GPU : "${N_GPU_LAYERS:=all}" # every non-expert tensor goes to GPU : "${BATCH_SIZE:=2048}" -: "${UBATCH_SIZE:=1024}" +: "${UBATCH_SIZE:=3072}" : "${CTX_CHECKPOINTS:=0}" : "${NO_MMAP:=0}" : "${TEMPERATURE:=1.0}"