The same bits everywhere

Two runs of an ordinary model on two machines rarely agree to the bit. A Laplace model is built so that they always do.

What it takes to answer the same way twice

  1. 1

    Integer weights

    When a model is compiled, its weights are quantized to integers. A run holds no floating point at all, so there is no rounding for two chips to do differently.

  2. 2

    Integer operators

    Every operator a model uses (a matrix product, a normalization, a softmax, a lookup) is written in integer arithmetic. The same inputs give the same outputs, to the bit.

  3. 3

    A fixed order

    A run is a fixed list of steps, each one a bounded slice of one operator. They are executed one after another, in the same order on every machine. Nothing is scheduled, batched or raced.

  4. 4

    A seeded sampler

    Where a model samples, it draws from a generator seeded by the seed on the receipt, so the same input and seed give the same output. A model that answers with one label, like the two on the network, takes the highest score, and the seed changes nothing.

  5. 5

    One step function

    The function that executes a step is one Rust crate, laplace-vm. It is compiled natively for nodes, to WASM for a browser tab and to SBF inside the program on Solana. One source decides a step everywhere.

One step, three builds

Reading the network