Runtime: ciru-ai/Qwen3.8-Flash-CIRU-STRIX-IU4 llama.cpp at tag v1.1, built with the vendor build-linux-amd.sh flag set plus GGML_CUDA_FA + GGML_CUDA_FA_ALL_QUANTS (the Q4_1_MOE_FORCE_J path is live in the hipified mmq kernels). Model: jcbtc/Qwen3.8-Flash-CIRU-STRIX-IU4 (Q4_1 IU4 experts, MTP Q8_0 draft, CIRUPLE1 PLE sidecar) with checksums verified at download. Vendor production profile verbatim on first deployment: 262144 ctx x 1 slot, b 2048 / ub 512, t 8 / tb 8, f16 KV, fa on, cont-batching, prompt cache + 8 GiB cache-ram + idle slots, 32 ctx checkpoints (min step 8192), MTP depth 3 with p-split 0.10, PLE pager env knobs (Q41_MOE_FORCE_J=32, PLE_WORKERS=16, PLE_STRICT_SHA=0, HIPBLASLT=1). Qwen-Sharp chat template kept deliberately; reasoning stays in DeepSeek format.
185 lines
6.8 KiB
Bash
Executable File
185 lines
6.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Serve jcbtc/Qwen3.8-Flash-CIRU-STRIX-IU4 as frank-default-large via the
|
|
# ciru-ai/Qwen3.8-Flash-CIRU-STRIX-IU4 llama.cpp runtime (tag v1.1) on
|
|
# Dankclaw (Strix Halo gfx1151, unified memory).
|
|
#
|
|
# Runtime: ciru-ai Qwen3.8-Flash-CIRU-STRIX-IU4 llama.cpp built at
|
|
# /home/dank/GitPackages/ciru-Qwen3.8-Flash-CIRU-STRIX-IU4/build-gfx1151
|
|
# with the vendor build-linux-amd.sh flag set (HIP on, HIP_NO_VMM on,
|
|
# HIP_GRAPHS on, HIP_MMQ_MFMA on, CUDA/VULKAN/SYCL off, gfx1151) PLUS
|
|
# -DGGML_CUDA_FA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON. The Q4_1_MOE_FORCE_J and
|
|
# PLE env knobs below are read by the hipified mmq/pager kernels.
|
|
#
|
|
# Model: Qwen3.8-Flash-Next base (56B MoE, 512 experts / 10 used, 48 layers
|
|
# = 12 attention + 36 SSM, QSA indexer, hyper-connections, PLE at layer 1)
|
|
# in the CIRU quality-first mixed quant: 144 routed-expert tensors at Q4_1
|
|
# on the native IU4 WMMA path, protected tensors at Q5_K/Q5_1/Q8_0/BF16/F32.
|
|
# The exact-FP8 PLE table is a sidecar (ple/ dir) paged from disk through the
|
|
# CIRUPLE1 pager with a ple-cache-mib decoded-page cache; it never enters
|
|
# VRAM. The MTP draft head (Q8_0) drives speculative decoding at depth 3.
|
|
#
|
|
# Vendor production profile is applied verbatim on the first deployment:
|
|
# -ngl all, -sm none, --fit off, ctx 262144 x 1 slot, b 2048 / ub 512,
|
|
# t 8 / tb 8, f16 KV, fa on, cont-batching, prompt cache + 8 GiB cache-ram
|
|
# + idle-slot cache, 32 ctx checkpoints with min step 8192, MTP depth 3
|
|
# with p-split 0.10. Deviations from the vendor launcher are marked below.
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
ENV_FILE="${FRANK_LARGE_ENV_FILE:-$SCRIPT_DIR/frank-default-large.env}"
|
|
if [[ -f "$ENV_FILE" ]]; then
|
|
set -a
|
|
# shellcheck disable=SC1090
|
|
source "$ENV_FILE"
|
|
set +a
|
|
fi
|
|
|
|
# --- defaults (used when the env file does not set them) -------------------
|
|
: "${LLAMA_BIN:=/home/dank/GitPackages/ciru-Qwen3.8-Flash-CIRU-STRIX-IU4/build-gfx1151/bin/llama-server}"
|
|
: "${MODEL_DIR:=/home/dank/models/ciru-Qwen3.8-Flash-CIRU-STRIX-IU4}"
|
|
: "${MODEL_FILE:=Qwen3.8-Flash-CIRU-STRIX-IU4.gguf}"
|
|
: "${CHAT_TEMPLATE_FILE:=$SCRIPT_DIR/chat-template.jinja}"
|
|
: "${CHAT_TEMPLATE_KWARGS:={}}"
|
|
: "${ALIAS:=frank-default-large}"
|
|
: "${BIND_ADDR:=0.0.0.0}"
|
|
: "${LISTEN_PORT:=7770}"
|
|
: "${CTX_SIZE:=262144}"
|
|
: "${PARALLEL:=1}"
|
|
: "${BATCH_SIZE:=2048}"
|
|
: "${UBATCH_SIZE:=512}"
|
|
: "${NUM_THREADS:=8}"
|
|
: "${THREAD_BATCH:=8}"
|
|
: "${CACHE_TYPE_K:=f16}"
|
|
: "${CACHE_TYPE_V:=f16}"
|
|
: "${CTX_CHECKPOINTS:=32}"
|
|
: "${CHECKPOINT_MIN_STEP:=8192}"
|
|
: "${CACHE_RAM:=8192}"
|
|
: "${PLE_CACHE_MIB:=4096}"
|
|
: "${SLOT_SAVE_PATH:=$SCRIPT_DIR/slot-state}"
|
|
: "${SPLIT_MODE:=none}"
|
|
: "${FIT:=off}"
|
|
: "${TEMPERATURE:=0.7}"
|
|
: "${TOP_K:=20}"
|
|
: "${TOP_P:=0.8}"
|
|
: "${MIN_P:=0.0}"
|
|
: "${PRESENCE_PENALTY:=1.5}"
|
|
: "${REASONING:=on}"
|
|
: "${REASONING_FORMAT:=deepseek}"
|
|
: "${HSA_OVERRIDE_GFX_VERSION:=11.5.1}"
|
|
: "${SPEC_TYPE:=draft-mtp}"
|
|
: "${DRAFT_MODEL_DIR:=$MODEL_DIR/mtp}"
|
|
: "${DRAFT_MODEL_FILE:=Qwen3.8-Flash-CIRU-STRIX-IU4-MTP-Q8_0.gguf}"
|
|
: "${SPEC_DRAFT_N_MAX:=3}"
|
|
: "${SPEC_DRAFT_N_MIN:=0}"
|
|
: "${SPEC_DRAFT_P_MIN:=0.0}"
|
|
: "${SPEC_DRAFT_P_SPLIT:=0.10}"
|
|
: "${SPEC_DRAFT_NGL:=all}"
|
|
: "${SPEC_DRAFT_DEVICE:=ROCm0}"
|
|
: "${SPEC_DRAFT_TYPE_K:=q8_0}"
|
|
: "${SPEC_DRAFT_TYPE_V:=q8_0}"
|
|
|
|
MODEL="$MODEL_DIR/$MODEL_FILE"
|
|
for f in "$LLAMA_BIN" "$MODEL"; do
|
|
if [[ ! -r "$f" ]]; then
|
|
echo "missing or unreadable required artifact: $f" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
if [[ ! -x "$LLAMA_BIN" ]]; then
|
|
echo "missing executable runtime: $LLAMA_BIN" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# --- speculative decoding (MTP draft head) ---------------------------------
|
|
# The MTP draft head is a separate GGUF sidecar loaded via --spec-draft-model
|
|
# (alias --model-draft). ngram-only specs do not need a draft file.
|
|
# Set SPEC_TYPE=none in the env to disable speculative decoding entirely.
|
|
SPEC_ARGS=()
|
|
if [[ -n "$SPEC_TYPE" && "$SPEC_TYPE" != "none" ]]; then
|
|
SPEC_ARGS=(
|
|
--spec-type "$SPEC_TYPE"
|
|
--spec-draft-n-max "$SPEC_DRAFT_N_MAX"
|
|
--spec-draft-n-min "$SPEC_DRAFT_N_MIN"
|
|
--spec-draft-p-min "$SPEC_DRAFT_P_MIN"
|
|
)
|
|
if [[ "$SPEC_TYPE" == *draft-mtp* ]]; then
|
|
DRAFT_MODEL="$DRAFT_MODEL_DIR/$DRAFT_MODEL_FILE"
|
|
if [[ ! -r "$DRAFT_MODEL" ]]; then
|
|
echo "missing or unreadable draft model: $DRAFT_MODEL" >&2
|
|
exit 1
|
|
fi
|
|
SPEC_ARGS+=(
|
|
--spec-draft-model "$DRAFT_MODEL"
|
|
--spec-draft-ngl "$SPEC_DRAFT_NGL"
|
|
--spec-draft-device "$SPEC_DRAFT_DEVICE"
|
|
--spec-draft-type-k "$SPEC_DRAFT_TYPE_K"
|
|
--spec-draft-type-v "$SPEC_DRAFT_TYPE_V"
|
|
)
|
|
fi
|
|
if [[ -n "${SPEC_DRAFT_P_SPLIT:-}" ]]; then
|
|
SPEC_ARGS+=(--spec-draft-p-split "$SPEC_DRAFT_P_SPLIT")
|
|
fi
|
|
fi
|
|
|
|
# The CIRU package is text-only: no mmproj sidecar. Pass --mmproj only when
|
|
# MMPROJ_PATH points at a readable file (kept for future multimodal packs).
|
|
MMPROJ_ARGS=()
|
|
if [[ -n "${MMPROJ_PATH:-}" && -r "${MMPROJ_PATH:-}" ]]; then
|
|
MMPROJ_ARGS=(--mmproj "$MMPROJ_PATH")
|
|
fi
|
|
|
|
SERVER_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
mkdir -p "$SLOT_SAVE_PATH"
|
|
ROCM_PATH="${ROCM_PATH:-/opt/rocm}"
|
|
LIBRARY_PATH="$SERVER_DIR:$ROCM_PATH/lib:$ROCM_PATH/lib/rocm_sysdeps/lib:$ROCM_PATH/lib/llvm/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
|
|
exec /usr/bin/env \
|
|
ROCM_PATH="$ROCM_PATH" \
|
|
HIP_VISIBLE_DEVICES=0 \
|
|
LD_LIBRARY_PATH="$LIBRARY_PATH" \
|
|
HSA_OVERRIDE_GFX_VERSION="$HSA_OVERRIDE_GFX_VERSION" \
|
|
GGML_CUDA_Q41_MOE_FORCE_J="${GGML_CUDA_Q41_MOE_FORCE_J:-32}" \
|
|
GGML_QWEN4EXP_PLE_WORKERS="${GGML_QWEN4EXP_PLE_WORKERS:-16}" \
|
|
GGML_QWEN4EXP_PLE_STRICT_SHA="${GGML_QWEN4EXP_PLE_STRICT_SHA:-0}" \
|
|
ROCBLAS_USE_HIPBLASLT="${ROCBLAS_USE_HIPBLASLT:-1}" \
|
|
"$LLAMA_BIN" \
|
|
--model "$MODEL" \
|
|
--alias "$ALIAS" \
|
|
--chat-template-file "$CHAT_TEMPLATE_FILE" \
|
|
--chat-template-kwargs "$CHAT_TEMPLATE_KWARGS" \
|
|
--host "$BIND_ADDR" \
|
|
--port "$LISTEN_PORT" \
|
|
--jinja \
|
|
--device ROCm0 \
|
|
--gpu-layers "${NGL:-all}" \
|
|
--split-mode "$SPLIT_MODE" \
|
|
--parallel "$PARALLEL" \
|
|
--ctx-size "$CTX_SIZE" \
|
|
--batch-size "$BATCH_SIZE" \
|
|
--ubatch-size "$UBATCH_SIZE" \
|
|
--fit "$FIT" \
|
|
--flash-attn on \
|
|
--cache-type-k "$CACHE_TYPE_K" \
|
|
--cache-type-v "$CACHE_TYPE_V" \
|
|
--threads "$NUM_THREADS" \
|
|
--threads-batch "$THREAD_BATCH" \
|
|
--ctx-checkpoints "$CTX_CHECKPOINTS" \
|
|
--checkpoint-min-step "$CHECKPOINT_MIN_STEP" \
|
|
--cache-ram "$CACHE_RAM" \
|
|
--ple-sidecar "$MODEL_DIR/ple" \
|
|
--ple-cache-mib "$PLE_CACHE_MIB" \
|
|
--slot-save-path "$SLOT_SAVE_PATH" \
|
|
--cache-prompt \
|
|
--cache-idle-slots \
|
|
--metrics \
|
|
--temp "$TEMPERATURE" \
|
|
--top-p "$TOP_P" \
|
|
--top-k "$TOP_K" \
|
|
--min-p "$MIN_P" \
|
|
--presence-penalty "$PRESENCE_PENALTY" \
|
|
--reasoning "$REASONING" \
|
|
--reasoning-format "$REASONING_FORMAT" \
|
|
--reasoning-budget -1 \
|
|
"${MMPROJ_ARGS[@]}" \
|
|
"${SPEC_ARGS[@]}"
|