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

qwen-image: build and serve on Windows too

JustVugg44dd642cbf29
diff --git a/c/qi_gemm.h b/c/qi_gemm.h
index e2745eb6..561803bf 100644
--- a/c/qi_gemm.h
+++ b/c/qi_gemm.h
@@ -128,7 +128,9 @@ static void qi_gemm_ld(float *Y, int ldy, const float *X, int ldx, int M, const
* does not depend on the thread count. */
#pragma omp parallel
{
- float *panel = (float *)aligned_alloc(64, (size_t)QI_KC * QI_NR * sizeof(float));
+ /* plain malloc: the kernel loads unaligned, and aligned_alloc is missing from
+ * the Windows CRT */
+ float *panel = (float *)malloc((size_t)QI_KC * QI_NR * sizeof(float));
if (!panel) { fprintf(stderr, "OOM qi_gemm panel\n"); exit(1); }
#pragma omp for schedule(dynamic, 1) collapse(2)
for (int mb = 0; mb < mblocks; mb++)
@@ -253,7 +255,7 @@ static void qi_gemm_act8(float *Y, int ldy, const float *X, int ldx, int M, cons
const int nblocks = (N + QI_NR - 1) / QI_NR, mblocks = (M + QI_MC - 1) / QI_MC;
#pragma omp parallel
{
- int8_t *panel = (int8_t *)aligned_alloc(64, (size_t)Kp * QI_NR);
+ int8_t *panel = (int8_t *)malloc((size_t)Kp * QI_NR);
int32_t wsum[QI_NR];
if (!panel) { fprintf(stderr, "OOM qi_gemm_act8 panel\n"); exit(1); }
#pragma omp for schedule(dynamic, 1) collapse(2)
diff --git a/c/qwenimage.c b/c/qwenimage.c
index deaec571..1a44a735 100644
--- a/c/qwenimage.c
+++ b/c/qwenimage.c
@@ -1234,6 +1234,9 @@ static void usage(void){
}
int main(int argc, char **argv){
+ /* Windows: the IMAGE and PREVIEW frames carry raw bytes; a text-mode stdout
+ * would turn every 0x0A inside them into 0x0D 0x0A (#748) */
+ coli_serve_binary_mode();
const char *model = NULL, *prompt = NULL, *out = NULL, *ref = NULL;
int width = 768, height = 512, steps = 8, serve = 0;
uint64_t seed = 42; int seed_set = 0;