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

metal: scope COLI_METAL_MOE_EXACT by path, not format

monotophice3bccc48bc3b
diff --git a/c/backend_metal.mm b/c/backend_metal.mm
index fdd37158..4a9685b9 100644
--- a/c/backend_metal.mm
+++ b/c/backend_metal.mm
@@ -1244,7 +1244,11 @@ static id<MTLCommandBuffer> moe_submit(int nb, int D, int Iinter, int fmt, int q
// (PR #587 gate-2: token-exact mode for trajectories whose gap dips under the drift tail.)
{ static int g_moe_exact = -1;
if (g_moe_exact < 0) { const char *e = getenv("COLI_METAL_MOE_EXACT"); g_moe_exact = (e && e[0] && e[0] != '0'); }
- if (fmt == 4 && g_moe_exact) return nil; }
+ if (g_moe_exact) return nil; } /* exact mode is path-scoped, not fmt-scoped: the resident
+ * tier (fmt=1 on mixed containers) carries the same
+ * accumulation-order drift, so ALL routed experts fall to
+ * CPU under the flag (measured: 4/5 prompt flips -> 0/5,
+ * real g64 744B container, #587) */
if (g_resset_enabled) { // E5: commit any pending slab adds before we may skip useResource:
double t0 = mnow(); resset_flush(); g_t_resset_flush += mnow() - t0; // METAL-RESSET line
}