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 / src / mojollama / moe-plan.md

69 lines · 3178 bytes Raw Blame History Source

MojoLlama MoE Engine: Implementation Plan

Goal

Add MoE (Mixture of Experts) support to the C inference engine so GPT-OSS-20B and Qwen3-30B-A3B run at llama.cpp-level performance.

Current Engine

Architecture: GPT-OSS-20B

File: /tmp/models/gpt-oss-20b-Q4_K_M.gguf (11GB)

Architecture: Qwen3-30B-A3B

File: /tmp/models/Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf (18GB)

Implementation Tasks (priority order)

1. Add K-quant matmul support

Current engine only has q4_0_batch_matmul and q8_0_batch_matmul. Need:

2. Add bias support to attention

Current engine has no bias. GPT-OSS attn_q/k/v/output all have bias.

3. Add packed-expert MoE FFN

4. Add Qwen3 shared expert

5. Update Python weight loading

Files to modify

Test & Verification

  1. Single-token forward match with llama.cpp output
  2. Multi-token generation
  3. Batch generation
  4. Benchmark: should match llama.cpp tok/s within 15%