Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

Merge pull request #1867 into integ/release-batch-5

JustVugg03a3676aa871
diff --cc c/Makefile
index 1c3e4978,a77b8c3b..ff67c0bf
--- a/c/Makefile
+++ b/c/Makefile
@@@ -527,10 -526,10 +527,10 @@@ TEST_EXCLUDE = test_uring test_deepseek
test_segment_adapters_registration test_segment_adapters_real \
test_edge_adapters_registration test_edge_adapters_real \
test_xdna_execution test_xdna_failure \
- test_gsgemv_sse41 test_qgemv_sse41 test_olmoe_dot_i8_16_sse41 test_st_f16_bf16_simd_sse41 test_qwen38_tier_engine \
+ test_gsgemv_sse41 test_qgemv_sse41 test_olmoe_dot_i8_16_sse41 test_st_f16_bf16_simd_sse41 test_qwen38_tier_engine test_qwen38_dn_gpu \
test_e8x4g64_loader test_qwenimage_vae test_vk_tier \
test_i4_grouped_sse41 test_i4_grouped_sse41_o1 test_i4_grouped_sse41_no_contract
- TEST_EXCLUDE += test_vk_chain
+ TEST_EXCLUDE += test_vk_chain test_glm53_vk_f32
TEST_BINS = $(addprefix tests/,$(addsuffix $(EXE),$(filter-out $(TEST_EXCLUDE),$(TEST_RULES))))
ifneq (,$(LINUX))
TEST_BINS += tests/test_uring$(EXE)
diff --cc c/glm53.c
index 4aa767bd,63611172..8af1c96d
--- a/c/glm53.c
+++ b/c/glm53.c
@@@ -1098,15 -989,13 +1098,17 @@@ static void mv(float *out, const Mat *w
}
#endif
#ifdef COLI_VULKAN
- if (g_vk_dense && w->resident && (w->fmt == 0 || w->fmt == 1 || w->fmt == 4)) {
+ if (g53_dho_gone(w)) {
+ if (g53_dho_matmul(w, out, x, 1)) return;
+ g53_dho_reload((Mat *)w);
+ }
- if (g_vk_dense && w->resident && (w->fmt == 1 || w->fmt == 4) && G53_VK_MAY(w)) {
++ if (g_vk_dense && w->resident && (w->fmt == 0 || w->fmt == 1 || w->fmt == 4) && G53_VK_MAY(w)) {
Mat *mutable_w = (Mat *)w;
if (coli_vk_matmul((ColiVkTensor **)&mutable_w->vk, out, x,
+ w->fmt == 0 ? (const void *)w->f :
w->fmt == 4 ? (const void *)w->q4 : (const void *)w->q8,
- w->s, w->fmt, 1, w->columns, w->rows, w->gs))
+ w->fmt == 0 ? NULL : w->s, w->fmt == 0 ? 10 : w->fmt,
+ 1, w->columns, w->rows, w->gs))
return;
}
#endif
@@@ -1130,19 -1019,16 +1132,21 @@@ static void mm(float *out, const Mat *w
gpu |= g_metal_ready && w->resident && (w->fmt == 1 || w->fmt == 4);
#endif
#ifdef COLI_VULKAN
- if (S > 1 && g_vk_dense && w->resident && (w->fmt == 0 || w->fmt == 1 || w->fmt == 4)) {
+ if (S > 1 && g53_dho_gone(w)) { /* the device holds it alone: S rows there, else row by row (mv reads it back) */
+ if (g53_dho_matmul(w, out, x, S)) return;
+ for (int t = 0; t < S; t++) mv(out + (size_t)t * w->rows, w, x + (size_t)t * w->columns);
+ return;
+ }
- if (S > 1 && g_vk_dense && w->resident && (w->fmt == 1 || w->fmt == 4) && G53_VK_MAY(w)) {
++ if (S > 1 && g_vk_dense && w->resident && (w->fmt == 0 || w->fmt == 1 || w->fmt == 4) && G53_VK_MAY(w)) {
Mat *mutable_w = (Mat *)w;
if (coli_vk_matmul((ColiVkTensor **)&mutable_w->vk, out, x,
+ w->fmt == 0 ? (const void *)w->f :
w->fmt == 4 ? (const void *)w->q4 : (const void *)w->q8,
- w->s, w->fmt, S, w->columns, w->rows, w->gs))
+ w->fmt == 0 ? NULL : w->s, w->fmt == 0 ? 10 : w->fmt,
+ S, w->columns, w->rows, w->gs))
return;
}
- gpu |= g_vk_dense && w->resident && (w->fmt == 1 || w->fmt == 4) && G53_VK_MAY(w);
- gpu |= g_vk_dense && w->resident && (w->fmt == 0 || w->fmt == 1 || w->fmt == 4);
++ gpu |= g_vk_dense && w->resident && (w->fmt == 0 || w->fmt == 1 || w->fmt == 4) && G53_VK_MAY(w);
#endif
if (S == 1 || gpu) {
for (int t = 0; t < S; t++)
diff --cc c/tests/vulkan_engines.sh
index 2c96ae9d,cd012d27..bdb0c31f
--- a/c/tests/vulkan_engines.sh
+++ b/c/tests/vulkan_engines.sh
@@@ -87,207 -64,10 +89,209 @@@ shader_formats()
tail -1 vk_test.log | grep -qx PASS || fail "qmatmul format cases"
./tests/test_vk_tier shaders/qmatmul.spv | tee vk_tier.log
tail -1 vk_tier.log | grep -qx PASS || fail "routed-expert tier"
+ ./tests/test_glm53_vk_f32
+ COLI_VK_GEMM_MIN_S=0 ./tests/test_glm53_vk_f32
}
+# Staged uploads (docs/vulkan.md, "Memory placement without Resizable BAR"): resident
+# data copied from a host staging buffer into device-local memory the host does not map,
+# as a discrete card without Resizable BAR needs, against the mapped path on this device:
+# - the harness's results (every format, the tiled GEMMs, the expert batch) bit for bit
+# the same mapped (COLI_VK_STAGED=0), staged (=1, twice: no run-to-run difference) and
+# under an emulated 246 MB host-visible window (COLI_VK_HOST_VISIBLE_CAP_MB=246 and
+# nothing else), which must choose staging on its own;
+# - the routed-expert tier (test_vk_tier) and the chain's ops (test_vk_chain) staged;
+# - each staged run ends with no resident data in host memory ("[VK] memory at exit").
+staged_check() { # <err log> <tag>: staged, and nothing resident left in host memory
+ grep -q '^\[VK\] memory: staged uploads' "$1" || { cat "$1"; fail "$2: not staged"; }
+ grep -q 'resident data in host memory: 0.0 MiB' "$1" || { grep '\[VK\] memory' "$1"; fail "$2: resident data in host memory"; }
+}
+family_staged() {
+ make tests/test_vk_tier tests/test_vk_chain VK=1 # the shaders too
+ cc -O2 -pthread -DVK_TEST backend_vulkan.c -o vk_test -lvulkan -lm
+ local m e d d0=""
+ for m in mapped staged staged-again staged-noimport window; do
+ case $m in
+ mapped) e=COLI_VK_STAGED=0 ;;
+ staged|staged-again) e=COLI_VK_STAGED=1 ;;
+ staged-noimport) e="COLI_VK_STAGED=1 COLI_VK_UP_IMPORT=0" ;; # every copy through the staging buffer
+ window) e=COLI_VK_HOST_VISIBLE_CAP_MB=246 ;;
+ esac
+ env -u COLI_VK_STAGED -u COLI_VK_HOST_VISIBLE_CAP_MB $e COLI_VK_TEST_MATMUL_ONLY=1 ./vk_test shaders/qmatmul.spv > vk_test.log 2> vk_test.err
+ tail -1 vk_test.log | grep -qx PASS || { cat vk_test.log vk_test.err; fail "staged harness, $m"; }
+ if [ $m = mapped ]; then grep -qx 'memory: mapped' vk_test.log || { cat vk_test.err; fail "staged harness: COLI_VK_STAGED=0 staged"; }
+ else staged_check vk_test.err "staged harness, $m"; fi
+ d=$(sed -n 's/^outputs digest //p' vk_test.log)
+ [ -n "$d" ] || fail "staged harness, $m: no digest"
+ [ -n "$d0" ] || d0=$d
+ [ "$d" = "$d0" ] || fail "staged harness, $m: the results differ from the mapped run's ($d against $d0)"
+ echo "OK staged harness $m: $(grep '^memory:' vk_test.log), results digest $d"
+ done
+ COLI_VK_STAGED=1 ./tests/test_vk_tier shaders/qmatmul.spv > vk_tier.log 2> vk_tier.err
+ tail -1 vk_tier.log | grep -qx PASS || { cat vk_tier.log vk_tier.err; fail "staged routed-expert tier"; }
+ staged_check vk_tier.err "staged routed-expert tier"
+ echo "OK staged routed-expert tier: $(grep -o 'resident data in host memory: .*' vk_tier.err)"
+ COLI_VK_STAGED=1 COLI_VK_UP_IMPORT=0 ./tests/test_vk_tier shaders/qmatmul.spv > vk_tier.log 2> vk_tier.err
+ tail -1 vk_tier.log | grep -qx PASS || { cat vk_tier.log vk_tier.err; fail "staged routed-expert tier, no imports"; }
+ echo "OK staged routed-expert tier, every copy staged (COLI_VK_UP_IMPORT=0)"
+ COLI_VK_STAGED=1 ./tests/test_vk_chain shaders/qmatmul.spv > vk_chain.log 2> vk_chain.err
+ tail -1 vk_chain.log | grep -qx PASS || { cat vk_chain.log vk_chain.err; fail "staged chain ops"; }
+ staged_check vk_chain.err "staged chain ops"
+ echo "OK staged chain ops: $(grep -o 'resident data in host memory: .*' vk_chain.err)"
+}
+# imported_copies <log>: the copies the exit report says came straight from host memory
+imported_copies() { sed -n 's/.* MiB of them straight from host memory in \([0-9]*\) copies.*/\1/p' "$1" | tail -1; }
+# Staged uploads straight from host memory (up_import, VK_EXT_external_memory_host): the
+# tier's experts from the host image they are converted in, the trunk's rows from the
+# weights. The same tokens and logits as every copy through the staging buffer
+# (COLI_VK_UP_IMPORT=0); the exit report counts the imported copies; an import the driver
+# refuses (COLI_VK_STAGED_FAULT=import) is staged instead.
+staged_import() {
+ make qwen36 VK=1
+ [ -f qwen36_tiny/ref_full.json ] && [ -d qwen36_tiny_c ] || {
+ $PY tools/make_qwen36_tiny.py --out qwen36_tiny --ref-mode full --emit-ref qwen36_tiny/ref_full.json
+ $PY tools/convert_qwen36.py --model qwen36_tiny --out qwen36_tiny_c --ebits 8; }
+ local i n f
+ SNAP=qwen36_tiny_c COLI_DENSE_I8=0 ./qwen36 8 8 qwen36_tiny/ref_full.json > cpu.log 2>&1 || true
+ COLI_VULKAN=1 COLI_VK_STAGED=1 SNAP=qwen36_tiny_c ./qwen36 1 8 qwen36_tiny/ref_full.json > imp.log 2>&1 || true
+ grep -q '^\[VK\] ready' imp.log || { cat imp.log; fail "staged imports: the probe did not open the device"; }
+ if ! grep -q '^\[VK\] staged uploads: copied straight from host memory' imp.log; then
+ echo "OK staged imports: this driver has no VK_EXT_external_memory_host, every copy is staged"; return 0
+ fi
+ for i in 1 0; do
+ rm -f imp.usage
+ env COLI_USAGE=imp.usage COLI_VULKAN=1 COLI_VK_STAGED=1 COLI_VK_UP_IMPORT=$i COLI_VK_DENSE=1 COLI_VK_TIER_SYNC=1 \
+ COLI_DENSE_I8=0 DUMP=imp$i.f32 SNAP=qwen36_tiny_c ./qwen36 8 8 qwen36_tiny/ref_full.json > imp$i.log 2>&1 || true
+ same_tokens cpu.log imp$i.log "staged imports COLI_VK_UP_IMPORT=$i"
+ staged_check imp$i.log "staged imports COLI_VK_UP_IMPORT=$i"
+ done
+ cmp -s imp1.f32 imp0.f32 || fail "staged imports: the logits differ from every copy staged"
+ n=$(imported_copies imp1.log); [ "${n:-0}" -gt 0 ] || { grep '\[VK\] memory' imp1.log; fail "staged imports: nothing imported"; }
+ [ "$(imported_copies imp0.log)" = 0 ] || { grep '\[VK\] memory' imp0.log; fail "staged imports: COLI_VK_UP_IMPORT=0 imported"; }
+ echo "OK staged imports: tokens = CPU, logits = every copy staged, $n copies straight from host memory"
+ rm -f imp.usage
+ env COLI_USAGE=imp.usage COLI_VULKAN=1 COLI_VK_STAGED=1 COLI_VK_STAGED_FAULT=import:1 COLI_VK_DENSE=1 COLI_VK_TIER_SYNC=1 \
+ COLI_DENSE_I8=0 SNAP=qwen36_tiny_c ./qwen36 8 8 qwen36_tiny/ref_full.json > impf.log 2>&1 || true
+ grep -q "COLI_VK_STAGED_FAULT: import #1 fails" impf.log || { cat impf.log; fail "staged imports: the import fault never fired"; }
+ same_tokens cpu.log impf.log "staged imports, a refused import"
+ f=$(sed -n 's/.* copies (\([0-9]*\) not imported).*/\1/p' impf.log | tail -1)
+ [ "${f:-0}" -ge 1 ] || { grep '\[VK\] memory' impf.log; fail "staged imports: the refused import is not counted"; }
+ echo "OK staged imports, a refused import: staged instead, tokens = CPU"
+ rm -f imp.usage imp0.f32 imp1.f32
+}
+# An engine under the emulated window, COLI_VK_STAGED unset: it stages on its own, the
+# tier with the trunk on the device and the chain give the CPU's tokens (and logits),
+# and nothing resident ends in host memory.
+staged_window() {
+ make qwen36 VK=1
+ $PY tools/make_qwen36_tiny.py --out qwen36_tiny --ref-mode full --emit-ref qwen36_tiny/ref_full.json
+ $PY tools/convert_qwen36.py --model qwen36_tiny --out qwen36_tiny_c --ebits 8
+ tier_gate qwen36 "window qwen36 tier and trunk" COLI_VK_HOST_VISIBLE_CAP_MB=246 COLI_VK_DENSE=1 COLI_DENSE_I8=0 SNAP=qwen36_tiny_c -- 8 8 qwen36_tiny/ref_full.json
+ staged_check vk.log "window qwen36 tier and trunk"
+ chain_gate qwen36 "window qwen36 chain" 1 COLI_VK_HOST_VISIBLE_CAP_MB=246 COLI_DENSE_I8=0 SNAP=qwen36_tiny_c -- 8 8 qwen36_tiny/ref_full.json
+ staged_check vk.log "window qwen36 chain"
+ echo "OK window qwen36: staged on its own, $(grep -o 'resident data in host memory: .*' vk.log)"
+ staged_import # here: the engine's fixture needs the fixture dependencies, which staged's job has not
+}
+
+# Staged uploads failing (COLI_VK_STAGED_FAULT=<point>[:n], the n-th time) at every point
+# they can: the uploader's staging buffer (stage), the KV mirror's (pwstage), a weight
+# pool's device-local block (block), a KV mirror or norm-weight buffer (kvbuf), a command
+# buffer's begin or end (record), a submit, a fence wait (the device is then lost), a tier
+# expert's commit after its first matrix (commit). qwen36 with its trunk's matrices on the
+# device one by one, its tier awaited (COLI_VK_TIER_SYNC=1) and with the uploader thread
+# free after a warm start, and its chain; colibri's attention core for the KV mirror. Every
+# run: no crash and no sanitizer report, the fault fired, the CPU's tokens. A matrix that
+# failed stays on the CPU (one fewer resident); an expert whose commit failed stays on the
+# CPU and the tier's budget stands; a lost device takes everything to the CPU, the chain
+# rebuilding its state there. SAN=1 (staged-faults-sanitize): a sanitized build.
+fault_run() { # <tag> <fault> <cpu tokens> <env...> -- <command...>
+ local tag=$1 fault=$2 ref=$3 rc=0; shift 3
+ local envs=(); while [ "$1" != "--" ]; do envs+=("$1"); shift; done; shift
+ if [ -f hist.usage ]; then cp hist.usage run.usage; else rm -f run.usage; fi
+ env "${envs[@]}" COLI_USAGE=run.usage COLI_VULKAN=1 COLI_VK_STAGED=1 ${fault:+COLI_VK_STAGED_FAULT=$fault} "$@" > vk.log 2>&1 || rc=$?
+ if [ $rc -ge 128 ] || grep -qE "ERROR: AddressSanitizer|runtime error:" vk.log; then cat vk.log; fail "$tag: crashed (exit $rc)"; fi
+ [ -z "$fault" ] || grep -q "COLI_VK_STAGED_FAULT: ${fault%%:*} " vk.log || { cat vk.log; fail "$tag: the fault never fired"; }
+ grep -a 'C engine' vk.log > vk.tok || true
+ { [ -s "$ref" ] && cmp -s "$ref" vk.tok; } || { cat "$ref" vk.tok; fail "$tag: tokens differ from the CPU's"; }
+}
+fault_num() { # <sed expression> <log>: the first number it extracts, 0 without one
+ local n; n=$(sed -n "$1" "$2" | tail -1); echo "${n:-0}"
+}
+family_staged_faults() {
+ if [ "${SAN:-0}" = 1 ]; then
+ make clean >/dev/null 2>&1 || true
+ make qwen36 colibri VK=1 EXTRA_CFLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g"
+ export ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=0 UBSAN_OPTIONS=print_stacktrace=1
+ else
+ make qwen36 colibri VK=1
+ fi
+ $PY tools/make_qwen36_tiny.py --out qwen36_tiny --ref-mode full --emit-ref qwen36_tiny/ref_full.json
+ $PY tools/convert_qwen36.py --model qwen36_tiny --out qwen36_tiny_c --ebits 8
+ mkdir -p glm_fp8 && (cd glm_fp8 && $PY ../tools/make_glm_oracle.py --fp8 > /dev/null)
+ $PY tools/convert_fp8_to_int4.py --indir glm_fp8/glm_tiny --outdir glm_tiny_i4 --ebits 4 --io-bits 4 \
+ --n-layers 5 --min-free-gb 0 > /dev/null
+ cp glm_fp8/ref_glm.json glm_tiny_i4/
+ local q=(COLI_DENSE_I8=0 SNAP=qwen36_tiny_c ./qwen36 8 8 qwen36_tiny/ref_full.json)
+ local g=(IDOT=0 SNAP=glm_tiny_i4 REF=glm_tiny_i4/ref_glm.json ./colibri 2 4 4)
+ env "${q[@]}" > cpu.log 2>&1 || true; grep -a 'C engine' cpu.log > q.tok || true
+ env "${g[@]}" > cpu.log 2>&1 || true; grep -a 'C engine' cpu.log > g.tok || true
+ local f n S
+ rm -f hist.usage
+ # the trunk's matrices one by one (no tier, no chain)
+ local D=(COLI_VK_TIER=0 COLI_VK_CHAIN=0 COLI_VK_DENSE=1)
+ fault_run "faults: qwen36 matrices, none" "" q.tok "${D[@]}" -- "${q[@]}"
+ n=$(fault_num 's/.*matmuls on the GPU (\([0-9]*\) matrices.*/\1/p' vk.log)
+ for f in stage:1 block:1 record:4 submit:4 wait:1 wait:4; do
+ fault_run "faults: qwen36 matrices, $f" $f q.tok "${D[@]}" -- "${q[@]}"
+ case $f in block:1|record:4|submit:4)
+ [ "$(fault_num 's/.*matmuls on the GPU (\([0-9]*\) matrices.*/\1/p' vk.log)" = $((n - 1)) ] || {
+ grep '\[VK\]' vk.log; fail "faults: qwen36 matrices, $f: not exactly one matrix left on the CPU"; } ;;
+ wait:*) grep -q 'the device is lost' vk.log || { cat vk.log; fail "faults: qwen36 matrices, $f: the device was not lost"; } ;;
+ esac
+ echo "OK faults: qwen36 matrices, $f: tokens = CPU, $(grep -ao 'staged upload failed[^:]*: [^)]*): .*' vk.log | head -1 | sed 's/.*): //')"
+ done
+ # the tier awaited: the trunk on the CPU, every upload at the next step
+ local T=(COLI_VK_CHAIN=0 COLI_VK_DENSE=0 COLI_VK_TIER_SYNC=1 COLI_VK_TIER_BALANCE=0)
+ fault_run "faults: qwen36 tier, none" "" q.tok "${T[@]}" -- "${q[@]}"
+ local budget; budget=$(fault_num 's/.*resident [0-9]* (budget \([0-9]*\),.*/\1/p' vk.log)
+ cp run.usage hist.usage.next
+ for f in stage:1 block:1 record:3 record:4 submit:2 wait:2 commit:1 commit:3; do
+ fault_run "faults: qwen36 tier, $f" $f q.tok "${T[@]}" -- "${q[@]}"
+ case $f in commit:*|record:*|submit:*)
+ [ "$(fault_num 's/.*resident [0-9]* (budget \([0-9]*\),.*/\1/p' vk.log)" = "$budget" ] || {
+ grep '\[VK\] tier' vk.log; fail "faults: qwen36 tier, $f: the budget shrank"; } ;;
+ esac
+ echo "OK faults: qwen36 tier, $f: tokens = CPU, $(grep -ao 'resident [0-9]* (budget [0-9]*' vk.log | tail -1), $(grep -ao 'failed [0-9]* |' vk.log | tail -1 | tr -d '|')"
+ done
+ # the tier's uploader thread free: a warm start from a history (vkt_put, any thread),
+ # then promotions as experts pass
+ mv hist.usage.next hist.usage
+ T=(COLI_VK_CHAIN=0 COLI_VK_DENSE=0)
+ for f in stage:1 block:1 record:3 submit:2 wait:3 commit:1 commit:5; do
+ fault_run "faults: qwen36 tier, uploader thread, $f" $f q.tok "${T[@]}" -- "${q[@]}"
+ echo "OK faults: qwen36 tier, uploader thread, $f: tokens = CPU, $(grep -ao 'resident [0-9]* (budget [0-9]*' vk.log | tail -1)"
+ done
+ rm -f hist.usage
+ # the chain: a failure before it starts declines it (or leaves one matrix behind), a
+ # lost device in the middle has the CPU rebuild the state
+ local C=(COLI_VK_CHAIN=1 COLI_VK_TIER_SYNC=1)
+ fault_run "faults: qwen36 chain, none" "" q.tok "${C[@]}" -- "${q[@]}"
+ S=$(fault_num 's/.*copies (\([0-9]*\) submits).*/\1/p' vk.log)
+ for f in stage:1 block:1 record:4 submit:4 commit:1 wait:4 wait:$((S - 2)); do
+ fault_run "faults: qwen36 chain, $f" $f q.tok "${C[@]}" -- "${q[@]}"
+ [ $f != wait:$((S - 2)) ] || grep -q 'rebuilding the state of [1-9]' vk.log || { cat vk.log; fail "faults: qwen36 chain, $f: no state rebuilt on the CPU"; }
+ echo "OK faults: qwen36 chain, $f: tokens = CPU, $(grep -ao 'qwen36 chain: [0-9]* forwards\|rebuilding the state of [0-9]* positions' vk.log | tr '\n' ' ')"
+ done
+ # colibri's attention core: the KV mirror's buffers and its staging
+ local A=(COLI_VK_DENSE=1 COLI_VK_ATTN=1 COLI_VK_TIER_SYNC=1)
+ for f in pwstage:1 kvbuf:1 kvbuf:3 wait:3; do
+ fault_run "faults: colibri attention, $f" $f g.tok "${A[@]}" -- "${g[@]}"
+ echo "OK faults: colibri attention, $f: tokens = CPU"
+ done
+ if [ "${SAN:-0}" = 1 ]; then make clean >/dev/null 2>&1 || true; fi
+}
+
# tier_count <engine> <log>: N from the last "[VK] tier <engine> run: device N of M" line;
# tier_evictions <engine> <log>: the evictions of that line; tier_failed: its failed
# uploads (an eviction case must have none: a promotion that displaces a resident
@@@ -2206,10 -1838,15 +2210,11 @@@ family_glm_chain()
CHAIN_SERVE_DIALECT=numeric $PY tests/vulkan_chain_serve.py ./glm53 glm53_serve GLM53_BITS=4 COLI_VK_CHAIN_ROWS=3
CHAIN_SERVE_SLOTS=2 CHAIN_SERVE_DIALECT=numeric $PY tests/vulkan_chain_serve.py ./glm53 glm53_serve GLM53_BITS=32 KV_SLOTS=2
COLI_VK_CHAIN=2 CHAIN_SERVE_DIALECT=numeric $PY tests/vulkan_chain_serve.py ./glm53 glm53_serve GLM53_BITS=32
- # A pin restored over rows another branch rewrote: the KDA state goes up from the
- # pin, the MLA rows' watermark comes down. This check compares printed logprobs
- # exactly, so keep the per-row GEMV for every prompt length (as for MiMo's exact
- # prefix check). A cold prompt and a short resumed tail can otherwise straddle
- # the GEMM threshold, including at the now-device-resident f32 lm_head, and differ
- # in the last printed digit from reduction order alone. The gates above exercise
- # the default GEMM/GEMV policy against CPU tokens and the numerical tolerance.
- COLI_VULKAN=1 COLI_VK_CHAIN=1 COLI_VK_GEMM_MIN_S=0 COLI_USAGE=$PWD/chain.usage \
- $PY tests/glm53_pin_branch_harness.py --binary ./glm53 --fixture glm53_mm_tiny
+ # a pin restored over rows another branch rewrote: the KDA state goes up from the pin,
+ # the MLA rows' watermark comes down (the tier off and the scores within 1e-5: two
- # engine processes, see vulkan_partial_glm.sh)
- COLI_VULKAN=1 COLI_VK_CHAIN=1 COLI_USAGE=$PWD/chain.usage COLI_VK_TIER=0 $PY tests/glm53_pin_branch_harness.py --binary ./glm53 --fixture glm53_mm_tiny --tol 1e-5
++ # engine processes, see vulkan_partial_glm.sh; the per-row GEMV for every prompt
++ # length, so a cold prompt and a short resumed tail take the same kernels)
++ COLI_VULKAN=1 COLI_VK_CHAIN=1 COLI_VK_GEMM_MIN_S=0 COLI_USAGE=$PWD/chain.usage COLI_VK_TIER=0 $PY tests/glm53_pin_branch_harness.py --binary ./glm53 --fixture glm53_mm_tiny --tol 1e-5
unset OMP_NUM_THREADS CAP_RAISE
}