#!/usr/bin/env bash # Serve jcbtc/Qwen3.8-27B-CIRU-ActiveFPX-PromptForge (v3) as # frank-default-large via the CIRU ROCmFPX llama.cpp runtime on Dankclaw # (Strix Halo gfx1151). # # Runtime: the PromptForge llama-server built from ciru-ai/ROCmFPX tag # qwen3.8-activefpx-promptforge-v2.3 (commit 103af8b41) plus the v3 output-K8 # runtime patch (runtime/qwen38-v3-output-k8-runtime.patch, commit af0eac6 on # Dankclaw) against the private TheRock ROCm 7.15 SDK (kept in the retired # ling3-ciru venv). The model is the v3 GGUF with the full-W8 PromptForge # companion views (FFN/GDN .pfs), the Output-K8 draft proxy, and the BF16 # vision projector. Native depth-4 MTP speculative decoding. # # The model card requires ROCm 7.15 (not the system ROCm 7.2.4) for the # advertised Strix Halo performance. LD_LIBRARY_PATH therefore points at the # 7.15 SDK libraries first. An older system ROCm must not precede them. # # Tunables come from frank-default-large.env in this directory unless # FRANK_LARGE_ENV_FILE overrides that path. 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/ciru-qwen38/ROCmFPX/build-promptforge/bin/llama-server}" : "${MODEL_DIR:=/home/dank/models/CIRU-Qwen3.8-27B-ActiveFPX-v3}" : "${MODEL_FILE:=Qwen3.8-27B-CIRU-ActiveFPX-PromptForge-v3-Q8-FFNEQ-LateQ6.gguf}" : "${FFN_PFS:=Qwen3.8-27B-CIRU-ActiveFPX-PromptForge-FFN.pfs}" : "${GDN_PFS:=Qwen3.8-27B-CIRU-ActiveFPX-PromptForge-GDN.pfs}" : "${OUTPUT_K8_PFS:=Qwen3.8-27B-CIRU-ActiveFPX-PromptForge-Output-K8.pfs}" : "${MMPROJ_FILE:=Qwen3.8-27B-mmproj-BF16.mmproj}" : "${ROCM_DEVEL:=/home/dank/ling3-ciru/Ling-3.0-Flash-CIRU-int4-Strix-native/.venv/lib/python3.12/site-packages/_rocm_sdk_devel}" : "${ROCM_LIB:=/home/dank/ling3-ciru/Ling-3.0-Flash-CIRU-int4-Strix-native/.venv/lib/python3.12/site-packages/_rocm_sdk_libraries}" : "${ROCM_CORE:=/home/dank/ling3-ciru/Ling-3.0-Flash-CIRU-int4-Strix-native/.venv/lib/python3.12/site-packages/_rocm_sdk_core}" : "${ALIAS:=frank-default-large}" : "${BIND_ADDR:=0.0.0.0}" : "${LISTEN_PORT:=52625}" : "${CTX_SIZE:=524288}" : "${PARALLEL:=2}" : "${BATCH_SIZE:=4096}" : "${UBATCH_SIZE:=4096}" : "${CACHE_TYPE_K:=f16}" : "${CACHE_TYPE_V:=f16}" : "${CTX_CHECKPOINTS:=16}" : "${CACHE_RAM:=8192}" : "${SPEC_DRAFT_N_MAX:=4}" : "${SPEC_DRAFT_N_MIN:=0}" : "${SPEC_DRAFT_P_MIN:=0.0}" : "${SPEC_DRAFT_P_SPLIT:=0.10}" : "${TEMPERATURE:=0.7}" : "${TOP_P:=0.95}" : "${REASONING:=on}" : "${REASONING_FORMAT:=deepseek}" : "${VERBOSITY:=4}" MODEL="$MODEL_DIR/$MODEL_FILE" export PROMPTFORGE_SIDECAR="$MODEL_DIR/$FFN_PFS" export PROMPTFORGE_GDN_SIDECAR="$MODEL_DIR/$GDN_PFS" # v3 qualified runtime: Output-K8 draft proxy + small-row W8 prompt route. export PROMPTFORGE_MODE="m2048_fused_tail1476" export GGML_CUDA_GRAPH_OPT=0 export PROMPTFORGE_ENABLE_SMALLM_W8=1 export PROMPTFORGE_MTP_OUTPUT_K8=1 export PROMPTFORGE_MTP_OUTPUT_K8_VALIDATE=0 export PROMPTFORGE_MTP_OUTPUT_K8_PROXY="$MODEL_DIR/$OUTPUT_K8_PFS" # The qualified v3 profile disables the CPU argmax draft fast path; the # Output-K8 proxy + backend sampling replace it. Also drop any IU4/ngram # companions from the non-IU4 development lane. unset LLAMA_MTP_CPU_ARGMAX_FASTPATH LLAMA_MTP_BACKEND_GREEDY || true unset PROMPTFORGE_IU4_SIDECAR PROMPTFORGE_GDN_IU4_SIDECAR || true unset PROMPTFORGE_ENABLE_NGRAM_MOD PROMPTFORGE_ENABLE_NGRAM_M65_IU4 || true for f in "$MODEL" "$PROMPTFORGE_SIDECAR" "$PROMPTFORGE_GDN_SIDECAR" "$PROMPTFORGE_MTP_OUTPUT_K8_PROXY" "$MODEL_DIR/$MMPROJ_FILE"; do if [[ ! -f "$f" ]]; then echo "missing required file: $f" >&2 exit 1 fi done if [[ ! -x "$LLAMA_BIN" ]]; then echo "missing llama-server binary: $LLAMA_BIN" >&2 exit 1 fi # ROCm 7.15 SDK libraries must precede any system ROCm in LD_LIBRARY_PATH. export ROCM_PATH="$ROCM_DEVEL" export LD_LIBRARY_PATH="${ROCM_LIB}/lib:${ROCM_CORE}/lib:${ROCM_DEVEL}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" exec "$LLAMA_BIN" \ --model "$MODEL" \ --mmproj "$MODEL_DIR/$MMPROJ_FILE" \ --alias "$ALIAS" \ --host "$BIND_ADDR" \ --port "$LISTEN_PORT" \ -dev ROCm0 \ -ngl 999 \ -c "$CTX_SIZE" \ -b "$BATCH_SIZE" \ -ub "$UBATCH_SIZE" \ -fa on \ -ctk "$CACHE_TYPE_K" \ -ctv "$CACHE_TYPE_V" \ -np "$PARALLEL" \ -ctxcp "$CTX_CHECKPOINTS" \ --cache-ram "$CACHE_RAM" \ --cache-prompt \ --metrics \ --no-mmap \ --spec-type draft-mtp \ --spec-draft-device ROCm0 \ --spec-draft-ngl 999 \ --spec-draft-type-k f16 \ --spec-draft-type-v f16 \ --spec-draft-n-max "$SPEC_DRAFT_N_MAX" \ --spec-draft-n-min "$SPEC_DRAFT_N_MIN" \ --spec-draft-p-min "$SPEC_DRAFT_P_MIN" \ --spec-draft-p-split "$SPEC_DRAFT_P_SPLIT" \ --spec-draft-backend-sampling \ --temp "$TEMPERATURE" \ --top-p "$TOP_P" \ --reasoning "$REASONING" \ --reasoning-format "$REASONING_FORMAT" \ --reasoning-budget -1 \ -lv "$VERBOSITY"