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