Skip to content

Pantelis23/MLRift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

336 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLRift

A systems language for machine-learning workloads — built on KernRift at commit 6cf758b (v2.8.15). The compiler's own source is KernRift; MLRift extends the KRIR backend with ML-specific primitives (tensors, event streams, continuous-time dynamics, sparse CSR ops, plasticity rules) and will introduce a .mlr frontend for user programs as the roadmap lands.

Status: day zero. The rename pass is done (product identity is MLRift, binary is mlrc, bootstrap binary is build/mlrc), 436/436 tests pass, self-host fixed point holds. The MLRift-specific syntax and IR extensions are not started yet — those follow the roadmap in ~/Desktop/Projects/Work/ideas/MLRift.md.

What works today

Real LLM inference is already running end-to-end through the existing KernRift compiler + a small ML stdlib (std/qwen3.mlr, std/matmul.mlr, std/tokenizer.mlr, std/gguf.mlr) — no external runtime, no Python.

Model Quant tok/s vs PyTorch BF16 Peak RSS
Qwen3-0.6B bf16 (HF safetensors) 32.03 1.24× 1.67 GB
Qwen3-0.6B bf16 (GGUF) 32.27 1.25× 1.67 GB
Qwen3-14B Q8_0 (GGUF) 0.479 3.63× 14.81 GB

7900X / 16 threads / greedy decode / use_cache. First 10 generated tokens are bit-identical to HuggingFace transformers.generate across both sizes (token-id check, not a fuzzy text match). Methodology

  • commit-by-commit perf history:
  • docs/BENCH_QWEN3.md — Qwen3-0.6B (78× from scalar baseline, 3.27× vs PyTorch F32, full per-op breakdown).
  • docs/BENCH_QWEN3_14B.md — Qwen3-14B Q8_0 vs PyTorch BF16 (3.63× decode, 1.37× less peak RSS, 5-token prompt → 20-token greedy continuation).

Build

make build    # self-compiles build/mlrc (bootstrap committed)
make test     # 436/436
make bootstrap   # verify stage3 == stage4
mlrc --version

Why "built on KernRift"

MLRift is explicitly a layer on top of KernRift, not a hard fork. It shares the type system, the optimization pipeline, the codegen backends (x86_64 + ARM64, Linux/macOS/Windows/Android), and all the infrastructure KernRift spent the last year hardening. MLRift-specific work lives in added passes, added IR ops, and a new frontend — not in re-implementing the basics. When KernRift fixes a backend bug, MLRift inherits it with a cherry-pick.

License

Same as KernRift — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors