interplane.Get Omega
Read in your language

MojoLlama

Archived Mojo/MAX quantizer and serving research repository (read-only history)

Brought by drakestapleton

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
141. `batch_matmul()` → `quant_matmul_omp()` — C matmul dispatch now uses Q8_0 activation VPMADDUBSW
152. `ssm_layer_fused()` — new C function fusing SSM decode + gate + element_mul + out + residual
163. `qwen36_batch_forward()` — full C batch forward (370 lines, implemented by OpenCode)
174. `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
291. Debug qwen36_batch_forward C function (param passing, buffer sizes, pointer alignment)
302. Fix GPT-OSS gap — separate Q/K/V weights, no fused QKV, needs different C path
313. Fix Qwen3-30B gap — MoE bottleneck, 288 OMP regions/layer saturates cores
324. Batch B=4 concurrency