--jinja: ik_llama only renders a custom --chat-template-file as real Jinja when --jinja is passed (inputs.use_jinja ? apply_jinja : non-jinja fallback). Without it the Qwen-Sharp template's thinking/image/tool formatting is silently dropped. Add USE_JINJA=1 -> --jinja. Experts: the RTX 3090 had ~5.4 GiB headroom; pull expert blocks 30,32,33,34 back to CUDA (each block ~630 MiB) from CPU for lower latency. Update the OVERRIDE_EXPERT regex, its test, and the KB with the headroom-check note.
78 lines
3.1 KiB
Bash
78 lines
3.1 KiB
Bash
#!/usr/bin/env bats
|
|
# Seam: frank-default-small model, context, tensor placement, and template.
|
|
# This test covers only the Q6_K deployment contract.
|
|
|
|
load helpers
|
|
|
|
ENV_FILE="$REPO_ROOT/scripts/frank-default-small.env"
|
|
SERVE_FILE="$REPO_ROOT/scripts/serve-frank-small.sh"
|
|
UNIT_FILE="$REPO_ROOT/scripts/frank-default-small.service"
|
|
TEMPLATE_FILE="$REPO_ROOT/scripts/chat-template.jinja"
|
|
|
|
@test "frank-default-small selects the Ornith Q6_K model" {
|
|
grep -q '^MODEL_FILE=Ornith-1\.5-35B-A3B-CRACK-Q6_K\.gguf$' "$ENV_FILE"
|
|
grep -q 'Ornith-1\.5-35B-A3B-CRACK-Q6_K\.gguf' "$SERVE_FILE"
|
|
}
|
|
|
|
@test "frank-default-small uses 163840 context per slot across three slots" {
|
|
grep -q '^CTX_SIZE=491520$' "$ENV_FILE"
|
|
grep -q '163840 ctx each' "$ENV_FILE"
|
|
grep -q '^PARALLEL=3$' "$ENV_FILE"
|
|
}
|
|
|
|
@test "frank-default-small keeps full-attention and final blocks on CUDA" {
|
|
source "$ENV_FILE"
|
|
[[ "$OVERRIDE_EXPERT" == 'blk\.(0|1|2|4|5|6|8|9|10|12|13|14|16|17|18|20|21|22|24|25|26|28|29)\.ffn_(up|down|gate|gate_up)_(ch|)exps' ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|3|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|7|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|11|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|15|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|19|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|23|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|27|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|31|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|35|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|36|'* ]]
|
|
[[ "$OVERRIDE_EXPERT" != *'|40|'* ]]
|
|
[[ "$OVERRIDE_BUFT" == CPU ]]
|
|
# ik_llama --gpu-layers/-ngl requires an integer ("all" is rejected); 999
|
|
# loads as many layers as possible while OVERRIDE_EXPERT pins exps to CPU.
|
|
[[ "$N_GPU_LAYERS" == 999 ]]
|
|
}
|
|
|
|
@test "frank-default-small disables speculative decoding for 3 parallel slots" {
|
|
# ik_llama limits speculative decoding to -np 1 and hard-exits with
|
|
# --parallel > 1; this service keeps 3 parallel slots and runs SPEC_TYPE=none.
|
|
grep -q '^SPEC_TYPE=none$' "$ENV_FILE"
|
|
grep -q '^PARALLEL=3$' "$ENV_FILE"
|
|
! grep -q '^SPEC_NGRAM_MOD_N_MIN=' "$ENV_FILE"
|
|
! grep -q '^SPEC_NGRAM_MOD_N_MAX=' "$ENV_FILE"
|
|
! grep -q '^SPEC_NGRAM_MOD_N_MATCH=' "$ENV_FILE"
|
|
! grep -q -- 'SPEC_DRAFT_' "$ENV_FILE"
|
|
! grep -q -- '--spec-type.*draft-mtp' "$SERVE_FILE"
|
|
grep -q -- '--spec-type' "$SERVE_FILE"
|
|
! grep -q -- 'ngram' "$SERVE_FILE"
|
|
}
|
|
|
|
@test "frank-default-small uses ubatch 1024" {
|
|
grep -q '^BATCH_SIZE=4096$' "$ENV_FILE"
|
|
grep -q '^UBATCH_SIZE=1024$' "$ENV_FILE"
|
|
grep -q ': "${UBATCH_SIZE:=1024}"' "$SERVE_FILE"
|
|
}
|
|
|
|
@test "frank-default-small uses the tracked Qwen-Sharp template" {
|
|
grep -q '^CHAT_TEMPLATE_FILE=' "$ENV_FILE"
|
|
grep -q 'peculiar-ragdoll/Qwen-Sharp-Chat-Templates' "$ENV_FILE"
|
|
grep -q 'chat-template\.jinja' "$SERVE_FILE"
|
|
[ -s "$TEMPLATE_FILE" ]
|
|
grep -q 'qwen3\.8-froggeric-v22\.4\.0' "$TEMPLATE_FILE"
|
|
grep -q 'Qwen-Sharp' "$UNIT_FILE"
|
|
}
|
|
|
|
@test "frank-default-small renders the custom template with --jinja" {
|
|
# Without --jinja, ik_llama only supports built-in non-Jinja handlers and
|
|
# silently drops the custom Qwen-Sharp template formatting.
|
|
grep -q '^USE_JINJA=1$' "$ENV_FILE"
|
|
grep -q -- '--jinja' "$SERVE_FILE"
|
|
}
|