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/.hermes/debug-logs/2026-05-22_mojollama-opt-session.md # 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 / .hermes / debug-logs / 2026-05-22_mojollama-opt-session.md` 32 lines ยท 1520 bytes Raw Blame History Source # Debug Log: 2026-05-22 ## Goal: MojoLlama beats llama.cpp on every model ## Progress ### Baselines (post-optimizations) Model MojoLlama llama.cpp Ratio Notes Qwen3.6-35B Q4_K_M 19.6 tok/s 16.23 121% ๐Ÿ† Python engine, fused SSM path GPT-OSS-20B Q4_K_M 23.6 tok/s 27.53 86% โŒ Behind โ€” needs C batch forward Qwen3-30B Q4_K_M 22.6 tok/s 27.81 81% โŒ Behind โ€” needs C batch forward ### Changes Applied - `batch_matmul()` โ†’ `quant_matmul_omp()` โ€” C matmul dispatch now uses Q8_0 activation VPMADDUBSW - `ssm_layer_fused()` โ€” new C function fusing SSM decode + gate + element_mul + out + residual - `qwen36_batch_forward()` โ€” full C batch forward (370 lines, implemented by OpenCode) - `forward_c_batch()` + `_init_c_batch_caches()` โ€” Python wrapper for C forward ### Working - Fused SSM path in Python engine (saves 3 ctypes calls per SSM layer) - All models load correctly, C batch caches init cleanly - Non-Qwen3.6 models gracefully disable C batch ### Not Working - `forward_c_batch()` segfaults on Qwen3.6 โ€” C function has bug (likely pointer/param mismatch) - C batch forward needs debugging before it can replace Python loop ### Next Steps - Debug qwen36_batch_forward C function (param passing, buffer sizes, pointer alignment) - Fix GPT-OSS gap โ€” separate Q/K/V weights, no fused QKV, needs different C path - Fix Qwen3-30B gap โ€” MoE bottleneck, 288 OMP regions/layer saturates cores - Batch B=4 concurrency