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

fix(cuda): add the __syncwarp() grouped_s4_wmma's siblings carry (closes #1099)

JustVugg10af5e9f4d78
diff --git a/c/backend_cuda.cu b/c/backend_cuda.cu
index 7d661c75..49b60878 100644
--- a/c/backend_cuda.cu
+++ b/c/backend_cuda.cu
@@ -683,6 +683,9 @@ __global__ static void grouped_s4_wmma(float *y,const uint8_t *x,const float *xs
wmma::mma_sync(acc,af,bf,acc);
}
__shared__ int out[8][64]; wmma::store_matrix_sync(out[warp],acc,8,wmma::mem_row_major);
+ __syncwarp(); /* i due fratelli sopra la portano; stessa lettura cross-lane di out[warp]
+ * subito sotto -> stesso requisito di visibilita' (racecheck: 3 hazard qui).
+ * EN: the two sibling kernels carry this; same cross-lane read follows. */
for(int i=lane;i<64;i+=32){int s=i/8,o=tile*8+i%8;
if(s<d.rows&&o<O)y[(size_t)(d.offset+s)*O+o]=(float)out[warp][i]*xscale[d.offset+s]*ws[o];}
#endif