Two machines, one AI conversation, bit for bit: lockstep LLM NPCs on a laptop GPU and an H100
On the left: my laptop's RTX 3050 Ti, a 4 GB consumer GPU. On the right: an NVIDIA H100 in a server. Both run the same open model (OLMoE-1B-7B) with random sampling at temperature 0.8, playing Brannoc, a gruff village bl
On the left: my laptop's RTX 3050 Ti, a 4 GB consumer GPU. On the right: an NVIDIA H100 in a server. Both run the same open model (OLMoE-1B-7B) with random sampling at temperature 0.8, playing Brannoc, a gruff village blacksmith, across ten turns of dialogue. Every turn, each machine prints a hash of every token it generated and every logit the model computed along the way.
The hashes match on every turn. Not "the text looks the same": every bit of every intermediate number is identical.
Why that is normally impossible
The same model on two different GPUs usually gives different answers. Floating-point addition is not associative, and every chip, driver and library sums things in its own order with its own fused instructions. The differences start in the last bit and grow; with sampling, one different token sends the whole conversation somewhere else.
That breaks things people want to build:
- Lockstep multiplayer games. Strategy and fighting games send only player inputs and let every client simulate the world itself, so every client must compute exactly the same thing. An LLM character can't take part if each player's GPU makes it say something different.
- Benchmarks. The same model and the same harness give different scores on different machines.
- Verification. You can't check that a provider ran the model it claims by re-running it, because your re-run won't match anyway.
How Vahana does it
Vahana is an open-source inference engine for Mixture-of-Experts models. It computes every operation with one fixed arithmetic on every CPU and GPU it supports (fixed summation order, fixed rounding points), and samples with an exact sampler built from basic IEEE operations and a SHA-256 counter. The result is a pure function of (weights, prompt, settings): the same bits on any machine.
In the demo, each turn's sampling seed comes from the game state (the turn number and the player's line), the way a lockstep game would derive it. Each machine then generates the NPC's answer on its own.
What I measured (Vahana 1.5.0, installed from PyPI)
- Laptop GPU vs laptop CPU: in lockstep for all 10 turns.
- Laptop GPU vs H100: in lockstep for all 10 turns.
- Desync detection: a player whose seed differs at turn 4 is caught at turn 4 exactly. The NPC's line there differs ("I haven't heard of anyone being attacked, but I can't promise nothing." against "They are. The roads to the capital are safe.").
The same property holds beyond games. This week, on the same laptop and the same H100:
- Logprobs: the probability of every generated token and the top-5 alternatives are identical on the laptop CPU, the laptop GPU, the server CPU and the H100, for six model families. That matters for training models with reinforcement learning, where a mismatch between the engine that samples and the trainer that scores can make training collapse.
- Evaluations: lm-evaluation-harness, unmodified, run against Vahana's OpenAI-compatible server gives the same answer to every question (200 ARC-Easy questions, 30 GSM8K math problems with generated solutions) on the laptop CPU, the laptop GPU, the laptop GPU with 4 concurrent requests, and the H100. The H100 just does it about 18 times faster.
Try it
pip install "vahana[gpu]" # omit [gpu] without an NVIDIA GPU
vahana pull allenai/OLMoE-1B-7B-0924
python examples/lockstep_npc.py models/OLMoE-1B-7B-0924 --device cuda --out gpu.jsonl
python examples/lockstep_npc.py models/OLMoE-1B-7B-0924 --device cpu --out cpu.jsonl
python examples/lockstep_npc.py --compare gpu.jsonl cpu.jsonl
(The example script is in the repository; run it on two different machines and compare the two files.)
Limits
Latency: a 7B-parameter Mixture-of-Experts model answers in seconds on a laptop, which is fine for an NPC that talks between turns and too slow for one that talks every frame. Smaller models fit tighter budgets, and the same exactness applies to all of them.
Everything here is reproducible from the repository: the logs behind the GIF, the scripts and the results are in experiments/ (i4_lockstep, d6_eval, d8_logprobs).
Code (Apache-2.0): https://github.com/vahana-ai/Vahana
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.