ulmentflam / llm.mojo
GPT-2 training in pure Mojo with hand-written CUDA and Metal GPU kernels. llm.c parity in bf16 on NVIDIA, 1.72x faster than PyTorch MPS on Apple Silicon.
Over time
2026-05-31 to 2026-11-02; peak 63,872 lines
2026-05-31 to 2026-11-02; 406 commits, counted up by commit date
- Opened 3
- Closed or merged 3
2026-07-14 to 2026-10-31; 3 issues and pull requests opened (0 issues, 3 pull requests), from GitHub by mojo_issues
Dependencies
Depends on lyffseba/mlx, Mosaad-M/requests.
Declared in its manifests at HEAD (toolchain left out): datasets, matplotlib, mlx, muon-optimizer, numpy, pre-commit, pyrefly, pytest, pytest-xdist, python, pytorch, pytorch-gpu, requests, tiktoken, torch, tqdm, transformers.
Similar repos
| Repo | Description | Similarity |
|---|---|---|
| mojolearn/mojolearn | GPU machine learning in Mojo that supports bitwise identical inference and training on Apple Metal, NVIDIA CUDA and AMD HIP. | 88% |
| mikeleppane/llm.mojo | A GPT-2, built from scratch in Mojo — tokenizer to trained weights, no ML framework, every FLOP tested and explained. | 87% |
| attilio-castano/llm-mojo | LLM inference from first principles in Mojo on Apple Silicon: GPU kernels, a serving engine, reproducible studies, and compile-time correctness checks. | 87% |
| SergiuDeveloper/mojo-tensor | A GPU-accelerated deep learning framework written in Mojo. Provides tensors, automatic differentiation, and neural network layers with explicit GPU kernel implementations. | 86% |
| michael-lehn/mojo-gemm | DGEMM in Mojo with NEON and SME2 micro kernels, benchmarked on Apple M5 | 85% |
By the cosine of the embeddings of each repo's name, description and topics: bge-small-en-v1.5 at bbddccb7, from snapshot 3454761910736014829 of mojo.repo_embeddings, which mojo_embed writes.
Stars per month
- stars
- forks
1 stars over the months of GH Archive loaded so far (47; months in between aren't loaded yet), counted from its events.
Contributors per month
- contributors
- new
3 people authored or co-authored its commits (every commit reachable from HEAD, Co-authored-by trailers included, bots left out), counted by email.
Releases and tags
No published release in the GH Archive days loaded, and no git tag in the clone.
Issues and pull requests
0 open and 0 closed issues; 0 open, 0 merged and 3 closed pull requests, from GitHub by mojo_issues.
Pull requests
| # | Title | Opened | State | Comments |
|---|---|---|---|---|
| 3 | Fix encoder CPU dwte bucket width | 2026-08-03 | closed | 2 |
| 2 | Configure Renovate | 2026-07-26 | closed | 1 |
| 1 | Add linux-64 platform so make install works on x86_64 hosts | 2026-07-14 | closed | 1 |
Migrations
| Date | What | From | To | Commit |
|---|---|---|---|---|
| 2026-05-31 | mojo_version | – | 1.0.0 | 8df6eb9c24 |
| 2026-05-31 | tooling | none | pixi | 8df6eb9c24 |
| 2026-09-28 | mojo_version | 1.0.0 | 1.1.0 | 30c1dee9e3 |
| 2026-10-22 | mojo_version | 1.1.0 | 1.2.0 | c17e37ae7c |
Commits
Commit types: Feature 17% · Fix 8% · Mojo version 0% · Migration 4% · Refactor 2% · Docs 28% · Tests 7% · Build and chores 6% · Merge 11% · Other 17%
| Date | Commit | Type | Subject | Lines of Mojo | Tooling | Mojo version |
|---|---|---|---|---|---|---|
| 2026-11-02 | 4446eec0ae | Docs | README: the headline repo's history is squashed, but old commit IDs still resolve | 63,872 | pixi | 1.2.0 |
| 2026-11-02 | a0c8dd15d2 | Fix | test_zero_untied: derive the ownership test's AdamW ranges for -D LLMM_ROTARY=1 instead of refusing to compile | 63,872 | pixi | 1.2.0 |
| 2026-11-02 | a15da14b2a | Other | figure_adoption_headline: stop two panel labels clipping and overlapping | 63,872 | pixi | 1.2.0 |
| 2026-11-02 | 2fab58b578 | Fix +docs | Correct the headline comparison: a second AdamW run reaches 3.2784 on the same val | 63,872 | pixi | 1.2.0 |
| 2026-11-02 | f2063e96ae | Docs | docs: record the gate results and the re-export check for the review-fix commit (test_zero_untied does not compile under -D LLMM_ROTARY=1 by design, same as before the fix) | 63,872 | pixi | 1.2.0 |
| 2026-11-02 | bd8f584104 | Other +tests | Review fixes for the QK-norm flag and safetensors export: infer_gpt2 exited 1 on a legacy-magic (20240326) pretrained .bin because its pre-constructor flag peek used the strict magic check (now the co | 63,872 | pixi | 1.2.0 |
| 2026-11-02 | 8258dfa4fd | Fix | test_checkpointing: pin ARCH_FLAGS/STATE_ARCH_FLAGS to the -D defines with literals; the mismatch sweep alone passed with the QK-norm bit dropped from the build's word (mutant: ARCH_FLAGS without QK_N | 63,500 | pixi | 1.2.0 |
| 2026-11-02 | a4fb42ae99 | Feature +docs | Safetensors export for rotary + QK-norm checkpoints: model_type llm_mojo_gpt2 so transformers refuses it instead of loading it as stock GPT-2 | 63,476 | pixi | 1.2.0 |
| 2026-11-02 | 2ff99b61b4 | Tests | Record QK-norm as bit 2 of the checkpoint flags word: a build without -D LLMM_QK_NORM=1 silently loaded a QK-norm checkpoint and computed the wrong model | 63,273 | pixi | 1.2.0 |
| 2026-11-02 | c714346342 | Docs | README: link the headline checkpoint on Hugging Face | 63,135 | pixi | 1.2.0 |
| 2026-11-02 | 23a7ab8476 | Merge +docs | Merge branch 'mn/reshead': headline result, recipe passes AdamW's final val at 2.88B tokens | 63,135 | pixi | 1.2.0 |
| 2026-10-31 | 6a712bae02 | Docs | docs: correct the combined recipe's step-time cost and the softmax cause after W10 verification | 63,135 | pixi | 1.2.0 |
| 2026-10-31 | fdb52620b0 | Fix | test_qk_rotary_fused: add a bf16 GPU case against the float64 model, since every fused-kernel case was fp32 while training runs bf16 (0.03 tolerance is two ulps of the largest outputs; the forward-rot | 63,134 | pixi | 1.2.0 |
| 2026-10-31 | 715881147b | Docs | W10 doc: profile of the combined-recipe step cost (row passes ~45 ms/step idle, softmax +44 ms/step), fused-kernel design, gates, mutants | 63,089 | pixi | 1.2.0 |
| 2026-10-31 | ae97fe0827 | Fix +tests | Fuse rotary into the QK-norm row kernels: one pass per direction over head-layout q/k | 63,089 | pixi | 1.2.0 |
| 2026-10-31 | 21a2e4c086 | Merge +docs | Merge branch 'mn/results2': three-seed confirmation of the combined recipe, headline-run design | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 6b8ed59daa | Merge +docs | Merge branch 'mn/results': modded-nanogpt adoption campaign report, figures and log collection | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 3646f63e0c | Docs | docs: clean gelu-vs-relu2 step-time measurement in the adoption plan (+3.2% for relu2) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | a7ec37e632 | Docs | docs: W3 600-step cosine-vs-cooldown pair in the adoption plan (val@600 4.3470 vs 4.2541) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 47265b11fc | Docs | docs: W9 untie-at-two-thirds ranking result in the adoption plan (val@300 5.0351 vs tied 5.0347) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 9cd6d6978e | Docs | docs: W9 untied + low head rate ranking result in the adoption plan (val@300 5.5097) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 3a97f9cd5b | Docs | docs: W9 untied-from-scratch ranking result in the adoption plan (val@300 5.1503 vs tied 5.0347) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | d74c9f3ae3 | Docs | docs: W5 small-init ranking result in the adoption plan (val@300 5.0274) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 9c79cbbdb4 | Docs | docs: W3 warmup-50 ranking result in the adoption plan (val@300 4.8017 vs zero-warmup 4.7588) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 684e05fbec | Docs | docs: W3 0.45-cooldown ranking result in the adoption plan (val@300 4.7675) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 5cbd4b09fd | Docs | docs: W5+W6 zero-init+ReLU^2 ranking result in the adoption plan (val@300 5.0088) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 8f4c91a955 | Docs | docs: W7 QK-norm 0.12-scale ranking result in the adoption plan (val@300 4.9790) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | bbdd82c8ce | Docs | docs: W3 WSD linear-cooldown ranking result in the adoption plan (val@300 4.7588 vs base 5.0347) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | afbebb938e | Docs | docs: W5 zero-init ranking result in the adoption plan (val@300 5.0436 vs base 5.0347) | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | f8824645c1 | Merge +tests +docs | Merge branch 'mn/w9': untied LM head behind -D LLMM_UNTIED_HEAD=1, with -l_head and -untie_at | 62,411 | pixi | 1.2.0 |
| 2026-10-31 | 2f5c599194 | Docs | docs: W6 ReLU^2 ranking result in the adoption plan (val@300 5.0184 vs base 5.0347) | 59,567 | pixi | 1.2.0 |
| 2026-10-31 | 45caec9299 | Docs | docs: W7 QK-norm ranking result in the adoption plan (val@300 4.9657 vs base 5.0347) | 59,567 | pixi | 1.2.0 |
| 2026-10-31 | d8be93e6f1 | Docs | docs: W8 rotary ranking result in the adoption plan (val@300 4.8031 vs base 5.0347) | 59,567 | pixi | 1.2.0 |
| 2026-10-31 | 7c8ba22e85 | Docs | docs: W2 ranking results in the adoption plan (momentum warmup, val@300) | 59,567 | pixi | 1.2.0 |
| 2026-10-31 | f34c8d84a4 | Feature | Add Muon-vs-AdamW result figure (val loss at 600 steps x 3 seeds, 2000 steps, lr sweep), embedded in README and campaign doc; regenerate with make figure-muon (renders committed logs, no GPU) | 59,567 | pixi | 1.2.0 |
| 2026-10-31 | 841ea95c3f | Merge +tests +docs | Merge branch 'mn/w7': QK-norm and fixed attention scale behind -D LLMM_QK_NORM=1 / -attn_scale | 59,567 | pixi | 1.2.0 |
| 2026-10-30 | 78c0806da8 | Merge +tests +docs | Merge branch 'mn/w56': zero-init residual projections and ReLU^2 behind build flags | 59,015 | pixi | 1.2.0 |
| 2026-10-30 | 96364b824a | Docs | docs: W1 ranking results in the adoption plan (AdamW-range lr ladder, val@300) | 58,683 | pixi | 1.2.0 |
| 2026-10-30 | aeabaf4efa | Merge +tests +docs | Merge branch 'mn/w8': rotary position embeddings behind -D LLMM_ROTARY=1 | 58,683 | pixi | 1.2.0 |
| 2026-10-30 | a4db4d5a80 | Merge | Merge branch 'main' into fu/seedsv | 57,958 | pixi | 1.2.0 |
| 2026-10-30 | f02fe5626c | Docs | docs: Muon vs AdamW write-up re-verified against the committed logs; step-time and caveat corrections | 57,955 | pixi | 1.2.0 |
| 2026-10-30 | 35078dc19f | Merge | Merge branch 'fu/seeds' into fu/seedsv | 57,955 | pixi | 1.2.0 |
| 2026-10-30 | 6f75a00c9e | Docs | README: 2000-step Muon vs AdamW result (4.226 / 4.005 / 3.804 at step 2000) | 57,955 | pixi | 1.2.0 |
| 2026-10-30 | 1353df8021 | Merge +tests | Merge branch 'mn/w2': Muon momentum warmup (-mu_start, -mu_warmup) | 57,955 | pixi | 1.2.0 |
| 2026-10-30 | af6cad64f0 | Merge +tests | Merge branch 'mn/w3': WSD scheduler cooldown fraction, linear decay shape, zero warmup | 57,755 | pixi | 1.2.0 |
| 2026-10-30 | 7b36b40f16 | Merge +tests | Merge branch 'mn/w1': -l_adam multiplier for the AdamW ranges under Muon | 57,574 | pixi | 1.2.0 |
| 2026-10-30 | fe3312a8ca | Docs | docs: modded-nanogpt adoption plan for the Muon track (W1-W9 work items) | 57,253 | pixi | 1.2.0 |
| 2026-10-30 | a2c2282ef3 | Docs | README: Muon vs AdamW results table for the 600-step three-seed runs | 57,253 | pixi | 1.2.0 |
| 2026-10-30 | fa4b8b48d2 | Merge | Merge branch 'fu/seeds' | 57,253 | pixi | 1.2.0 |
| 2026-10-30 | 24884b77d5 | Docs | docs: S7 trim and the resume-race fix are landed, not in progress | 57,252 | pixi | 1.2.0 |
The latest 50 of 406 commits; all of them are in the JSON.