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

olmoe, qwen36: PROF at microsecond resolution

JustVugge4f3b991e3cb
diff --git a/c/olmoe.c b/c/olmoe.c
index ff7067b2..06360d79 100644
--- a/c/olmoe.c
+++ b/c/olmoe.c
@@ -1525,7 +1525,8 @@ static int serve_one(Model *m, Tok *T, SReq *q, int ctx_cap) {
* zero: this engine has no separate wait phase. */
double disk_s = (double)(__atomic_load_n(&m->disk_ns, __ATOMIC_RELAXED) - disk0) / 1e9;
double matmul_s = (g_prof_moe_s - moe0) - disk_s; if (matmul_s < 0.0) matmul_s = 0.0;
- printf("PROF %.3f %d %d %.3f 0.0 %.3f %.3f %.3f %lld\n", dt, np, gen, disk_s, matmul_s,
+ /* microsecond resolution: see qwen36.c, same reason (a sub-millisecond tiny turn read as unmeasured) */
+ printf("PROF %.6f %d %d %.6f 0.0 %.6f %.6f %.6f %lld\n", dt, np, gen, disk_s, matmul_s,
g_prof_attn_s - attn0, g_prof_head_s - head0, g_prof_forwards - fwd0);
fflush(stdout);
serve_hits(m);
diff --git a/c/qwen36.c b/c/qwen36.c
index ffdaf3e2..5b697225 100644
--- a/c/qwen36.c
+++ b/c/qwen36.c
@@ -2864,7 +2864,10 @@ static void serve_one(Model *m, ServeReq *q){
hits_emit(m);
{
double disk=m->t_disk-s_disk, moe=tm_sum(2)-s_moe;
- printf("PROF %.3f %d %d %.3f %.3f %.3f %.3f %.3f %llu\n", dt, np, gen,
+ /* microsecond resolution: a tiny-fixture turn on a fast runner is under
+ * a millisecond, and at %.3f every phase (and the wall) printed 0.000,
+ * which the dashboard tests read as "not measured" (dev CI, 2026-09-14) */
+ printf("PROF %.6f %d %d %.6f %.6f %.6f %.6f %.6f %llu\n", dt, np, gen,
disk, 0.0, moe>disk?moe-disk:0.0, tm_sum(0)+tm_sum(1)-s_attn, tm_sum(5)-s_head,
(unsigned long long)forwards); /* contati, non dedotti: l'ultimo token non ne fa uno */
fflush(stdout);