RiptideRiptide
Download Riptide SDKInstall Riptorch
Menu
Whitepapers · Riptorch · Quantitative finance

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.

Version
2.0 (updated 1 December 2026: rerun on synthetic data; no third-party market data)
Date
30 November 2026
Author
Samario Torres, Riptide
Software
Riptorch 0.4.0 (release wheel; release pending) and a Riptorch 0.4.1 pre-release build where labelled; PyTorch 2.13.0 (CUDA 12.9 and CPU; 2.15.0 on CPUs for the 30 November E2/E3 rows); FAISS 1.14.1; NVIDIA cuVS 26.10; CuPy 14; pandas; NumPy 2.5.5
Download PDFOpen in new tabriptidecompute.com/whitepapers/precision-is-a-position

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

Table 1. Machines. The 30 November GPUs were rented RunPod instances; the 1 December GPUs (A10G, L4) and every CPU were AWS EC2 instances. Each GPU "session" is a separate machine on a different host.
machinehost CPU / instancedriver / CUDAused for
NVIDIA RTX 4090 24 GBsessions on Ryzen 9 9950X, Xeon Gold 6133, EPYC 7702, EPYC 75F3 and EPYC 7452 hosts595.112.07 / 13.2 driver, CUDA 12.9 user stackE1–E4
NVIDIA H100 80GB HBM3 (SXM)Xeon Platinum 8470 and 8480+ hosts595.112.07E1–E4
NVIDIA A100-SXM4-80GBEPYC 7742 host595.112.07E1
NVIDIA A10G 24 GB (1 Dec)EC2 g5.xlarge (4 vCPU, 16 GB)620.70.06, CUDA 12.9 user stackE1–E3
NVIDIA L4 24 GB (1 Dec)EC2 g6.xlarge (4 vCPU, 16 GB)620.70.06, CUDA 12.9 user stackE1–E3
Intel Xeon Platinum 8488CEC2 c7i.4xlarge, 16 vCPU (30 Nov and 1 Dec)–E1–E4
AMD EPYC 9R14EC2 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_tf32 was False by default on both GPUs, while cuDNN's own TF32 flag is True by default), fp16 and bf16, torch.compile(mode="max-autotune"), and torch.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. pandas rolling().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.

Horizontal log-scale bars of turnover caused by precision in units of normal turnover, three panels for 5,000 assets, 20,000 assets and the 221-asset synthetic panel. Float64 is about 10 to the minus 10, float32 0.061, 0.64 and 0.017, TF32 0.27, 7.3 and 0.57, fp16 19, 73,186 and 19, bf16 2,746, 60,313 and 147; Riptorch exact is exactly 0 in every panel.
Figure 1. Weight change caused by each covariance precision, in units of the turnover one new period of data causes (H100 for the 5,000- and 20,000-asset panels, A10G for the 221-asset panel; diamonds mark the RTX 4090 where it differs). TF32 at 20,000 assets is 7.3 days on the H100 and 16 days on the RTX 4090.
Table 2. Minimum-variance weight error from the covariance's precision alone (H100, and A10G for the 221-asset panel; L1 distance to the exact weights, i.e. two-way turnover; 2 = the whole book).
datanormal turnover, one periodPyTorch float32PyTorch TF32PyTorch fp16PyTorch bf16Riptorch exact
synthetic 5,000 × 2,520, δ 0.010.048 / day0.00290.01290.897131.70
synthetic 20,000 × 2,520, δ 0.010.0084 / day0.00530.06156155060
synthetic 221 × 26,303 periods, δ 02.28 × 10⁻⁴ / period3.9 × 10⁻⁶1.3 × 10⁻⁴0.00440.0340

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⁻¹⁴.

Two heatmaps with rows float64, float32, TF32, fp16, bf16 and Riptorch exact and columns for 1,000, 5,000 and 20,000 assets and the 221-asset synthetic panel at two shrinkage levels. The left heatmap shows L1 weight error from 10 to the minus 14 up to 615; the right shows sign flips, up to 10,004 for bf16 at 20,000 assets. The Riptorch exact row is 0 everywhere.
Figure 2. Weight error (left) and the number of weights whose sign flips, long to short (right), by precision, universe size and shrinkage. More shrinkage (δ = 0.1) damps every error. At 20,000 assets, fp16 and bf16 flip about half of all 20,000 weights.

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.

Three log-scale line charts of the angle between each of the top 10 eigenvectors and the exact one, for 1,000 assets, 5,000 assets and the 221-asset panel. bf16 is the highest at around 0.01 to 0.4 degrees, then fp16 and TF32, float32 around 10 to the minus 5, float64 around 10 to the minus 13, and Riptorch exact at 0 on the floor. A dashed line shows the change one more period of data causes; it is larger than the TF32, fp16 and float32 errors everywhere, but bf16 exceeds it on the 221-asset panel.
Figure 3. Angle between each principal component and the exact one (float64 eigensolver), against the change one more period of data causes (dashed). Riptorch's exact covariance gives angles of exactly 0.
Dot-range chart of covariance entry errors in correlation units for 5,000 assets: float64 maximum 5.0e-15, float32 3.3e-6, TF32 6.2e-5, fp16 5.0e-4, bf16 0.0040, all left of a dashed line at 0.013, the sample covariance's own median statistical error. Riptorch exact has 0 of 25,000,000 entries different.
Figure 4. Covariance entry error (median, 99th percentile, maximum) at 5,000 assets on the H100, against the sample covariance's statistical error (median 0.013 in correlation units).

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.

Table 3. Covariance and PCA error (H100; A10G for the 221-asset panel). Entry error in correlation units; top-10 subspace = largest principal angle between the top-10 eigenvector subspaces.
datamethodmax entry errortop-10 subspace angle (°)
5,000 × 2,520PyTorch float323.3 × 10⁻⁶2.3 × 10⁻⁵
PyTorch TF326.2 × 10⁻⁵0.0035
PyTorch fp165.0 × 10⁻⁴0.0073
PyTorch bf160.00400.058
Riptorch exact06.0 × 10⁻¹⁴ (solver rounding)
synthetic 221 × 26,303 (A10G)PyTorch TF324.3 × 10⁻⁵0.0020
PyTorch fp164.9 × 10⁻⁴0.039
PyTorch bf160.00410.37
Riptorch exact08.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×).

Grouped horizontal log-scale bars of covariance time per machine for 5,000 assets. RTX 4090: float64 107 ms, float32 3.39, TF32 2.19, fp16 1.6, bf16 1.56, Riptorch float32 4.21, Riptorch exact 8.67 (12.3 times float64). H100: float64 2.61, Riptorch exact 7.61 (0.34 times). Xeon, Graviton4 and EPYC: Riptorch exact 570, 844 and 341 ms against float64 191, 386 and 202 (0.34 to 0.59 times).
Figure 5. Covariance time, 5,000 assets × 2,520 days, median with [min, max]. The exact covariance wins only on the consumer GPU, where float64 is slow.
Two log-log scatter plots of covariance time against L1 weight error for the RTX 4090 and the H100. bf16 and fp16 are fast with errors near 1 to 100; TF32 is at 0.27 days of turnover on the H100 and 0.55 on the RTX 4090; float32 is near 0.003; float64 is near 10 to the minus 11; Riptorch exact sits on the floor at 0, at 8.67 ms on the 4090 and 7.61 ms on the H100.
Figure 6. The speed–accuracy frontier for a 5,000-asset covariance (δ = 0.01). On the RTX 4090 the exact covariance is both faster than float64 and more accurate than float32.
Three bar panels of end-to-end time from returns to weights. H100 at 5,000 assets: float64 7.45 ms, float32 7.22, TF32 5.09, Riptorch exact covariance plus PyTorch float64 Cholesky 78.3 ms. RTX 4090: 160, 9.6, 8.59 and 828 ms. H100 at 20,000 assets: 129, 128, 95.5 and 1,137 ms.
Figure 7. End to end, returns to minimum-variance weights (δ = 0.1). The exact pipeline gives float64-level weights (L1 5.6 × 10⁻¹³) but loses on time on both GPUs.
Table 4. Covariance step, ms (median [min, max]); "exact vs float64" = PyTorch float64 time / Riptorch exact time, same session.
machineNPyTorch float64PyTorch float32PyTorch TF32Riptorch exactexact vs float64
RTX 40905,000107 [107, 110]3.392.198.67 [8.36, 115]12.3×
RTX 409020,0001,64049.533.43,8100.43×
H1005,0002.612.800.6417.610.34×
H10020,00037.342.27.8698.10.38×
Xeon 8488C5,000191102–5700.34×
Graviton45,000386153–8440.46×
EPYC 9R145,000202104–3410.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.

Two log-scale line charts of the maximum relative error of the rolling variance in each tenth of the series, for windows of 1,000 and 10,000 minutes. Float32 prefix sums and float32 Welford sit near 100% to 300,000%; unfold().var() float32 near 10 to the minus 5; float64 prefix sums, pandas and Welford float64 between 10 to the minus 9 and 10 to the minus 6; fixed-point int64 near 10 to the minus 11 and flat.
Figure 8. Worst rolling-variance error in each tenth of the 10-million-minute series. The float32 error peaks where the price is high and the window calm: cancellation, not slow drift.
Horizontal bars of negative variance counts among 10 million windows. On the H100 run: float32 prefix sums 4,504,750 at window 1,000 and 827,539 at 10,000; float32 Welford 3,468,067 and 1,707,325; every float64, pandas and fixed-point method 0. On the EPYC run, float32 prefix sums 3,685,549 and 173,795.
Figure 9. Negative variances, an impossible value, produced by float32 methods. GPU and CPU float32 sums differ (summation order), but both fail.
Four bar panels of time for all 10 million rolling variances at window 1,000. On the H100 pod: float32 prefix sums 0.444 ms, fixed-point int64 in PyTorch 1.02 ms, pandas 457 ms, Riptorch fixed-point int64 548 ms. On Xeon, EPYC and Graviton4, Riptorch int64 takes 101, 114 and 57.3 ms against PyTorch's 142, 191 and 16.5 ms.
Figure 10. Rolling-variance speed, window 1,000 (median of 30; 7 for pandas and the single-core Welford loops). The exact fixed-point method is about 450× faster than pandas on the GPU pod, in stock PyTorch.
Table 5. Rolling variance, 10,000,000 steps, window 1,000.
methodmax relative errornegative variancesH100 pod, ms
prefix sums, float32 (PyTorch, GPU)3.3 × 10³ (330,000%)4,504,7500.44
Welford, float32 (numba, one core)1.15 × 10³3,468,06727.6
unfold().var(), float328.9 × 10⁻⁶014.1
prefix sums, float645.6 × 10⁻⁶00.82
pandas rolling().var()1.5 × 10⁻⁶0457
fixed-point int64, PyTorch1.7 × 10⁻¹¹01.02
fixed-point int64, Riptorch1.7 × 10⁻¹¹0548

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.

Dumbbell chart of queries out of 1,024 whose top 10 matches the float64 top 10 in order, against the raw windows and against each method's own input. Riptorch exact int16: 1,004 raw, 1,024 own. cuVS brute force, PyTorch float32 and FAISS flat: 1,004 and 1,024. PyTorch fp16 842 and 835. bf16 217 and 217. Riptorch exact int8: 45 raw, 1,024 own.
Figure 11. Who returns the true top 10? A10G, 10M × 128-minute synthetic windows, full-range int16. int8 is exact for its own int8 vectors, but those vectors lose the raw order.
Three panels of forecasts changed out of 1,024 queries. H100 50M × 128: Riptorch int8 and int16, float32 and cuVS 0, fp16 198 with 1 sign flip. A10G 10M × 128: Riptorch, float32, cuVS and FAISS flat 0, fp16 189 with 3 sign flips, bf16 807 with 22. EPYC 2M × 256: Riptorch 0, FAISS 0, float32 1, bf16 813 with 25 sign flips.
Figure 12. Neighbour forecasts that change because the neighbours are reordered or replaced (dark: 1/rank weights; light: equal weights, which change only when the set changes). Each method is compared with the truth on its own input data.

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.

Six bar panels of milliseconds per 16 queries with the number of exact queries next to each bar. RTX 4090 10M × 128: Riptorch int8 3.79 ms, PyTorch fp16 4.71, float32 9.97, cuVS 12.3, FAISS flat 22.9, Riptorch int16 0.4.0 86.2. A10G 10M × 128: Riptorch int8 9.85, fp16 9.03, bf16 9.16, float32 27.3, cuVS 28.6, FAISS 53.4. H100 50M × 128 and three CPUs at 2M × 256, including EPYC Riptorch int8 15.0 ms against PyTorch float32 139.
Figure 13. Latency per device, every method in the same session (median of 30 with [min, max]; 15 on CPUs). The 0.4.0 wheel's int16 search runs on the CPU even on a GPU machine.
Grouped bars of peak GPU memory at 50 million windows of 128 minutes. Riptorch exact int8 6.7 GiB; PyTorch fp16 21.3; cuVS brute force 25.4; PyTorch float32 40.4.
Figure 14. Peak device memory for 50 million windows (H100, 30 November). The 0.4.0 int16 row is left out because that build searches on the CPU.
Three panels of grouped log bars for EPYC 9R14, Xeon 8488C and Graviton4 at 2 million windows of 64, 128 and 256 minutes. At 256 minutes Riptorch int8 takes 15.0, 32.1 and 44.3 ms against PyTorch float32's 139, 95.1 and 191 ms; PyTorch bf16 54.0, 48.9 and 31.6 ms but only 211 of 1,024 exact.
Figure 15. Exact search on server CPUs (2M synthetic windows, 16 queries, Riptorch 0.4.0 wheel).
Table 6. Search, 16 queries per batch, ms (exact = queries of 1,024 whose top 10 equals the float64 top 10 of that method's own input, in order). Everything Riptorch is the 0.4.0 wheel; its int16 search runs on the CPU in 0.4.0.
machine, shapeRiptorch int8Riptorch int16PyTorch fp16PyTorch float32cuVS brute forceFAISS flat
RTX 4090 (30 Nov), 10M × 1283.79 (1,024)86.2 (1,024)4.71 (820)9.9712.322.9
A10G (1 Dec), 10M × 1289.85 (1,024)999 (1,024)9.03 (835)27.328.653.4
H100 (30 Nov), 50M × 12811.9 (1,024)437 (1,024)10.9 (826)23.517.1–
EPYC 9R14, 2M × 25615.0 (1,024)31.1 (1,024)bf16 54.0 (211)139 (1,023)–136 (CPU)
Xeon 8488C, 2M × 25632.1 (1,024)84.5 (1,024)bf16 48.9 (211)95.1–441 (CPU)
Graviton4, 2M × 25644.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.

Two matrices for the LSTM and transformer trained on the synthetic BTC-like bars, with rows for PyTorch default, deterministic, TF32 off, torch.compile, bf16 autocast, Riptorch, Riptorch TF32 and riptorch.compile, and columns for the Xeon, Graviton4, EPYC, A10G and L4 of 1 December. In the Riptorch row the three CPU cells share letter A; for the transformer the A10G and L4 share one letter too. In the PyTorch default row Xeon, Graviton4 and EPYC each have their own letter. PyTorch torch.compile on the transformer is outlined in red with 3 of 3 and 2 of 2 distinct results.
Figure 16. Which machines train to the same bits (letters compare within a row). riptorch.compile gave the same bits as Riptorch's eager step in every cell.
Four dot-plot panels of the largest absolute weight difference from the float64 run, on a log scale from 10 to the minus 7 to 0.1. LSTM panels: Riptorch near 10 to the minus 6 on every device; PyTorch default near 10 to the minus 6 on CPUs but 5 times 10 to the minus 4 to 1.7 times 10 to the minus 3 on the GPUs; PyTorch with TF32 off near 1 to 3 times 10 to the minus 5; bf16 near 2 times 10 to the minus 3. Transformer panels: every method between 0.02 and 0.08.
Figure 17. Trained weights against a float64 run of the same training (500 Adam steps). For the LSTM, PyTorch's GPU default uses TF32 inside cuDNN; for the transformer, no framework stays close to the float64 trajectory.
Table 7. Distance from the float64 run, max |w − w₆₄| after 500 steps.
data / modelPyTorch CPUPyTorch GPU defaultPyTorch GPU, TF32 offPyTorch GPU bf16 autocastRiptorch CPURiptorch GPU
synthetic series / LSTM1.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 / LSTM6.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 / transformer0.022–0.0330.019–0.0300.019–0.0300.051–0.0740.0310.024–0.030
synthetic bars / transformer0.033–0.0780.059–0.0720.059–0.0720.053–0.0600.0670.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.

Small multiples of log-scale bars of milliseconds per training step for PyTorch, torch.compile, Riptorch and riptorch.compile, on Xeon, Graviton4, EPYC, A10G and L4, for the LSTM and the transformer. On the A10G and L4, riptorch.compile takes 1.58–1.98 ms against PyTorch's 1.20–1.45 (LSTM) and 3.71–3.96 against torch.compile's 1.67–1.92 (transformer); on the CPUs Riptorch takes 44 to 238 ms against PyTorch's 4.5 to 22.
Figure 18. Step time per device on the synthetic BTC-like bars (1 December machines; median of 3 runs × 480 steps).
Dumbbell chart of PyTorch default and Riptorch step times for three RTX 4090 and three H100 sessions with their host CPUs. PyTorch's LSTM step on the synthetic series ranges from 0.473 ms (Ryzen 9 9950X host) to 4.84 ms (Xeon Gold 6133 host) on the same GPU model. Riptorch's transformer step is faster than PyTorch's in four sessions.
Figure 19. Same GPU, different host. Small models keep the GPU busy only 5–7% of a PyTorch LSTM step, so host single-thread speed and CPU-quota throttling dominate.
Table 8. Best Riptorch / best float32 PyTorch, same session (below 1 = Riptorch faster).
sessionLSTM (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.361.91, 1.94
L4 (1 Dec, g6.xlarge)1.29, 1.312.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.

Three panels of price minus reference against 10 to the 6, 7 and 8 paths for the European, Asian and barrier options, with a shaded band of plus and minus 1.96 standard errors narrowing as paths grow. Points for PyTorch, CuPy, Riptorch 0.4.0 and the 0.4.1 pre-release all fall inside or just at the band.
Figure 20. Prices against the reference, float32 pipeline, every framework and machine.
Log-log scatter of the absolute float32 minus float64 price difference on the same draws against the run's standard error. All points lie between 10 to the minus 9 and 6 times 10 to the minus 6, below the line at 1% of the SE, against standard errors of 6.6 times 10 to the minus 4 to 1.5 times 10 to the minus 2.
Figure 21. float32 arithmetic is not the problem for Monte Carlo pricing.
Three matrices with rows for PyTorch, CuPy, Riptorch 0.4.0 and the Riptorch 0.4.1 pre-release in float32 and float64, and columns Xeon, Graviton4, EPYC, RTX 4090 and H100. Normals: PyTorch has four streams, with Xeon and EPYC sharing one; Riptorch has one stream everywhere. European price at 10⁸ paths: PyTorch five different prices; the 0.4.1 pre-release one price on all four machines it ran on; 0.4.0 split CPU versus GPU at this size. Asian and barrier: Riptorch prices split CPU versus GPU.
Figure 22. Same seed, same numbers? Letters compare within a row. The 0.4.1 pre-release has no arm64 build yet, so it did not run on Graviton4.
Three panels of log-scale paths per second per machine and framework. European 10 to the 8 paths: on CPUs PyTorch 1.1 to 1.5 times 10 to the 8, the 0.4.1 pre-release 3.6 to 5.4 times 10 to the 8, Riptorch 0.4.0 about 4 times 10 to the 7; on GPUs PyTorch 2.4 to 3.2 times 10 to the 10, CuPy 1.6 to 1.8 times 10 to the 10, the pre-release about 8.5 times 10 to the 9. Asian and barrier at 10 to the 7: CPUs around 2 times 10 to the 6, GPU PyTorch and CuPy about 1.3 to 1.6 times 10 to the 8, Riptorch below 5 times 10 to the 6.
Figure 23. Monte Carlo speed (median of 7 repeats; PyTorch and CuPy from the same session as the pre-release where it ran).
Table 9. Monte Carlo speed, paths per second (float32, median of 7). PyTorch and the 0.4.1 pre-release ran in the same session; ratio = pre-release / PyTorch with the ratio's interval. The Riptorch 0.4.0 column is from the session-1 lanes of the same machine type.
machinecontractpathsPyTorchRiptorch 0.4.0Riptorch 0.4.1 pre-releaseratio
EPYC 9R14European10⁸1.12 × 10⁸3.60 × 10⁷5.38 × 10⁸4.82 [4.73, 4.94]
Xeon 8488CEuropean10⁸1.46 × 10⁸3.79 × 10⁷3.59 × 10⁸2.46 [2.37, 2.50]
EPYC 9R14Asian, 64 dates10⁷2.13 × 10⁶4.86 × 10⁵1.89 × 10⁶0.88
Xeon 8488Cbarrier, 64 dates10⁷2.49 × 10⁶5.13 × 10⁵2.10 × 10⁶0.84
RTX 4090European10⁸2.42 × 10¹⁰6.71 × 10⁷8.42 × 10⁹0.35
H100 SXMEuropean10⁸3.15 × 10¹⁰4.57 × 10⁷8.69 × 10⁹0.28
RTX 4090Asian, 64 dates10⁸1.25 × 10⁸–4.44 × 10⁶0.04
H100 SXMbarrier, 64 dates10⁸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

  1. 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. Print torch.get_float32_matmul_precision() and torch.backends.cuda.matmul.allow_tf32 in every backtest log.
  2. cuDNN TF32 is on by default. torch.backends.cudnn.allow_tf32 is 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.
  3. 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.
  4. Do not use fp16 or bf16 for covariances that feed a solver. They flip the sign of thousands of weights.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.compile failed 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.