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

docs(fp8): correct stale anchors, an unreachable test rule and a wrong test comment

monotophicb95b942197f5
diff --git a/c/Makefile b/c/Makefile
index eed82704..749737ca 100644
--- a/c/Makefile
+++ b/c/Makefile
@@ -501,7 +501,9 @@ TEST_RULES := $(shell sed -n 's|^tests/\(test_[a-z0-9_]*\)\$$(EXE):.*|\1|p' $(f
# test_e8x4g64_loader takes a minted container directory on argv and prints its
# usage (exit 2) without one, so it is a harness rather than a gate: it has a
# rule here so it compiles under the suite's own $(CFLAGS) and its warnings are
-# caught, and tests/test_e8x4g64_mint_load.py is what actually drives it.
+# caught -- reachable via `make e8x4g64-loader-check`, kept out of `check` itself
+# since a bare invocation exits 2 -- and tests/test_e8x4g64_mint_load.py is what
+# actually drives it end to end.
# test_qwen38_tier_engine drives qwen38.c over the generated FP8 fixture
# (qwen38_tiny_fp8, gitignored); it runs from qwen38-tier-engine-check.
TEST_EXCLUDE = test_uring test_deepseek_v4 test_v4_ownership test_v4_serve_framing \
@@ -1087,7 +1089,7 @@ fp8-bench: fp8_bench$(EXE)
./fp8_bench$(EXE)
# Matched resident int8 GPU projection timings; run explicitly, not in CI.
-tests/bench_cuda_resident_batch$(EXE): tests/bench_cuda_resident_batch.cu backend_cuda.cu backend_cuda.h backend_gpu_compat.h
+tests/bench_cuda_resident_batch$(EXE): tests/bench_cuda_resident_batch.cu backend_cuda.cu backend_cuda.h fp8_format.h backend_gpu_compat.h
"$(GPUCC)" $(GPUFLAGS) backend_cuda.cu tests/bench_cuda_resident_batch.cu -o $@ $(ANS_NVCC_LIBS) $(GPU_TEST_LIBS)
# NOCUDA_*: olmoe.c has no COLI_CUDA code at all, so CUDA=1 would otherwise
@@ -2109,6 +2111,14 @@ tests/test_shard_kvb_refuse$(EXE): tests/test_shard_kvb_refuse.c colibri.c st.h
tests/test_e8x4g64_loader$(EXE): tests/test_e8x4g64_loader.c st.h quant.h fp8_format.h compat.h
$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
+# Reachable build-only entry point for the harness above: `make check` never
+# calls this (it stays out of TEST_BINS/test-c, per TEST_EXCLUDE), so this adds
+# no time to `check`. It exists so the suite's own $(CFLAGS) and warnings are
+# actually exercised on demand, the way qwen38-tier-engine-check does for
+# test_qwen38_tier_engine below.
+.PHONY: e8x4g64-loader-check
+e8x4g64-loader-check: tests/test_e8x4g64_loader$(EXE)
+
test-c: $(TEST_BINS)
$(PYTHON) tools/run_tests.py $(TEST_BINS)
@@ -2247,5 +2257,5 @@ tests/test_kimi_request_state$(EXE): tests/test_kimi_request_state.c kimi_k3.c k
$(CC) $(NOCUDA_CFLAGS) tests/test_kimi_request_state.c $(VK_OBJ) -o tests/test_kimi_request_state$(EXE) $(NOCUDA_LDFLAGS)
# Kimi CUDA dispatch/fallback with a fake backend; no CUDA toolkit required.
-tests/test_kimi_cuda_expert$(EXE): tests/test_kimi_cuda_expert.c kimi_k3.c backend_cuda.h kv_prefix.h serve_codec.h st.h json.h tok.h tok_unicode.h tok_unicode_o200k.h compat.h quant.h idot.h omp_tune.h route_trace.h
+tests/test_kimi_cuda_expert$(EXE): tests/test_kimi_cuda_expert.c kimi_k3.c backend_cuda.h kv_prefix.h serve_codec.h st.h json.h tok.h tok_unicode.h tok_unicode_o200k.h compat.h quant.h fp8_format.h idot.h omp_tune.h route_trace.h
$(CC) $(NOCUDA_CFLAGS) -DCOLI_CUDA $< $(VK_OBJ) -o $@ $(NOCUDA_LDFLAGS)
diff --git a/c/tests/test_qt_addrow.c b/c/tests/test_qt_addrow.c
index 254c9e77..6cac5986 100644
--- a/c/tests/test_qt_addrow.c
+++ b/c/tests/test_qt_addrow.c
@@ -390,12 +390,12 @@ static int expect_refuse_call(absorb_fn fn, const char *tag){
#endif
}
-/* fmt=8 block scales that cannot be multiplied through. A NaN scale poisons
- * every accumulator downstream of it; a ZERO scale emits an all-zero block,
- * which is the same output a decode against an unwritten table produces -- so
- * both are refused by name rather than propagated. One probe per value per
+/* A NaN fmt=8 block scale cannot be multiplied through: it poisons every
+ * accumulator downstream of it, so it is refused by name rather than
+ * propagated. (A ZERO scale is the opposite case -- valid data, not refused;
+ * see test_fmt8_zero_scale_decodes_to_zeros below.) One probe per value per
* function; the scale is poisoned AFTER fill_fmt8 has built a valid tensor, so
- * the only thing under test is the new guard. */
+ * the only thing under test is the NaN guard. */
static void poison_scale(QT *t, float v){ t->s[0]=v; }
static void call_addrow_fmt8_nan(void){
diff --git a/c/tools/repack_fp8_passthrough.py b/c/tools/repack_fp8_passthrough.py
index c5452898..71d09728 100644
--- a/c/tools/repack_fp8_passthrough.py
+++ b/c/tools/repack_fp8_passthrough.py
@@ -931,7 +931,7 @@ def _print_inventory_summary(all_inv, dry_run):
# number because it reads as a verification that was not performed.
# - config.json colibri.c, cfg_root() -- fopen(...); if(!f){
# perror(p); exit(1); } -- MANDATORY, the run aborts without it. Also
-# read by openai_server.py's Engine.__init__ (:2635) for arch detection.
+# read by openai_server.py's Engine.__init__ for arch detection.
# - generation_config.json colibri.c, cfg_root() -- fopen, comment "assente
# = nessun problema: e' opzionale" -- best-effort; HF's authority for
# generation defaults (extra EOS stop ids) when present.
diff --git a/docs/FORMATS.md b/docs/FORMATS.md
index 16f38914..c0d3c489 100644
--- a/docs/FORMATS.md
+++ b/docs/FORMATS.md
@@ -94,12 +94,11 @@ fused path) β€” AND the other fused-bound tensors (`q_a`, `q_b`, `kv_a`, `o`,
and on sparse layers `sh_gate`/`sh_up`/`sh_down`) sit on the fmt 1/2/3/4
allowlist; any other format on any of those tensors makes the affected layers'
decode take the CPU path instead, announced by a one-line-per-tensor-kind
-`[METAL]` stderr notice at load. Single source of truth (all anchors
-`c/colibri.c` at branch head `kvb/fmt-gate-notice-r4`): the shared per-layer
-predicate `metal_fused_layer_fmt_miss` (:3396, over the `metal_fused_fmt_ok`
-allowlist, :3379), consulted by both gate sites β€” `attention_rows` (:3448) and
-`layer_forward_rows` (:5792) β€” and by the load-time notice
-`metal_fmt_gate_notice` (:1866, called from `model_init`).
+`[METAL]` stderr notice at load. Single source of truth in `c/colibri.c`: the
+shared per-layer predicate `metal_fused_layer_fmt_miss`, over the
+`metal_fused_fmt_ok` allowlist, consulted by both gate sites β€”
+`attention_rows` and `layer_forward_rows` β€” and by the load-time notice
+`metal_fmt_gate_notice`, called from `model_init`.
Sources for all rows (`c/quant.h`/`c/colibri.c` line numbers verified at
this branch's own head -- originally written against base dev `292ed4c`,