K3-Stuff / scripts /16_smoke_server.sh
TessaCoil's picture
Upload folder using huggingface_hub
ddf8c5b verified
Raw
History Blame Contribute Delete
1.84 kB
#!/usr/bin/env bash
# k3-test/16_smoke_server.sh — validate the persistent-server harness on the smoke
# model BEFORE spending K3 load time. Covers: server lifecycle, baseline decode,
# pp sweep, concurrency, cpu-moe offload, and cpu-moe + ngram-spec (the home case).
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export K3TEST_ROOT="$SCRIPT_DIR"
source "$SCRIPT_DIR/lib/common.sh"
# shellcheck source=lib/server.sh
source "$K3TEST_ROOT/lib/server.sh"
[[ -f $SMOKE_MODEL_PATH ]] || die "smoke model missing"
CHAT="$K3TEST_ROOT/prompts/chat.txt"; CODING="$K3TEST_ROOT/prompts/coding.txt"
ok=0; fail=0
gate() { [[ $1 -eq 0 ]] && ok=$((ok+1)) || { fail=$((fail+1)); echo "SRV-FAIL: $2" >&2; }; }
info "### [S10] server, GPU-resident, -np 2"
start_server gpu -m "$SMOKE_MODEL_PATH" -ngl 99 -np 2 -t "$THREADS"; gate $? S10_start
server_completion srv_gpu_coding "$CODING" 96; gate $? S10_decode
server_completion srv_gpu_chat "$CHAT" 96
server_pp_sweep srv_gpu "512 2048"
server_concurrency srv_gpu_conc 96 "$CODING" "$CHAT"
stop_server
info "### [S11] server, --cpu-moe"
start_server cmoe -m "$SMOKE_MODEL_PATH" -ngl 99 --cpu-moe -np 1 -t "$THREADS"; gate $? S11_start
server_completion srv_cmoe_coding "$CODING" 96; gate $? S11_decode
stop_server
info "### [S12] server, --cpu-moe + ngram-spec (the home deployment combo)"
start_server cmoe_spec -m "$SMOKE_MODEL_PATH" -ngl 99 --cpu-moe --spec-type ngram-simple -np 1 -t "$THREADS"
gate $? S12_start
server_completion srv_cmoepsec_coding "$CODING" 96; gate $? S12_decode
grep -iE "accept|draft|spec" "$LOG_ROOT/server_cmoe_spec/server.log" | tail -4 || true
stop_server
echo "== server smoke summary =="
grep -E "^srv_" "$LOG_ROOT/metrics.tsv" | column -t
[[ $fail -eq 0 ]] || die "server smoke had $fail failures"
info "SERVER SMOKE GATE PASSED ($ok core cases)"