From 923e775354125dfa22626e151fcb58e17c760184 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 14 Aug 2026 01:20:30 -0700 Subject: [PATCH] dankclaw: Ling-3.0-flash Q6_K trial config (Vulkan+GTT+draft-mtp) Trial replaces frank-default-large temporarily via frank-large-ling.service (port 7770, same alias). Requires the aetherbird bailingmoe3-support llama.cpp fork at /home/dank/llama.cpp-ling (stock llama.cpp cannot load bailingmoe3). Memory: 8x16GB LPDDR5 = 128GB physical; Vulkan exposes ~111.2GiB heap (UMA 96GiB + GTT) vs ROCm's 96GiB. Q6_K = 98.26GiB; MLA/KDA KV is tiny so 256k ctx x 2 slots fits with ~10GiB headroom. Verified: loads ~45s, concurrent streams both complete (no DFlash-style kill), ~7.7 t/s gen. Restore Qwen: systemctl stop frank-large-ling; systemctl start frank-default-large. --- scripts/frank-default-large.ling.env | 39 ++++++++++++++ scripts/frank-large-ling.service | 17 ++++++ scripts/serve-ling-flash.sh | 80 ++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 scripts/frank-default-large.ling.env create mode 100644 scripts/frank-large-ling.service create mode 100755 scripts/serve-ling-flash.sh diff --git a/scripts/frank-default-large.ling.env b/scripts/frank-default-large.ling.env new file mode 100644 index 0000000..0943d1b --- /dev/null +++ b/scripts/frank-default-large.ling.env @@ -0,0 +1,39 @@ +# Tunables for the Ling-3.0-flash TRAIL on dankclaw (frank-large-ling). +# This REPLACES frank-default-large (Qwen3.6-27B) temporarily. To switch +# back: systemctl stop frank-large-ling && systemctl start frank-default-large. +# Runtime: llama.cpp FORK bailingmoe3-support; Vulkan + AMD GTT. +# +# Memory model (amdgpu Strix Halo gfx1151, 8x16GB LPDDR5 = 128 GiB physical): +# - firmware UMA carve-out gives the iGPU ~96 GiB VRAM (rocm-smi "VRAM total"). +# - CPU system RAM is the remainder (~30 GiB; kernel MemTotal). +# - Vulkan (RADV) reports an ~111.2 GiB heap (113910 MiB) - larger than ROCm's +# 96 GiB, because Vulkan can also reach system memory via GTT. +# - Q6_K is 98.26 GiB, leaving only ~13 GiB of heap for KV + graphs, so keep +# the context small (Ling uses MLA/KDA, so KV stays small). Tune CTX_SIZE. +MODEL_DIR=/home/dank/models +MODEL_FILE=Ling-3.0-flash-Q6_K.gguf +ALIAS=frank-default-large # keep the API alias so clients are unaffected +HOST=0.0.0.0 +PORT=7770 +# Context: Q6_K uses ~98.7 GiB of the ~111.2 GiB Vulkan heap; Ling's MLA/KDA +# KV is tiny (~2.5 GiB for 256k), so a large context fits. 262144 total = 2 +# slots x 131072, ~10 GiB heap headroom after load. Verified 2026-08-14. +CTX_SIZE=262144 +PARALLEL=2 +# MTP is bundled in the Ling GGUF itself (block 42) - no separate draft file. +SPEC_TYPE=draft-mtp +SPEC_DRAFT_N_MAX=3 +# Vulkan exposes the larger heap (UMA + GTT) vs ROCm. Use Vulkan0. +DEVICE=Vulkan0 +N_GPU_LAYERS=all +FLASH_ATTN=auto +# Batch kept small-leaning for the tight memory budget; tune with CTX_SIZE. +BATCH_SIZE=512 +UBATCH_SIZE=512 +# Sampling defaults (model card: reasoning-capable; leave temp/top to default) +TEMPERATURE=1.0 +TOP_K=20 +TOP_P=0.95 +MIN_P=0.0 +THREADS=12 +THREADS_HTTP=1 diff --git a/scripts/frank-large-ling.service b/scripts/frank-large-ling.service new file mode 100644 index 0000000..97b7439 --- /dev/null +++ b/scripts/frank-large-ling.service @@ -0,0 +1,17 @@ +[Unit] +Description=llama.cpp Ling-3.0-flash Q6_K Vulkan+MTP (frank-large-ling TRIAL) +After=network.target + +[Service] +Type=simple +User=dank +Group=dank +Environment="HOST=0.0.0.0" +Environment="PORT=7770" +Environment="FRANK_LING_ENV_FILE=/home/dank/vllmScripts/scripts/frank-default-large.ling.env" +ExecStart=/home/dank/vllmScripts/scripts/serve-ling-flash.sh +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/scripts/serve-ling-flash.sh b/scripts/serve-ling-flash.sh new file mode 100755 index 0000000..a7249b5 --- /dev/null +++ b/scripts/serve-ling-flash.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# Serve inclusionAI Ling-3.0-flash (Q6_K) on dankclaw as a TRIAL, replacing +# frank-default-large temporarily. +# +# Runtime: llama.cpp FORK (aetherbird bailingmoe3-support) - stock llama.cpp +# cannot load the bailingmoe3 architecture. Backend: Vulkan (RADV) on the +# Strix Halo APU; memory is the shared 128 GB pool (96 GiB UMA + GTT that +# Vulkan exposes as an ~111 GiB heap). MTP drafter is bundled in the same +# GGUF (block 42) - no separate --spec-draft-model needed. +# +# Tie-back: to restore the Qwen3.6-27B service, stop frank-large-ling and +# start frank-default-large (its env/unit are committed and unchanged). +# +# Tunables come from frank-default-large.ling.env in this directory unless +# FRANK_LING_ENV_FILE overrides that path. +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ENV_FILE="${FRANK_LING_ENV_FILE:-$SCRIPT_DIR/frank-default-large.ling.env}" +if [[ -f "$ENV_FILE" ]]; then + set -a + # shellcheck disable=SC1090 + source "$ENV_FILE" + set +a +fi + +# --- defaults ------------------------------------------------------------- +: "${MODEL_DIR:=/home/dank/models}" +: "${MODEL_FILE:=Ling-3.0-flash-Q6_K.gguf}" +: "${ALIAS:=frank-default-large}" # keep the same API alias for clients +: "${HOST:=0.0.0.0}" +: "${PORT:=7770}" +: "${CTX_SIZE:=32768}" +: "${PARALLEL:=2}" +: "${SPEC_TYPE:=draft-mtp}" # MTP block is bundled in the model GGUF +: "${SPEC_DRAFT_N_MAX:=3}" +: "${DEVICE:=Vulkan0}" +: "${N_GPU_LAYERS:=all}" +: "${BATCH_SIZE:=512}" +: "${UBATCH_SIZE:=512}" +: "${TEMPERATURE:=1.0}" +: "${TOP_K:=20}" +: "${TOP_P:=0.95}" +: "${MIN_P:=0.0}" +: "${THREADS:=12}" +: "${THREADS_HTTP:=1}" + +# Fork binary; stock llama.cpp cannot load bailingmoe3. +LLAMA_SERVER="${LLAMA_SERVER:-/home/dank/llama.cpp-ling/build/bin/llama-server}" +MODEL="$MODEL_DIR/$MODEL_FILE" + +if [[ ! -x "$LLAMA_SERVER" ]]; then + echo "missing fork binary: $LLAMA_SERVER (build required)" >&2 + exit 1 +fi +if [[ ! -f "$MODEL" ]]; then + echo "missing model: $MODEL" >&2 + exit 1 +fi + +exec "$LLAMA_SERVER" \ + --model "$MODEL" \ + --spec-type "$SPEC_TYPE" \ + --spec-draft-n-max "$SPEC_DRAFT_N_MAX" \ + --device "$DEVICE" \ + --gpu-layers "$N_GPU_LAYERS" \ + --flash-attn auto \ + --ctx-size "$CTX_SIZE" \ + --parallel "$PARALLEL" \ + --batch-size "$BATCH_SIZE" \ + --ubatch-size "$UBATCH_SIZE" \ + --temp "$TEMPERATURE" \ + --top-k "$TOP_K" \ + --top-p "$TOP_P" \ + --min-p "$MIN_P" \ + --threads "$THREADS" \ + --threads-http "$THREADS_HTTP" \ + --alias "$ALIAS" \ + --host "$HOST" \ + --port "$PORT"