Reorganize: tracked DFlash2 archive files -> .AGENTTRASH (repo root)

This commit is contained in:
Frank
2026-08-22 15:07:31 -07:00
parent aa410f4439
commit 1f565c08c3
2 changed files with 0 additions and 0 deletions
@@ -0,0 +1,60 @@
# Tunables for frank-default-large (upstream llama.cpp PR #27342 DFlash2,
# Vulkan backend, dankclaw, Strix Halo gfx1151).
#
# Runtime: llama.cpp PR #27342 built with GGML_VULKAN=ON serving
# unsloth/Qwen3.8-27B-UD-Q8_K_XL (target) with a z-lab DFlash2 drafter
# (Qwen3.8-27B-DFlash2-Q4_K_M). Target at 31.4 GB, DFlash2 drafter at 2.0 GB.
# Alias frank-default-large, port 52625.
#
# DFlash2 runs on the Vulkan (RADV) backend. Its candidate selector needs
# TOP_K + ARGMAX, which the HIP backend does not implement. This replaced
# the CIRU HIP runtime on 2026-08-21. See docs/dflash2-large-vulkan.md.
#
# WARNING: do not name any variable TEMP, HOST, or GPU_MAX_HEAP_SIZE. The
# ROCm HIP runtime reads those bare env vars (see the 2026-08-13 TEMP
# incident). This deployment uses Vulkan, not HIP, but the rule stays for
# portability.
# Upstream llama.cpp DFlash2 binary (PR #27342, Vulkan build).
LLAMA_BIN=/home/dank/llama.cpp-dflash2/build-dflash2/bin/llama-server
# Model files. The target (UD-Q8_K_XL) was already on disk; the DFlash2
# drafter was added for this deployment. Both live in /home/dank/models.
MODEL_DIR=/home/dank/models
MODEL_FILE=Qwen3.8-27B-UD-Q8_K_XL.gguf
DRAFT_FILE=Qwen3.8-27B-DFlash2-Q4_K_M.gguf
ALIAS=frank-default-large
BIND_ADDR=0.0.0.0
LISTEN_PORT=52625
# Serving: full native 262144 context, 1 slot. The Vulkan device reports
# 113942 MiB; KV at 262144 x 64 KiB/cell is ~16 GiB. rocm-smi reports the
# 64 GiB budget; trust the runtime for the addressable SVM pool.
CTX_SIZE=262144
PARALLEL=1
BATCH_SIZE=4096
UBATCH_SIZE=4096
CACHE_TYPE_K=f16
CACHE_TYPE_V=f16
CTX_CHECKPOINTS=16
CACHE_RAM=8192
# DFlash2 speculative decoding. The drafter's trained block size is 8;
# SPEC_DRAFT_N_MAX clamps to it. TOP_K selector (top 16 candidates).
SPEC_TYPE=draft-dflash
SPEC_DRAFT_N_MAX=8
SPEC_DRAFT_N_MIN=0
SPEC_DRAFT_P_MIN=0.0
SPEC_DRAFT_P_SPLIT=0.10
# Sampling (model card defaults, thinking-general).
TEMPERATURE=0.7
TOP_P=0.95
# Thinking enabled. deepseek format moves the thinking reasoning into
# message.reasoning_content (OpenAI-compatible).
REASONING=on
REASONING_FORMAT=deepseek
VERBOSITY=4
+104
View File
@@ -0,0 +1,104 @@
#!/usr/bin/env bash
# Serve unsloth/Qwen3.8-27B-UD-Q8_K_XL as frank-default-large with a
# z-lab DFlash2 drafter (Qwen3.8-27B-DFlash2-Q4_K_M) on the Vulkan backend.
#
# Runtime: upstream llama.cpp PR #27342 (DFlash2 support) built with
# GGML_VULKAN=ON for the Strix Halo gfx1151 (RADV). DFlash2 selects its
# candidates through TOP_K + ARGMAX ops that the HIP backend does not
# implement, so the whole stack runs on Vulkan0.
#
# The target and the drafter share the Qwen3.8 arch. DFlash is lossless
# under strict rejection sampling. --spec-draft-n-max clamps to the drafter's
# trained block size (8).
#
# 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/llama.cpp-dflash2/build-dflash2/bin/llama-server}"
: "${MODEL_DIR:=/home/dank/models}"
: "${MODEL_FILE:=Qwen3.8-27B-UD-Q8_K_XL.gguf}"
: "${DRAFT_FILE:=Qwen3.8-27B-DFlash2-Q4_K_M.gguf}"
: "${ALIAS:=frank-default-large}"
: "${BIND_ADDR:=0.0.0.0}"
: "${LISTEN_PORT:=52625}"
: "${CTX_SIZE:=262144}"
: "${PARALLEL:=1}"
: "${BATCH_SIZE:=4096}"
: "${UBATCH_SIZE:=4096}"
: "${CACHE_TYPE_K:=f16}"
: "${CACHE_TYPE_V:=f16}"
: "${CTX_CHECKPOINTS:=16}"
: "${CACHE_RAM:=8192}"
: "${SPEC_TYPE:=draft-dflash}"
: "${SPEC_DRAFT_N_MAX:=8}"
: "${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"
DRAFT="$MODEL_DIR/$DRAFT_FILE"
if [[ ! -f "$MODEL" ]]; then
echo "missing required file: $MODEL" >&2
exit 1
fi
if [[ ! -f "$DRAFT" ]]; then
echo "missing DFlash2 drafter: $DRAFT" >&2
exit 1
fi
if [[ ! -x "$LLAMA_BIN" ]]; then
echo "missing llama-server binary: $LLAMA_BIN" >&2
exit 1
fi
exec "$LLAMA_BIN" \
--model "$MODEL" \
--alias "$ALIAS" \
--host "$BIND_ADDR" \
--port "$LISTEN_PORT" \
-dev Vulkan0 \
-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 "$SPEC_TYPE" \
--spec-draft-model "$DRAFT" \
--spec-draft-device Vulkan0 \
--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" \
--temp "$TEMPERATURE" \
--top-p "$TOP_P" \
--reasoning "$REASONING" \
--reasoning-format "$REASONING_FORMAT" \
--reasoning-budget -1 \
-lv "$VERBOSITY"