Precision Is a Position: How Floating-Point Choices Move Portfolios, Backtests and Models
Precision settings change trading decisions without any warning. We measured how far common float32, TF32, fp16 and bf16 pipelines move minimum-variance weights, principal components, rolling risk, analog forecasts, trained models and option prices away from a float64 or exact reference, which of them give the same bits twice and on other machines, and how fast Riptorch's exact and reproducible paths are against PyTorch, FAISS, cuVS and CuPy on the same machines.
Abstract
A quant pipeline's numbers are only as good as the arithmetic underneath them. On 30 November and 1 December 2026 we ran four experiments on five NVIDIA GPU models (RTX 4090, H100 SXM, A100 SXM, A10G, L4) and three AWS CPUs (Intel Xeon 8488C, AMD EPYC 9R14, AWS Graviton4), comparing every result with a float64 or exact reference. Every input is synthetic and generated from a published seed: no third-party market data is used (version 2.0 replaces the exchange data of version 1 with synthetic series of the same shapes).
Portfolios (E2). One matmul precision setting moves a minimum-variance book. For 5,000 assets, the weights from a TF32 covariance differ from the exact weights by an L1 distance of 0.0129, 27% of the turnover a full day of new data causes. At 20,000 assets the gap is 0.0615, or 7.3 days of normal turnover (16 days on an RTX 4090). fp16 and bf16 make the weights unusable. PyTorch's default float32 moves them by 0.0029. Riptorch's exact covariance matched the exact covariance bit for bit on every entry (25 million at 5,000 assets, 400 million at 20,000), so its weights and principal components are the exact ones.
Rolling risk (E2). Over ten million one-minute steps, the textbook float32 prefix-sum variance is wrong by up to 330,000% and returns 4.5 million negative variances. Fixed-point int64 sums are exact to 10⁻¹¹ in any framework.
Regime search (E3). Over up to 50 million synthetic return windows, PyTorch fp16 returns the true top 10 in order for 802–835 of 1,024 queries and changes 18–22% of neighbour-weighted forecasts; bf16 changes 75–91%. Riptorch's exact search, measured against its own input data, changes none. On an RTX 4090 at 10M × 128 its int8 search is 1.24× PyTorch fp16, 2.6× float32, 3.2× cuVS and 6.0× FAISS; on an A10G it is 0.92× fp16 (a loss) and 2.8–5.4× the exact float baselines. At 2M × 256 it is 9.2× PyTorch float32 on an EPYC CPU, and at 50 million windows it uses 3.2–6.0× less GPU memory. int8, however, is too coarse for return windows; int16 keeps the raw order as well as float32 does.
Training (E1). Riptorch trains the same model to one SHA-256 on Intel, AMD and Arm CPUs, on two synthetic datasets, where PyTorch gives one result per CPU model. On NVIDIA GPUs its LSTM stays 0.6–1.2 × 10⁻⁶ from float64, against 1.65–1.66 × 10⁻³ for PyTorch's default on the RTX 4090 and H100 (cuDNN uses TF32 unless told not to). Training speed is mostly a loss.
Monte Carlo (E4). Every framework prices within 2.25 standard errors, and float32 arithmetic costs at most 0.51% of a standard error. The random stream is what differs between machines: a Riptorch 0.4.1 pre-release prices a European call to the same bits on two CPUs and two GPUs. It is 4.8× PyTorch on an EPYC CPU and slower on GPUs.
Riptorch is slower in several cases. Every case measured in these runs is listed in "Limitations and next steps", each with its cause where the cause was measured.
Why precision and reproducibility matter to a quant desk
- Backtests. A strategy backtest is a long chain of covariance estimates, rebalances and signals. If the chain depends on the precision setting, the device or the run, two researchers running the same backtest get different P&L, and nobody can tell skill from arithmetic.
- Risk. Minimum-variance and risk-parity weights come from inverting an ill-conditioned covariance matrix. In our 5,000-asset case its condition number was 1.9 × 10⁵, so an entry error of 6 × 10⁻⁵ in correlation units becomes a visible weight change. Rolling variances that go negative or are off by orders of magnitude feed straight into position limits and VaR.
- Turnover. Weight changes that come from arithmetic rather than information still trade, and still pay spread and impact. We express them in days of the turnover that genuinely new data causes.
- Audit and model risk. Regulators and internal model validation expect a result to be reproducible. "Same code, same data, same answer" has to hold across runs, machines and cloud instances, and that includes the random numbers behind a Monte Carlo price.
Methods
Machines
| machine | host CPU / instance | driver / CUDA | used for |
|---|---|---|---|
| NVIDIA RTX 4090 24 GB | sessions on Ryzen 9 9950X, Xeon Gold 6133, EPYC 7702, EPYC 75F3 and EPYC 7452 hosts | 595.112.07 / 13.2 driver, CUDA 12.9 user stack | E1–E4 |
| NVIDIA H100 80GB HBM3 (SXM) | Xeon Platinum 8470 and 8480+ hosts | 595.112.07 | E1–E4 |
| NVIDIA A100-SXM4-80GB | EPYC 7742 host | 595.112.07 | E1 |
| NVIDIA A10G 24 GB (1 Dec) | EC2 g5.xlarge (4 vCPU, 16 GB) | 620.70.06, CUDA 12.9 user stack | E1–E3 |
| NVIDIA L4 24 GB (1 Dec) | EC2 g6.xlarge (4 vCPU, 16 GB) | 620.70.06, CUDA 12.9 user stack | E1–E3 |
| Intel Xeon Platinum 8488C | EC2 c7i.4xlarge, 16 vCPU (30 Nov and 1 Dec) | – | E1–E4 |
| AMD EPYC 9R14 | EC2 c7a.4xlarge, 16 vCPU (30 Nov and 1 Dec) | – | E1–E4 |
| AWS Graviton4 (Neoverse V2) | EC2 c8g.4xlarge, 16 vCPU (30 Nov and 1 Dec) | – | E1–E4 |
Software and baselines
- Riptorch 0.4.0: the release wheel (x86-64 and aarch64), checked by SHA-256 on every machine. In E1, E3 and E4 Riptorch ran in its own process that never imports stock PyTorch; in E2 both libraries ran in one process (stock imported first), with methods interleaved round by round. Riptorch 0.4.0 is not yet published.
- Riptorch 0.4.1 pre-release: unreleased development builds, used only where a row says so, and never reported as 0.4.0. For E4 it is the build with the new counter-based random-number generator (merged for 0.4.1). Both may change before release.
- PyTorch 2.13.0+cu129 on GPUs. On CPUs it was 2.13.0+cpu, except the 30 November E2/E3 rows (2.15.0+cpu). Every PyTorch precision is named: float64, float32 (the default), TF32 (
torch.set_float32_matmul_precision("high"); TF32 is opt-in for matmuls:torch.backends.cuda.matmul.allow_tf32was False by default on both GPUs, while cuDNN's own TF32 flag is True by default), fp16 and bf16,torch.compile(mode="max-autotune"), andtorch.use_deterministic_algorithms(True). - FAISS 1.14.1 (
GpuIndexFlatIP,IndexFlatIP). The pip wheel has no H100 (sm_90) kernels, so FAISS GPU did not run on the H100. NVIDIA cuVS 26.10 (brute force). CuPy (CUDA 12) for Monte Carlo on GPUs. pandasrolling().var()and numba Welford loops for rolling statistics. - On GPUs every side used the same CUDA 12.9 libraries, and no CUDA 13 library was present.
Truth and repeats
- E2 covariance. The exact covariance of the stored integer returns comes from exact integer arithmetic. Eigenvectors and weights come from float64 eigensolvers and solves of that exact matrix. Rolling variance is checked against exact rational arithmetic at 2,019 window ends along the series.
- E3 search. There are two truths. The first is the float64 cosine of the very vectors each method received, with ties broken by the lowest index. The second is the float64 cosine of the raw float windows. "Exact" means a query's top 10 equals the truth's top 10, in order.
- E1 training. The reference is the same training run in float64 (stock PyTorch, deterministic, on the Xeon), from identical initial weights and identical batches. N = 5 runs per variant and device on 30 November and 3 on 1 December, each in a fresh process.
- E4 pricing. European: Black–Scholes. Asian: a 10⁹-path float64 control-variate estimate (SE 7.0 × 10⁻⁶). Barrier: Richardson-extrapolated quadrature.
- Timing. Every comparison ran in the same session on the same machine, inputs already on the device, after a warm-up. E2/E3: median of 30 repeats (15 on CPUs for the covariance, 10 at 20,000 assets, 7 for single-core loops). E1: median of 5 runs (3 on 1 December) × 480 timed steps, with a bootstrap 95% CI. E4: median of 7 repeats (3 for runs whose warm-up took over 40 s). Riptorch timings include producing the answer, because a checksum or the result ids are read back.
- Interval caveat. The interval printed as "95% CI" in the E2, E3 and E4 result files is the [min, max] of the repeats (an order-statistic interval that stops at the extremes). As an interval for the median it covers 98.4% at 7 repeats and more than 99.99% at 30, so at 7 or more repeats it is wider than a 95% interval. A few rows have only 3 repeats (7 Monte Carlo rows); there [min, max] covers the median only 75% of the time. This paper prints it as [min, max]. E1's intervals are genuine bootstrap intervals.
- Within-session only. The same GPU model on two hosts gave PyTorch step times up to 10× apart. Every ratio in this paper therefore compares runs from one session on one machine.
Data
- Synthetic factor returns (E2). A 10-factor model with N = 1,000, 5,000 and 20,000 assets over 2,520 days, stored as fixed-point int16 in units of 0.1 bp. Every method received the same values.
- Wide, short panel (E2). 221 assets × 26,303 periods from the same 10-factor model (seed 20261130 + 221), the shape of an hourly crypto book. It is far better conditioned than real hourly crypto (condition number 233 at δ = 0).
- Rolling statistics (E2). A BTC-like price path from $30,000 in integer cents, 10,000,000 one-minute steps.
- Synthetic minutes (E3). 50 series of 1,051,200 one-minute returns, GARCH(1,1) with Student-t(5) innovations and slow regime switches (seed 20261202). Every 64-, 128- and 256-minute window, z-normalised (so cosine equals Pearson correlation), up to 50,000,000 windows. 1,024 held-out queries come from the last 4% of each series. Windows are stored as int8 (one global scale, large components clipped) or int16. The 30 November rows clipped int16 like int8; the 1 December rows use full-range int16, nothing clipped.
- Training (E1). Two synthetic datasets. A GARCH(1,1) series with a planted AR(1) predictor (200,000 steps, seed 7), and synthetic BTC-like one-minute bars (44,640 bars, seed 20261203): GARCH(1,1) Student-t(4) returns with an intraday volatility cycle, and log volume, high-low range and taker-buy share generated from the volatility (log return, log volume, range, taker-buy share; no planted signal). The target is the next-minute return. Models: a 1-layer LSTM (hidden 64) and a 2-layer transformer (width 64); Adam, 500 steps, float32.
- Options (E4). GBM with S₀ = K = 100, r = 5%, σ = 20%, T = 1. A European call, an arithmetic Asian call on 64 dates, and an up-and-out call (barrier 130) on 64 dates, at 10⁶ to 10⁸ paths. The float32 and float64 pipelines receive the same normals, so their difference is arithmetic only.
Finding 1: precision alone rebalances a minimum-variance book
TF32 moves 20,000-asset minimum-variance weights by 0.0615 (L1), as much as 7.3 days of normal turnover, and 5,000-asset weights by 27% of a day's turnover; fp16 and bf16 break them; Riptorch's exact covariance moves them by exactly 0.
The weights are w = S⁻¹1 / 1ᵀS⁻¹1 with light shrinkage S = (1 − δ)C + δ·diag(C). Every covariance was solved in float64, so the differences come from the covariance's precision alone. The "normal turnover" baseline is how far the exact weights move when one more day (or hour) of data arrives.

| data | normal turnover, one period | PyTorch float32 | PyTorch TF32 | PyTorch fp16 | PyTorch bf16 | Riptorch exact |
|---|---|---|---|---|---|---|
| synthetic 5,000 × 2,520, δ 0.01 | 0.048 / day | 0.0029 | 0.0129 | 0.897 | 131.7 | 0 |
| synthetic 20,000 × 2,520, δ 0.01 | 0.0084 / day | 0.0053 | 0.0615 | 615 | 506 | 0 |
| synthetic 221 × 26,303 periods, δ 0 | 2.28 × 10⁻⁴ / period | 3.9 × 10⁻⁶ | 1.3 × 10⁻⁴ | 0.0044 | 0.034 | 0 |
On the 221-asset panel, TF32 moves the weights by 57% of one normal period's rebalance, fp16 by 19 periods' worth and bf16 by 147. The machine matters too: PyTorch float32 moves these weights by 1.4–3.9 × 10⁻⁶ on the A10G, Xeon and EPYC but by 5.1 × 10⁻⁵ on Graviton4, and bf16 by 0.034 against 0.12 there. Nothing warns: the covariance entries themselves are only about 4–6 × 10⁻⁵ off in correlation units (Finding 2). PyTorch float64 sits at 10⁻¹¹ to 10⁻¹⁴.

Finding 2: covariance errors far below sampling noise still turn the principal components
On the H100, TF32 turns the top-10 principal subspace by up to 0.0035° on the synthetic factor panels, fp16 by up to 0.013° and bf16 by up to 0.10°; on the 221-asset panel (A10G) the angles are 0.0020°, 0.039° and 0.37°. TF32's largest covariance entry error is about 200 times smaller than the covariance's own sampling error, and float32's about 4,000 times.


The point for practitioners: "the error is far below estimation noise" does not mean "the error is harmless". Estimation noise is the same for every precision. The precision error is an extra, device-dependent perturbation, and the solve amplifies it.
| data | method | max entry error | top-10 subspace angle (°) |
|---|---|---|---|
| 5,000 × 2,520 | PyTorch float32 | 3.3 × 10⁻⁶ | 2.3 × 10⁻⁵ |
| PyTorch TF32 | 6.2 × 10⁻⁵ | 0.0035 | |
| PyTorch fp16 | 5.0 × 10⁻⁴ | 0.0073 | |
| PyTorch bf16 | 0.0040 | 0.058 | |
| Riptorch exact | 0 | 6.0 × 10⁻¹⁴ (solver rounding) | |
| synthetic 221 × 26,303 (A10G) | PyTorch TF32 | 4.3 × 10⁻⁵ | 0.0020 |
| PyTorch fp16 | 4.9 × 10⁻⁴ | 0.039 | |
| PyTorch bf16 | 0.0041 | 0.37 | |
| Riptorch exact | 0 | 8.1 × 10⁻¹⁴ (solver rounding) |
On the linear-algebra side, TF32 changes nothing inside cuSOLVER's float32 eigensolver (the top-10 angle is 1.3 × 10⁻⁴° with TF32 off and with it on). The damage happens in the covariance matmul.
Finding 3: exact covariance is fast only where float64 is slow
On an RTX 4090, Riptorch's exact covariance for 5,000 assets takes 8.67 ms against PyTorch float64's 107 ms (12.3×) and is bit-identical to the exact result. On the H100, on all three CPUs and at 20,000 assets it is slower than float64, and end to end (measured on the H100 and the RTX 4090) it loses. On the 221-asset synthetic panel of 1 December it also wins on the L4 (5.6 ms against float64's 8.21, 1.47×) and is level on the A10G (7.85 against 7.28, 0.93×).



| machine | N | PyTorch float64 | PyTorch float32 | PyTorch TF32 | Riptorch exact | exact vs float64 |
|---|---|---|---|---|---|---|
| RTX 4090 | 5,000 | 107 [107, 110] | 3.39 | 2.19 | 8.67 [8.36, 115] | 12.3× |
| RTX 4090 | 20,000 | 1,640 | 49.5 | 33.4 | 3,810 | 0.43× |
| H100 | 5,000 | 2.61 | 2.80 | 0.641 | 7.61 | 0.34× |
| H100 | 20,000 | 37.3 | 42.2 | 7.86 | 98.1 | 0.38× |
| Xeon 8488C | 5,000 | 191 | 102 | – | 570 | 0.34× |
| Graviton4 | 5,000 | 386 | 153 | – | 844 | 0.46× |
| EPYC 9R14 | 5,000 | 202 | 104 | – | 341 | 0.59× |
Finding 4: cumulative-sum variance in float32 is dangerous
Over 10,000,000 one-minute steps, float32 prefix-sum rolling variance (window 1,000) is wrong by up to 330,000% and gives 4.5 million negative variances; sequential Welford in float32 is wrong by up to 115,000%. Fixed-point int64 prefix sums are exact to 1.7 × 10⁻¹¹ everywhere, and cost about 1 ms on the H100 (2.9 ms on the RTX 4090).
The vectorised textbook method computes Σx and Σx² with a cumulative sum and takes differences. In float32, the two sums are huge numbers whose difference is tiny, and a $30,000 price in float32 already has a 0.2-cent step. The fix is a method, not a library. Keep prices as integer cents, accumulate cents and cents² as int64 prefix sums (the two's-complement wrap cancels in the differences), and do one float64 combine per window. Stock PyTorch's int64 cumsum does this as well as Riptorch.



| method | max relative error | negative variances | H100 pod, ms |
|---|---|---|---|
| prefix sums, float32 (PyTorch, GPU) | 3.3 × 10³ (330,000%) | 4,504,750 | 0.44 |
| Welford, float32 (numba, one core) | 1.15 × 10³ | 3,468,067 | 27.6 |
| unfold().var(), float32 | 8.9 × 10⁻⁶ | 0 | 14.1 |
| prefix sums, float64 | 5.6 × 10⁻⁶ | 0 | 0.82 |
| pandas rolling().var() | 1.5 × 10⁻⁶ | 0 | 457 |
| fixed-point int64, PyTorch | 1.7 × 10⁻¹¹ | 0 | 1.02 |
| fixed-point int64, Riptorch | 1.7 × 10⁻¹¹ | 0 | 548 |
Riptorch's int64 cumulative sum is 1.68× stock on the EPYC and 1.41× on the Xeon. On GPUs it is far slower (548 ms against 1.02 ms), because its int64 cumulative sum runs on the CPU in 0.4.0. EWMA variance is safe in float32: its recursion contracts, and the maximum relative error stays at 7.2 × 10⁻⁷ (λ = 0.94) and 2.6 × 10⁻⁵ (λ = 1 − 1/1440) over all 10 million steps. Riptorch makes no claim there.
Finding 5: approximate neighbours change the analog forecast
Searching up to 50,000,000 synthetic one-minute windows for the 10 most correlated past regimes, PyTorch fp16 returns the true top 10 in order for 802–835 of 1,024 queries and changes 18–22% of rank-weighted forecasts; bf16 returns it for 93–255 and changes 75–91%. Riptorch's exact searches change none against their own input data. Full-range int16 data keep the raw windows' order as well as float32 does (1,003–1,011 of 1,024 queries); int8 data keep it for 18–83.
Analog forecasting finds the past windows most like the latest one and averages what came next. We use the mean next-16-minute return of the 10 neighbours, weighted by 1/rank, and compare it with the same forecast from the true neighbours.


Measured against the raw windows rather than its own vectors, int8, in any method, changes 92–98% of rank-weighted forecasts (941–1,006 of 1,024): the int8 quantisation, not the search, decides the neighbours. For quant use, int8 is a memory and speed format, not a truth-preserving one. int16 (or float32) is the honest format for return windows. Approximate indexes (cuVS CAGRA and IVF-PQ, FAISS IVF-PQ) were measured only on exchange data in version 1 and are not part of this version.
Finding 6: exact search is also fast on some GPUs and every CPU, with caveats
On an RTX 4090 (10M × 128 windows, 16 queries), Riptorch's exact int8 search is 1.24× PyTorch fp16, 2.6× PyTorch float32, 3.2× cuVS brute force and 6.0× FAISS flat, and exact on all 1,024 queries against its own int8 data (45 against the raw windows, Finding 5). On an A10G it is slower than fp16 (0.92×) and 2.8–5.4× the exact float baselines; on the H100 at 50M × 128 it is 0.91× fp16, 1.97× float32 and 1.43× cuVS, using 3.2–6.0× less GPU memory. On CPUs it is 3.0–9.2× PyTorch float32.



| machine, shape | Riptorch int8 | Riptorch int16 | PyTorch fp16 | PyTorch float32 | cuVS brute force | FAISS flat |
|---|---|---|---|---|---|---|
| RTX 4090 (30 Nov), 10M × 128 | 3.79 (1,024) | 86.2 (1,024) | 4.71 (820) | 9.97 | 12.3 | 22.9 |
| A10G (1 Dec), 10M × 128 | 9.85 (1,024) | 999 (1,024) | 9.03 (835) | 27.3 | 28.6 | 53.4 |
| H100 (30 Nov), 50M × 128 | 11.9 (1,024) | 437 (1,024) | 10.9 (826) | 23.5 | 17.1 | – |
| EPYC 9R14, 2M × 256 | 15.0 (1,024) | 31.1 (1,024) | bf16 54.0 (211) | 139 (1,023) | – | 136 (CPU) |
| Xeon 8488C, 2M × 256 | 32.1 (1,024) | 84.5 (1,024) | bf16 48.9 (211) | 95.1 | – | 441 (CPU) |
| Graviton4, 2M × 256 | 44.3 (1,024) | 99.3 (1,024) | bf16 31.6 (211) | 191 | – | 120 (CPU) |
The released 0.4.0 wheel's int16 search is 23× (RTX 4090) to 101× (A10G) slower than its int8 search on GPU machines, because it runs on the CPU. The faster GPU int16 kernel of the 0.4.1 pre-release was measured only on exchange data in version 1 and is not part of this version. The 30 November H100 and RTX 4090 rows clip int16 like int8, so their int16 rows match the raw windows less (543 and 580 of 1,024) than the 1 December full-range int16 rows (1,003–1,011).
Finding 7: reproducible training, bit for bit across CPUs
**Run to run, 219 of 221 training cells were bit-identical in both frameworks. The 2 exceptions are both PyTorch's torch.compile(mode="max-autotune") on the transformer trained on the synthetic BTC-like bars (A10G and L4), which trained a different model in every run. Across CPUs, Riptorch's trained weights have one SHA-256 on Intel Xeon, AMD EPYC and AWS Graviton4 for both datasets and both models (for the synthetic series, on nine CPU instances over two days), where PyTorch gives one result per CPU model. On NVIDIA GPUs, Riptorch's float32 LSTM lands 0.6–1.2 × 10⁻⁶ from the float64 run: about 420–2,600× closer than PyTorch's default.**
Every run started from identical weight bytes (set from NumPy) and saw identical batches, so any difference is arithmetic. The study covered 904 completed training-run records: the synthetic GARCH series on 18 machine-sessions (9 CPU instances over two days and 9 GPU sessions; 5 runs per variant on 30 November, 3 on 1 December), and the synthetic BTC-like bars on the five 1 December machines.


| data / model | PyTorch CPU | PyTorch GPU default | PyTorch GPU, TF32 off | PyTorch GPU bf16 autocast | Riptorch CPU | Riptorch GPU |
|---|---|---|---|---|---|---|
| synthetic series / LSTM | 1.12–1.17 × 10⁻⁶ | 1.65 × 10⁻³ (RTX 4090, H100, L4), 4.9 × 10⁻⁴ (A100, A10G) | 3.1–3.2 × 10⁻⁵ | 2.1–2.2 × 10⁻³ | 1.17 × 10⁻⁶ | 1.17 × 10⁻⁶ |
| synthetic bars / LSTM | 6.3–6.9 × 10⁻⁷ | 1.4 × 10⁻³ (A10G), 1.6 × 10⁻³ (L4) | 1.4 × 10⁻⁵ | 2.1–2.3 × 10⁻³ | 9.0 × 10⁻⁷ | 6.1–6.3 × 10⁻⁷ |
| synthetic series / transformer | 0.022–0.033 | 0.019–0.030 | 0.019–0.030 | 0.051–0.074 | 0.031 | 0.024–0.030 |
| synthetic bars / transformer | 0.033–0.078 | 0.059–0.072 | 0.059–0.072 | 0.053–0.060 | 0.067 | 0.047 |
- PyTorch's deterministic flag changed no bits here and cost 2–20% of step time in every session but one (on H100 s2 it ranged 0.88–1.10×, within host noise). On these models PyTorch's default CUDA path was already run-to-run deterministic.
torch.use_deterministic_algorithms(True)does not turn off cuDNN's TF32. - Across GPU models, bit identity is the exception. PyTorch gave a different result on every GPU model. Riptorch matched across two GPU models twice: the synthetic-series transformer on the L4 and the RTX 4090 (both Ada Lovelace, sm_89), and the synthetic-bars transformer on the A10G and the L4. Every other GPU pair differs, and Riptorch's GPU results differ from its CPU result. For the LSTM, Riptorch's devices differ from each other by at most 1.6 × 10⁻⁶, against 1.65 × 10⁻³ for PyTorch's default.
- Transformers amplify any difference. Between any two devices the transformers differ by 0.02–0.07, in every framework on CPU or GPU. These are chaotic training dynamics, not a framework property, and test MSE agrees to three digits.
- The same machines give the same bits a day later. The 1 December Xeon, Graviton4 and EPYC instances reproduced the 30 November weight hashes for every framework and variant on the synthetic series.
Finding 8: training speed is mostly a loss, and the host decides
With each side's fastest setting in the same session, Riptorch is faster only on the H100 host of session 3 (riptorch.compile 0.54× PyTorch's time for the LSTM and 0.42× for the transformer). It is 1.6–2.0× slower on the A100, 7–11× slower on the RTX 4090 host of session 3, 1.3–2.4× slower on the A10G and L4, and 4.3–14.0× slower on the CPUs. In sessions without compiled runs, Riptorch's eager transformer step beat PyTorch's on RTX 4090 s2 (0.30×) and H100 s1 and s2 (0.27× and 0.96×), while its LSTM was slower in every such session. On these tiny models the host CPU, not the GPU, sets PyTorch's step time: the same GPU model gave PyTorch steps up to 10× apart on different hosts.


| session | LSTM (synthetic series, synthetic bars) | transformer (synthetic series, synthetic bars) |
|---|---|---|
| H100 s3 (Xeon 8470 host) | 0.54, – | 0.42, – |
| A100 s3 (EPYC 7742 host) | 1.57, – | 1.95, – |
| RTX 4090 s3 (EPYC 7702 host) | 11.1, – | 7.2, – |
| RTX 4090 s2 (Xeon Gold 6133, no compile run) | 2.83, – | 0.30, – |
| A10G (1 Dec, g5.xlarge) | 1.34, 1.36 | 1.91, 1.94 |
| L4 (1 Dec, g6.xlarge) | 1.29, 1.31 | 2.28, 2.37 |
| Xeon 8488C, EPYC 9R14, Graviton4 (30 Nov, 1 Dec) | 4.3–10.2 (eager 4.9–10.2) | 7.1–14.0 |
PyTorch with intra-op threads matched to the pod's CPU quota ran its H100 LSTM step in 2.98 ms instead of 4.06 ms, and the transformer step on a 4090 host in 7.38 ms instead of 9.69 ms. Container defaults alone cost a quarter of the step.
Finding 9: Monte Carlo prices are accurate everywhere, and reproducible only with a portable stream
All 174 float32 Monte Carlo prices (and their float64 twins) lie within 2.25 standard errors of the reference, and float32 vs float64 on the same draws differs by at most 5.7 × 10⁻⁶, and by at most 0.51% of a run's standard error. What differs between machines is the random stream: for the same seed PyTorch draws four different streams on five devices (only Xeon and EPYC share one). A Riptorch 0.4.1 pre-release prices the European call to the same bits on Xeon, EPYC, RTX 4090 and H100, at 2.46× (Xeon) and 4.82× (EPYC) PyTorch's paths per second on CPUs.




| machine | contract | paths | PyTorch | Riptorch 0.4.0 | Riptorch 0.4.1 pre-release | ratio |
|---|---|---|---|---|---|---|
| EPYC 9R14 | European | 10⁸ | 1.12 × 10⁸ | 3.60 × 10⁷ | 5.38 × 10⁸ | 4.82 [4.73, 4.94] |
| Xeon 8488C | European | 10⁸ | 1.46 × 10⁸ | 3.79 × 10⁷ | 3.59 × 10⁸ | 2.46 [2.37, 2.50] |
| EPYC 9R14 | Asian, 64 dates | 10⁷ | 2.13 × 10⁶ | 4.86 × 10⁵ | 1.89 × 10⁶ | 0.88 |
| Xeon 8488C | barrier, 64 dates | 10⁷ | 2.49 × 10⁶ | 5.13 × 10⁵ | 2.10 × 10⁶ | 0.84 |
| RTX 4090 | European | 10⁸ | 2.42 × 10¹⁰ | 6.71 × 10⁷ | 8.42 × 10⁹ | 0.35 |
| H100 SXM | European | 10⁸ | 3.15 × 10¹⁰ | 4.57 × 10⁷ | 8.69 × 10⁹ | 0.28 |
| RTX 4090 | Asian, 64 dates | 10⁸ | 1.25 × 10⁸ | – | 4.44 × 10⁶ | 0.04 |
| H100 SXM | barrier, 64 dates | 10⁸ | 1.46 × 10⁸ | – | 7.48 × 10⁵ | 0.005 |
- Every repeat and both separate processes gave the same price bits, for every framework on every device (the pre-release ran one process on the H100: its second process was stopped to stay inside the pod's budget). Run-to-run reproducibility of a seeded Monte Carlo is not the issue. Cross-device reproducibility is.
- Riptorch 0.4.0 already draws one stream on all five machines, but in 8 of 18 configurations its prices split between CPUs and GPUs in the last bits; in the other 10 they agree on all five. With the 0.4.1 pre-release, the Asian and barrier prices are identical on the two GPUs and on the two CPUs, and CPU and GPU still differ by one or two bit patterns in half of the configurations.
- The generator behind the pre-release is described, with its bit-identity tests across CPUs, CUDA and Apple GPUs, in the companion paper Reproducible random numbers.
- CuPy gives the same normals and prices on the RTX 4090 and the H100 (the same normals in 18 of 18 configurations and the same price in 17), but it has no CPU path to compare against.
Limitations and next steps
The limits of these results, each with its cause and, where one is planned, the next step.
Covariance and linear algebra (E2)
- Exact covariance on fast-float64 hardware. It is 0.34× PyTorch float64 on the H100 at 5,000 assets and 0.38× at 20,000, and 0.34–0.59× on all three CPUs. It is also slower at 20,000 assets on the RTX 4090 (3.81 s against 1.64 s, 0.43×). Cause: under investigation.
- Small or wide-short matrices. On the 221 × 26,303 synthetic panel the exact covariance takes 7.85 ms against PyTorch float64's 7.28 ms on the A10G (0.93×) and 0.43–0.72× float64 on the three CPUs, and it is 0.65× float64 at 1,000 assets on the H100. Cause: under investigation.
- Riptorch float32 covariance is slower than PyTorch float32 everywhere (for example 4.19 ms against 2.80 ms on the H100 at 5,000 assets, and 1,510 ms against 49.5 ms on the RTX 4090 at 20,000). Cause: under investigation.
- End to end, returns to weights. 78.3 ms against PyTorch float64's 7.45 ms on the H100, and 828 ms against 160 ms on the RTX 4090. Cause: the exact covariance is handed from Riptorch to PyTorch through the host, and copying the 200 MB matrix there and back costs more than the covariance saves.
- Riptorch float64 covariance. On CUDA it takes 216 ms against PyTorch float64's 0.707 ms on the H100 and 182 ms against 5.35 ms on the RTX 4090 (1,000 assets), and 116 ms against 7.28 ms on the A10G and 99.5 ms against 8.21 ms on the L4 (the 221-asset panel). It is slower than PyTorch float64 on every CPU too (for example 214 ms against 191 ms on the Xeon at 5,000 assets). Cause: under investigation.
- Riptorch's own eigensolver and solver. These run on the CPU, single-threaded, in 0.4.0. At 5,000 assets they ran more than 12 minutes and were stopped on every machine.
Rolling statistics (E2)
- int64 cumulative sum. On GPUs it is 548 ms against stock's 1.02 ms on the H100 pod. Cause: in 0.4.0 it runs on the CPU. On Graviton4 it is 0.29× stock. Cause: under investigation.
Search (E3)
- The released 0.4.0 int16 search takes 86–999 ms per 16 queries on GPU machines, 23–101× its own int8 search and far slower than PyTorch float32. Cause: it runs on the CPU in 0.4.0.
- PyTorch fp16 against Riptorch int8. fp16 is faster on the A10G at 10M × 128 (9.03 ms against 9.85, 0.92×) and on the H100 at 50M × 128 (10.9 against 11.9, 0.91×). fp16 is not exact (826–835 of 1,024 on those shapes). Cause: under investigation.
- 1 and 64 queries per batch on GPUs. At 64 queries Riptorch int8 is slower than PyTorch fp16 on every GPU shape (14.1 ms against 9.65 on the RTX 4090, 37.7 against 23.1 on the A10G, 45.0 against 33.2 on the H100) and slower than cuVS brute force on the A10G and H100 (37.7 against 32.0, 45.0 against 30.6). At one query it is slower than PyTorch fp16 everywhere, and slower than PyTorch float32 on the RTX 4090 (6.04 ms against 5.83) and the A10G (15.7 against 11.1). Cause: under investigation.
- CPUs at 64 queries per batch. Riptorch int8 is slower than PyTorch float32 on the Xeon at every window length (174 ms against 153 at 64 minutes, 217 against 183 at 128, 270 against 230 at 256), on Graviton4 at 128 minutes (94.2 against 85.2) and level at 64 minutes (59.5 against 59.3), and slower than FAISS CPU on the EPYC at 64 minutes (145 against 123); the inexact PyTorch bf16 path is faster than int8 at 64 queries on all three CPUs (123, 140 and 85 ms against 270, 163 and 156). At 16 queries PyTorch bf16 on Graviton4 is faster than int8 (31.6 ms against 44.3) but exact for only 211 of 1,024 queries. Cause: under investigation.
- The released 0.4.0 int16 search on CPUs. It is slower than PyTorch float32 on Graviton4 at 16 queries (29.8 ms against 22.9 at 64 minutes, 53.2 against 33.0 at 128) and at 64 queries on Graviton4 at every window length (131 against 59.3 ms at 64 minutes, 221 against 85.2 at 128, 415 against 263 at 256) and on the Xeon at 128 and 256 minutes (213 against 183, 414 against 230). Cause: under investigation.
- 20 million windows on a 16 GB host. On the A10G machine (g5.xlarge, 16 GB of host memory) the Riptorch rows at 20M × 128 were stopped by the out-of-memory killer while loading the windows. Cause: the 0.4.0 search holds a host copy of the windows; a larger instance is the workaround.
- int8 data. int8 windows lose most of the raw neighbour order (18–83 of 1,024 queries match the raw top 10). Cause: the int8 quantisation is too coarse for z-normalised return windows. Use int16.
Training (E1)
- CPU training is 4.9–14.0× slower per step (LSTM 4.9–10.2×, transformer 7.1–14.0×). riptorch.compile brings the CPU LSTM to 4.3–6.9×.
- GPU training. Riptorch is slower than PyTorch's best float32 setting on the A100 (1.57× LSTM, 1.95× transformer), the A10G (1.34–1.36× and 1.91–1.94×) and the L4 (1.29–1.31× and 2.28–2.37×). The LSTM is slower on all three RTX 4090 hosts (2.8–11.1×) and on H100 sessions 1 and 2 (2.0× and 6.2×); the transformer is slower on two of three RTX 4090 hosts (1.8–7.2×). Reasons (measured with a profiler on an RTX 4090 and an H100): Riptorch 0.4.0 rebuilds the training step's graph on the host at every step, so the GPU idles while the host works. Its LSTM recurrence also runs as more, smaller GPU kernels than cuDNN's fused recurrence, taking about five times the GPU time. riptorch.compile removes most of the host work: 2.68 ms against PyTorch's 2.63 ms on the profiled RTX 4090 host.
- Bit identity across GPU models only in two cases (L4 and RTX 4090; A10G and L4, for one model each), and Riptorch's GPU result differs from its CPU result. Cause: GPU and CPU code paths, and different GPU architectures, sum in different orders.
- float64 training took more than 10 minutes for 500 LSTM steps on a CPU (stopped at 300 s per run), and 333–487 ms per step on GPUs against stock float64's 2.7–14 ms. Cause: under investigation.
- First-step compile time. 15–23 s for the LSTM program on GPUs, and 31–48 s for riptorch.compile's first 20 steps.
Monte Carlo (E4)
- GPU Monte Carlo. The European call runs at 0.22–0.35× PyTorch on the GPUs with the 0.4.1 pre-release at 10⁶–10⁸ paths (0.002× with 0.4.0). Causes: 0.4.0 draws its random numbers on one CPU core even for GPU work. For the pre-release the likely reason, from its random-number benchmark rather than from this experiment, is that a fresh GPU draw often pays for new device memory because released buffers are recycled late.
- Path-dependent options. 64-date Asian and barrier options run at 0.83–0.98× PyTorch on CPUs and 0.005–0.04× on GPUs with the pre-release. Cause: under investigation.
- The 0.4.0 wheel's Monte Carlo is 0.22–0.34× PyTorch on CPUs for the European and 0.21–0.29× for path-dependent options, and 0.001–0.008× on GPUs. Cause: its single-core random-number generation caps every 0.4.0 run.
- CPU vs GPU prices. Asian and barrier prices from the 0.4.1 pre-release still differ between CPU and GPU in the last bits in half of the configurations.
Implications for practitioners
- Check your matmul precision setting.
torch.set_float32_matmul_precision("high"), a common speed setting, silently turns a covariance matmul into TF32. On a 20,000-asset minimum-variance book that is 7–16 days of turnover. Printtorch.get_float32_matmul_precision()andtorch.backends.cuda.matmul.allow_tf32in every backtest log. - cuDNN TF32 is on by default.
torch.backends.cudnn.allow_tf32is True unless you set it False. On the RTX 4090, H100, A100, A10G and L4 a GPU-trained LSTM's weights then land about 420–2,500× further from float64 than the same LSTM trained on a CPU. The deterministic flag does not change this. - Never compute rolling variance from float32 cumulative sums. Use integer fixed point (prices in cents or ticks, int64 sums of x and x², one float64 combine) or a float64 method. EWMA in float32 is fine.
- Do not use fp16 or bf16 for covariances that feed a solver. They flip the sign of thousands of weights.
- Exact means exact for the stored data. If you quantise return windows to int8 for search, you have chosen different neighbours before the search runs. Use int16 or float32 for the data, and an exact search if the ranking matters.
- Low-precision search changes the forecast. fp16 changed 18–22% of analog forecasts here and bf16 75–91%. Use an exact search when the ranking feeds a forecast.
- Reproducibility has three levels. Same machine twice (usually fine;
torch.compile(max-autotune)broke it here). Same code on another CPU (Riptorch gave one answer; PyTorch gave one per CPU model). Another GPU model (neither framework). State which level your audit needs. - For Monte Carlo, float32 is enough; the seed is not. The float32 error was at most 0.51% of an SE. The same seed gives different paths on different devices in PyTorch, so a price quoted to the cent is reproducible only on the device that made it.
- Benchmark within one machine. Rented GPUs of the same model differed by up to 10× in small-model training step time because of the host CPU and CPU quotas. Match intra-op threads to the container's CPU quota.
Reproduction notes
- Procedure. For each experiment, the reference is computed first (exact integer covariance, rational rolling variance, float64 search scores, a float64 training run, closed-form or quadrature option prices). Every method then runs in its own process on the same stored inputs, in the same session, and is compared with the reference before its timing is used.
- Inputs. Every input is synthetic and fully determined by its seed: factor returns (seed 20261130 + N, including the 221-asset panel), the rolling-variance price path (seed 20261201), the search windows (seed 20261202), the E1 series (seed 7) and synthetic bars (seed 20261203), and the E4 paths (seed 20261130). No third-party market data is used.
- Software. The baselines are the public releases named in Methods. Riptorch 0.4.0 is not yet published, and the 0.4.1 pre-release builds are development builds. Riptide can run these measurements for evaluation partners (see Working with Riptide).
- Compute. The 30 November runs cost about $40 ($13.53 for E2/E3, $26.43 for E1/E4; RunPod GPU pods and EC2); this version reuses only their synthetic-input rows. The 1 December rerun cost about $2.83 on AWS EC2 on-demand instances. Every machine was terminated after the runs.
- Known artefacts. In the 30 November synthetic search rows, the int16 inputs were clipped like the int8 inputs. That is why those int16 rows match the raw windows less than the 1 December full-range int16 rows (543–580 against 1,003–1,011 of 1,024). CPU
torch.compilefailed to build the E1 transformer in the 30 November setup (a missing Python header), and the 1 December CPU lanes ran no compiled variants. One of three L4 compiled synthetic-bars transformer runs failed (CUDA graph capture invalidated).
Data credits
No third-party market data is used. Every input is generated from the seeds in the reproduction notes. Version 1 (30 November 2026) used Binance public market data; every number derived from it is withdrawn in this version.
Date and version
Version 2.0, 1 December 2026. Measurements of 30 November 2026 (synthetic-input rows only) and 1 December 2026. Riptorch 0.4.0 release wheel (release pending), plus Riptorch 0.4.1 pre-release builds where labelled. PyTorch 2.13.0 (CUDA 12.9 on GPUs; CPU 2.13.0 for E1/E4, 2.15.0 for E2/E3), FAISS 1.14.1, NVIDIA cuVS 26.10, CuPy for CUDA 12. Updated 1 December 2026: limitations section retitled; rerun on synthetic data; no third-party market data.
Working with Riptide
Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.