Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/src/mojollama/kernels/legacy-c/cengine_debug.c # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / src / mojollama / kernels / legacy-c / cengine_debug.c` 150 lines · 7838 bytes Raw Blame History 1 /* cengine_debug.c — Per-layer forward with debug prints. */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define Q4_0_BS 18 9 #define Q8_0_BS 34 10 static inline float f16_to_f32(uint16_t h) { return _cvtsh_ss(h); } 11 static inline float hsum_ps(__m256 v) { 12 __m128 l=_mm256_castps256_ps128(v),h=_mm256_extractf128_ps(v,1); 13 l=_mm_add_ps(l,h);l=_mm_hadd_ps(l,l);l=_mm_hadd_ps(l,l);return _mm_cvtss_f32(l); 14 } 15 static inline float q4d(const uint8_t *W, const float *x, int nc, int r) { 16 int bp=nc/32; float total=0.0f; 17 for(int b=0;bmx)mx=dot;} 75 float se=0;for(int s=0;s