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

build: limit adapter globals to their compiled consumers

Rudy Celeklibdf2dac91f12
diff --git a/c/colibri.c b/c/colibri.c
index f80c8964..0c19116b 100644
--- a/c/colibri.c
+++ b/c/colibri.c
@@ -3778,7 +3778,9 @@ static int g_pipe=0; /* PIPE=1: async expert-load pipeline. Default ON for
* Keeps expert pread off the forward-pass thread so loads overlap
* the matmul. PIPE=0 opts back into the blocking serial path. */
static int g_pipe_nw=8; /* PIPE_WORKERS=n: I/O worker threads (disk-parallel reads) */
+#if defined(__linux__) || !defined(COLIBRI_NO_MAIN)
static int g_uring=0; /* URING=1: Linux io_uring load/completion backend; implies PIPE */
+#endif
static int g_pipe_block=0;/* COLI_PIPE_BLOCK=1: pipe_wait blocca su una condvar invece dello
* spin sched_yield (default OFF = spin byte-identico). EN: a yield
* storm on the main thread fights the OpenMP team for cycles during
diff --git a/c/olmoe.c b/c/olmoe.c
index ebd5a6f8..312f4d1a 100644
--- a/c/olmoe.c
+++ b/c/olmoe.c
@@ -163,10 +163,12 @@ static int g_pilot = 0;
static int g_wide = 1; /* IMPROVEMENT 4: top-K * g_wide candidates prefetched */
static int g_pilot_evict_guard = 1; /* PILOT_EVICT_GUARD=0 to disable LFRU prefetch eviction guard */
static int g_expert_drop = 0; /* EXPERT_DROP=1 restores fadvise(DONTNEED) after expert reads */
+#if defined(__AVX2__) || !defined(OLMOE_NO_MAIN)
static int g_fused3 = 0; /* FUSED3=1: AVX2 activation quant + gate/up pair matmul
* (fused_simd.h: quant_x_q8_avx2, matmul_q_idot_v3,
* matmul_q_idot_pair_v3). Exact integer arithmetic only —
* bit-identical to the stock matmul_q path; OFF by default. */
+#endif
static uint64_t lfru_score(uint32_t heat, uint64_t last, uint64_t clock) {
uint64_t age = (clock > last) ? (clock - last) : 0;