Mojolearn
Reproduce the model. Reproduce the prediction.
I spent fourteen years in finance, so I understand the importance of meeting regulatory requirements. Reproducing machine-learning results on GPUs can be challenging: the same workload can produce different bits on NVIDIA and AMD hardware, and a small rounding difference can change a prediction or compound over subsequent training steps.
I built mojolearn, an open-source machine-learning library in Mojo that makes results reproducible down to the bits across GPU vendors. To my knowledge, it is the first AI library to produce bitwise identical training and inference across GPU vendors. It covers over 100 algorithms and model components in 13 families, from tree ensembles to transformers and hybrid attention and state space models. I write it myself and fund it myself.
To test it, I trained a 162-million-parameter language model twice, along different routes through NVIDIA, AMD and Apple hardware.
The training experiment
Two hardware routes. The same bits at every step.
162,147,840 parameters and 2.62 billion tokens per route. Each route resumes its checkpoint on the next segment’s hardware.
Segment 1
Steps 1 to 1,000
Route A2 × NVIDIA H100
1,000 steps
equal bitsRoute B1 × AMD MI325X
Segment 2
Steps 1,001 to 2,000
Route A2 × NVIDIA H100
1,000 steps
equal bitsRoute B2 × AMD MI300X
Segment 3
Steps 2,001 to 2,400
Route A1 × NVIDIA H100 + 1 × AMD MI325X
Joint training, separate machines400 steps
equal bitsRoute B1 × NVIDIA H100
Segment 4
Steps 2,401 to 3,900
Route A2 × AMD MI300X
1,500 steps
equal bitsRoute B2 × NVIDIA H100
Segment 5
Steps 3,901 to 4,900
Route A2 × NVIDIA H100
1,000 steps
equal bitsRoute B2 × AMD MI300X
Segment 6
Steps 4,901 to 5,000
Route A1 × Apple M3 Ultra
100 steps
equal bitsRoute B1 × NVIDIA L40S
Same initialization. 5,000 matching updates. Identical final checkpoint files.
Show the routes as a table
| Segment | Steps | Route A | Route B | Matching steps |
|---|---|---|---|---|
| 1 | 1 to 1,000 | 2 × NVIDIA H100 | 1 × AMD MI325X | 1,000 |
| 2 | 1,001 to 2,000 | 2 × NVIDIA H100 | 2 × AMD MI300X | 1,000 |
| 3 | 2,001 to 2,400 | 1 × NVIDIA H100 + 1 × AMD MI325X (joint training) | 1 × NVIDIA H100 | 400 |
| 4 | 2,401 to 3,900 | 2 × AMD MI300X | 2 × NVIDIA H100 | 1,500 |
| 5 | 3,901 to 4,900 | 2 × NVIDIA H100 | 2 × AMD MI300X | 1,000 |
| 6 | 4,901 to 5,000 | 1 × Apple M3 Ultra | 1 × NVIDIA L40S | 100 |
The applications, measurements, paper and install instructions are at mojolearn.org. If exact agreement would matter for your work, or you’d like to talk about the project,send me a note.