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.

  1. Segment 1

    Steps 1 to 1,000

    Route A

    2 × NVIDIA H100

    1,000 steps
    equal bits

    Route B

    1 × AMD MI325X

  2. Segment 2

    Steps 1,001 to 2,000

    Route A

    2 × NVIDIA H100

    1,000 steps
    equal bits

    Route B

    2 × AMD MI300X

  3. Segment 3

    Steps 2,001 to 2,400

    Route A

    1 × NVIDIA H100 + 1 × AMD MI325X

    Joint training, separate machines

    400 steps
    equal bits

    Route B

    1 × NVIDIA H100

  4. Segment 4

    Steps 2,401 to 3,900

    Route A

    2 × AMD MI300X

    1,500 steps
    equal bits

    Route B

    2 × NVIDIA H100

  5. Segment 5

    Steps 3,901 to 4,900

    Route A

    2 × NVIDIA H100

    1,000 steps
    equal bits

    Route B

    2 × AMD MI300X

  6. Segment 6

    Steps 4,901 to 5,000

    Route A

    1 × Apple M3 Ultra

    100 steps
    equal bits

    Route B

    1 × NVIDIA L40S

Same initialization. 5,000 matching updates. Identical final checkpoint files.

Show the routes as a table
Hardware and matching steps for every segment of the two training routes
SegmentStepsRoute ARoute BMatching steps
11 to 1,0002 × NVIDIA H1001 × AMD MI325X1,000
21,001 to 2,0002 × NVIDIA H1002 × AMD MI300X1,000
32,001 to 2,4001 × NVIDIA H100 + 1 × AMD MI325X (joint training)1 × NVIDIA H100400
42,401 to 3,9002 × AMD MI300X2 × NVIDIA H1001,500
53,901 to 4,9002 × NVIDIA H1002 × AMD MI300X1,000
64,901 to 5,0001 × Apple M3 Ultra1 × NVIDIA L40S100
Adapted from the paper’s training-route figure. Segment widths do not represent steps or elapsed time. Source Released model, checkpoints and evidence.

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.