frank-default-large: swap to agentionai Qwen3.8-Flash-Next ROCmFP4-FAST imatrix + own MTP draft

Model: agentionai/Qwen3.8-Flash-Next-ROCmFP4-FAST-imatrix-GGUF (87.06 GiB,
Q4_0_ROCMFP4_FAST imatrix-calibrated, per-head PLE table inside the GGUF —
fully VRAM-resident). Draft: agentionai/Qwen3.8-Flash-Next-MTP-ROCmFP4-FAST
(2.28 GiB, matched ROCmFP4-FAST quant, ~66% acceptance at n-max 3).
Vision tower (f16) loaded via mmproj/.

Runtime: charlie12345/ROCmFPX build-qwen38 (HIP, ROCm 7.2.4, gfx1151) —
the only binary with the ROCmFP4 FAST types. Replaces the jcbtc CIRU v1.1
deployment (ciru-ai runtime).

Profile: card sampling table (temp 0.7, top_p 0.8, top_k 20, min_p 0.0,
presence 1.5) mixed with the validated build-qwen38 serving profile:
262144 ctx x 1 slot, b 4096 / ub 4096, t 16 / tb 16, f16 KV, fa on,
cont-batching, prompt cache + 8 GiB cache-ram + idle slots, 16 ctx
checkpoints (no --checkpoint-min-step — unsupported on this binary),
--fit off (auto-fit segfaults on qwen4exp hyper-connection config),
--spec-type draft-mtp,ngram-mod with n-max 3 (adaptive p-split measured
worse per author card), p-min 0.75. Qwen-Sharp chat template kept;
reasoning stays in DeepSeek format.

The 2026-08-28 failure of this draft head on the kingjones STRIX_LEAN
model was a cross-vendor pairing problem: the head carries
blk.48.hc_attn_norm.weight (verified in-GGUF, same shape as the working
CIRU draft). Docs: new runbook agentionai-fast-imatrix, index updates.
This commit is contained in:
Frank committed 2026-08-29 20:41:12 -07:00
1 parent e22631d892
commit 3c2a5d2fe7
6 files changed
+313 -140

No files matched your search

+44 -51
View File
@@ -1,28 +1,29 @@
#!/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).
# Serve agentionai/Qwen3.8-Flash-Next-ROCmFP4-FAST-imatrix-GGUF as
# frank-default-large via the charlie12345/ROCmFPX llama.cpp runtime
# (build-qwen38, PR #27742 qwen4exp merged) 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.
# Runtime: charlie12345/ROCmFPX llama.cpp built at
# /home/dank/GitPackages/ROCmFPX/build-qwen38 (HIP, gfx1151, ROCm 7.2.4).
# The ROCmFP4 quant types (Q4_0_ROCMFP4_FAST) are hand-ported from
# ciru-ai/ROCmFPX; upstream llama.cpp cannot load this GGUF.
#
# 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.
# Model: Qwen3.8-Flash-Next base (qwen4exp MoE: 512 experts / 10 used,
# 48 layers = 12 attention + 36 SSM, QSA indexer, hyper-connections, PLE
# at layer 1) quantized Q4_0_ROCMFP4_FAST, imatrix-calibrated, 87.06 GiB.
# The n-gram PLE table is split per head inside the single GGUF — fully
# VRAM-resident, no sidecar, no --ngram-on-disk. The model's own MTP
# head (2.28 GiB, matched ROCmFP4-FAST quant) drives speculative decoding
# at depth 3 (~66% draft acceptance).
#
# 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.
# Profile: card sampling table (temp 0.7, top_p 0.80, top_k 20, min_p 0.0,
# presence 1.5 — non-thinking instruct) mixed with the validated
# build-qwen38 serving profile: ctx 262144 x 1 slot, b 4096 / ub 4096,
# t 16 / tb 16, f16 KV, fa on, cont-batching, prompt cache + 8 GiB
# cache-ram + idle-slot cache, 16 ctx checkpoints, --fit off (auto-fit
# segfaults on qwen4exp hyper-connection config). MTP depth 3 (n-max 3
# measured best; adaptive p-split measured worse, left off).
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
@@ -35,9 +36,10 @@ if [[ -f "$ENV_FILE" ]]; then
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}"
: "${LLAMA_BIN:=/home/dank/GitPackages/ROCmFPX/build-qwen38/bin/llama-server}"
: "${MODEL_DIR:=/home/dank/models/agentionai-Qwen3.8-Flash-Next-ROCmFP4-FAST}"
: "${MODEL_FILE:=Qwen3.8-Flash-Next-ROCmFP4-FAST-imatrix-v2-ple16.gguf}"
: "${MMPROJ_PATH:=$MODEL_DIR/mmproj/mmproj-Qwen3.8-Flash-Next-f16.gguf}"
: "${CHAT_TEMPLATE_FILE:=$SCRIPT_DIR/chat-template.jinja}"
: "${CHAT_TEMPLATE_KWARGS:={}}"
: "${ALIAS:=frank-default-large}"
@@ -45,19 +47,18 @@ fi
: "${LISTEN_PORT:=7770}"
: "${CTX_SIZE:=262144}"
: "${PARALLEL:=1}"
: "${BATCH_SIZE:=2048}"
: "${UBATCH_SIZE:=512}"
: "${NUM_THREADS:=8}"
: "${THREAD_BATCH:=8}"
: "${BATCH_SIZE:=4096}"
: "${UBATCH_SIZE:=4096}"
: "${NUM_THREADS:=16}"
: "${THREAD_BATCH:=16}"
: "${CACHE_TYPE_K:=f16}"
: "${CACHE_TYPE_V:=f16}"
: "${CTX_CHECKPOINTS:=32}"
: "${CHECKPOINT_MIN_STEP:=8192}"
: "${CTX_CHECKPOINTS:=16}"
: "${CACHE_RAM:=8192}"
: "${PLE_CACHE_MIB:=4096}"
: "${SLOT_SAVE_PATH:=$SCRIPT_DIR/slot-state}"
: "${SPLIT_MODE:=none}"
: "${FIT:=off}"
: "${NGL:=999}"
: "${TEMPERATURE:=0.7}"
: "${TOP_K:=20}"
: "${TOP_P:=0.8}"
@@ -66,20 +67,19 @@ fi
: "${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_TYPE:=draft-mtp,ngram-mod}"
: "${DRAFT_MODEL_DIR:=/home/dank/models/mtp-Qwen3.8-Flash-Next-FAST}"
: "${DRAFT_MODEL_FILE:=Qwen3.8-Flash-Next-MTP-ROCmFP4-FAST.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_P_MIN:=0.75}"
: "${SPEC_DRAFT_NGL:=999}"
: "${SPEC_DRAFT_DEVICE:=ROCm0}"
: "${SPEC_DRAFT_TYPE_K:=q8_0}"
: "${SPEC_DRAFT_TYPE_V:=q8_0}"
: "${SPEC_DRAFT_TYPE_K:=f16}"
: "${SPEC_DRAFT_TYPE_V:=f16}"
MODEL="$MODEL_DIR/$MODEL_FILE"
for f in "$LLAMA_BIN" "$MODEL"; do
for f in "$LLAMA_BIN" "$MODEL" "$CHAT_TEMPLATE_FILE"; do
if [[ ! -r "$f" ]]; then
echo "missing or unreadable required artifact: $f" >&2
exit 1
@@ -121,8 +121,8 @@ if [[ -n "$SPEC_TYPE" && "$SPEC_TYPE" != "none" ]]; then
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).
# The agentionai FAST package includes the model's own vision tower (f16,
# lossless). Pass --mmproj only when MMPROJ_PATH points at a readable file.
MMPROJ_ARGS=()
if [[ -n "${MMPROJ_PATH:-}" && -r "${MMPROJ_PATH:-}" ]]; then
MMPROJ_ARGS=(--mmproj "$MMPROJ_PATH")
@@ -138,10 +138,6 @@ exec /usr/bin/env \
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" \
@@ -151,7 +147,7 @@ exec /usr/bin/env \
--port "$LISTEN_PORT" \
--jinja \
--device ROCm0 \
--gpu-layers "${NGL:-all}" \
--gpu-layers "$NGL" \
--split-mode "$SPLIT_MODE" \
--parallel "$PARALLEL" \
--ctx-size "$CTX_SIZE" \
@@ -164,10 +160,7 @@ exec /usr/bin/env \
--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 \
@@ -181,4 +174,4 @@ exec /usr/bin/env \
--reasoning-format "$REASONING_FORMAT" \
--reasoning-budget -1 \
"${MMPROJ_ARGS[@]}" \
"${SPEC_ARGS[@]}"
"${SPEC_ARGS[@]}"