Skip to content

Hardware Benchmarks

Full MLP benchmark source is in examples/benchmark.rs with the side-by-side runner in benchmark.sh. Run with cargo run --release --example benchmark.

MLP Reference Benchmark

All frameworks train the same 1-1024-1024-1 tanh network for 200 full-batch steps on 2,048 points of sin(x) in f32, reporting the median of 5 runs after 1 warm-up with identical initial weights and matching convergence (0.3586 -> 0.0133 for full-rank SGD, 0.3586 -> 0.0098 for efficient_grad).

  • ./benchmark.sh directly reproduces Jacobi, JAX, PyTorch (both eager and torch.compile), and MLX on the same machine with 4-decimal formatting for sub-second timings.
  • On Apple Silicon, Jacobi uses native AMX/SME2 CPU kernels and native Metal GPU shaders; on CUDA, ROCm, TPU, and x86/ARM CPUs, Jacobi compiles via XLA/PJRT.
  • N/A marks unsupported or unmeasured backends (jax-metal on JAX 0.12, mlx-cuda-13 on B300 sm_103).
Framework Nvidia B300 Nvidia B300 CPU Nvidia B200 Nvidia B200 CPU Apple M5 Max GPU Apple M5 Max CPU
Jacobi 0.1.0 (jit + for_loop) 0.0139s 2.98s 0.0171s 2.66s 0.14s 1.13s
Jacobi 0.1.0 (efficient_grad, rank 32) 0.0221s 3.38s 0.0251s 2.97s 0.30s 1.22s
JAX 0.12.1 (jax.jit + fori_loop) 0.0147s 3.31s 0.0175s 2.67s N/A 1.22s
PyTorch (eager) 0.0856s 24.29s 0.1042s 2.73s 0.31s 2.23s
PyTorch (torch.compile) N/A N/A N/A N/A 0.31s 2.30s
MLX 0.32.5 N/A N/A N/A N/A 0.15s 3.86s

At 2,000 steps on Nvidia B200 (0.3586 -> 0.0006), Jacobi runs in 0.1682s and JAX runs in 0.1716s.

Architecture Benchmarks (4,096 Context, PleIAs/SYNTH Cross-Entropy & Rollout)

All rows below were measured on random-weight architecture replicas using live PleIAs/SYNTH next-token cross-entropy (nn::chunked_cross_entropy / nn::chunked_cross_entropy_tn, without HuggingFace checkpoint weight-parity checks). Examples are gemma4_e4b.rs, inkling_mini_2_26b.rs, and deepseek_v4_flash.rs.

Methodology notes:

  • Cluster Peak RAM: reported as device-0 peak HBM x GPU count for symmetric SPMD shards.
  • FP8 weight updates (Fp8UpdateMode): All optimizers (Sgd, RMSprop, Adam, AdamW, Muon, EfficientAdamW) support MasterF32 (+4 B/param, default), MasterBf16 (+2 B/param), and StochasticRounding (0 extra HBM bytes/param, unbiased). The large-scale FP8 rows below use StochasticRounding (--fp8-mode sr).
  • Low-rank gradients (EfficientAdamW): DeepSeek-V4-Flash 283B training uses rank-32 EfficientAdamW::value_and_grad_hybrid (update_proj_gap=50), cutting optimizer state from 160.97 GB/GPU to 1.59 GB/GPU (99.0% saved, apples-to-apples for StochasticRounding) so 283B fits on 16x H200. Gemma-4-E4B and Inkling-2-Mini headline training rows use full-rank AdamW.
  • Batched Rollout: measured as global_rollout_batch * rollout_len / median_wall_seconds including 4,096-token FlashAttention prompt prefill + 1,024 autoregressive generated tokens using nn::RolloutKvCache::new_sliding_window (window=512), F8E4M3FN KV storage, single-op 5D in-place dynamic_update_slice, and nn::sage_attention (per-head K-smoothing + GQA/MQA collapse + native FP8 Q @ K^T).
  • 1T-token cost estimates: use $5.00/GPU-hr (B200) and $3.50/GPU-hr (H200).
Model Hardware Parallelism Mode Precision Batch Peak RAM (dev0 x N) Throughput 15-Step CE Loss Cost / 1T
Gemma-4-E4B (7.4B) 1x B200 180GB Single GPU Forward (4k) FP8 16 21.59 GB 154,127.0 tok/s N/A $9.0k
Gemma-4-E4B (7.4B) 1x B200 180GB Single GPU Train (Full AdamW, ckpt=10, 4k) FP8 8 155.07 GB 35,020.9 tok/s 12.83 -> 8.85 $39.7k
Gemma-4-E4B (7.4B) 1x B200 180GB Single GPU Train (Full AdamW, ckpt=42, 4k) FP8 16 84.31 GB 33,666.2 tok/s 12.84 -> 9.01 $41.3k
Gemma-4-E4B (7.4B) 1x B200 180GB Single GPU Train (rank-32 EfficientAdamW, ckpt=0, 4k) FP8 8 154.46 GB 32,915.7 tok/s 12.83 -> 10.48 $42.2k
Gemma-4-E4B (7.4B) 1x B200 180GB Single GPU Rollout (Sage + SW-512, 4k->1k, 32x16) FP8 512 20.17 GB 30,998.7 tok/s N/A $44.8k
Gemma-4-E4B (7.4B) 1x B200 180GB Single GPU Rollout (Sage + SW-512, 4k->1k, 64x1) FP8 64 31.88 GB 8,111.7 tok/s N/A $171.2k
Inkling-2-Mini (26B) 8x H200 141GB Expert Parallel Forward (4k) FP8 192 210.00 GB 356,043.9 tok/s N/A $21.8k
Inkling-2-Mini (26B) 8x H200 141GB Expert Parallel Train (Full AdamW, cf=1.00, ckpt=42, 4k) FP8 192 1,015.44 GB 105,419.8 tok/s 12.66 -> 8.32 $73.8k
Inkling-2-Mini (26B) 8x H200 141GB Expert Parallel Train (rank-32 EfficientAdamW, cf=1.00, ckpt=42, 4k) FP8 192 983.12 GB 102,142.6 tok/s 12.66 -> 10.92 $76.1k
Inkling-2-Mini (26B) 8x H200 141GB Expert Parallel Rollout (Sage + SW-512, 4k->1k, 128x16) FP8 2,048 149.76 GB 63,084.2 tok/s N/A $123.3k
Inkling-2-Mini (26B) 8x H200 141GB Expert Parallel Rollout (Sage + SW-512, 4k->1k, 256x1) FP8 256 160.64 GB 11,727.1 tok/s N/A $663.2k
DeepSeek-V4-Flash (283B) 16x H200 141GB Data + Expert Parallel Forward (4k) FP8 64 743.84 GB 217,233.5 tok/s N/A $71.6k
DeepSeek-V4-Flash (283B) 16x H200 141GB Data + Expert Parallel Train (rank-32 EfficientAdamW, cf=1.00, 4k) FP8 80 2,115.04 GB 52,965.7 tok/s 12.57 -> 10.62 $293.7k
DeepSeek-V4-Flash (283B) 16x H200 141GB Data + Expert Parallel Train (rank-32 EfficientAdamW, cf=1.00, 4k) FP8 64 1,974.24 GB 51,830.4 tok/s 12.61 -> 10.68 $300.1k
DeepSeek-V4-Flash (283B) 16x H200 141GB Data + Expert Parallel Train (Full AdamW, EP=16, 4k) FP8 16 (min) OOM (>2,256 GB) OOM N/A N/A
DeepSeek-V4-Flash (283B) 16x H200 141GB Data + Expert Parallel Rollout (Sage + SW-512, 4k->1k, 128x16) FP8 2,048 796.80 GB 42,923.5 tok/s N/A $362.4k
DeepSeek-V4-Flash (283B) 16x H200 141GB Data + Expert Parallel Rollout (Sage + SW-512, 4k->1k, 128x1) FP8 128 796.80 GB 2,995.0 tok/s N/A $5,193.8k

Multi-Node RDMA Full vs Efficient AdamW Comparison (DeepSeek-V4-Flash)

On full 43-layer DeepSeek-V4-Flash (283B), full AdamW optimizer state alone is 160.97 GB/GPU (> 141 GB H200 HBM), whereas rank-32 EfficientAdamW uses 1.59 GB/GPU (99.0% saved). To compare full AdamW and rank-32 EfficientAdamW head-to-head on identical PleIAs/SYNTH batches across 2 RDMA nodes (16x H200, DP=2 x EP=8), we also ran a 16-layer (105.83B) slice at batch=64, seq=4096:

Optimizer (DeepSeek-V4-Flash 16L / 106B, 16x H200) Optimizer State / GPU Peak HBM / GPU Throughput 15-Step CE Loss
Full AdamW (FP8 SR) 62.56 GB 120.00 GB 57,865.1 tok/s 12.59 -> 8.15
Rank-32 EfficientAdamW (gap=50, scale=2.5, FP8 SR) 0.60 GB (99.0% saved) 58.88 GB 140,017.7 tok/s (2.42x) 12.59 -> 7.76

Running the Benchmarks

cargo run --release --example benchmark

# Side-by-side comparison against Python JAX, PyTorch (eager + torch.compile), and MLX
./benchmark.sh

# Batched RL rollout on Gemma-4-E4B, Inkling-2-Mini, or DeepSeek-V4-Flash
cargo run --release --example gemma4_e4b -- --fp8 --skip-fwd --rollout --batch 512 --prompt-len 128 --rollout-len 256 --window 512