Models · Stereo matching

WAFT-Stereo

A stereo network from the Princeton Vision & Learning Lab that warps features instead of building a cost volume, in sizes S and B. The licence differs by size, see the table.

stable Fork of princeton-vl/WAFT-Stereo@c534320 · backends: portable, kernels

Checkpoint

Paper 2026 Added in 0.1.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 284 ms 994x1482, fp16
vs the faster original 2.4× original fp16: 689 ms
Peak memory 954 MiB original: 3,314 MiB
Accuracy vs original fp32 ±0.00 kernels bad px %, ETH3D two-view train (0.95 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import stereo

model = stereo.load("waft-stereo-s")  # kernels on a supported GPU, else portable PyTorch
result = model(left, right)
result.disparity
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench waft-stereo-s

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32 12520.55×3,764 MiB/4,352 MiB––
Original fp16torch.autocast(fp16) around the forwardfp16 689–3,314 MiB/3,398 MiB––
Portable fp32fp32not measured ––––
Portablefp16 6891.0×3,293 MiB/3,456 MiB0.60.69
Kernelsfp16 2842.4×954 MiB/1,102 MiB1.40.28
Portable + torch.compile 3571.9×2,024 MiB/2,058 MiB95 (build)–
TensorRT fp16fp16 1704.1×662 MiBenginenot comparable153 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-01 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14Originalfp324098 10,164 MiB processmatches994x1482
Portablefp166090 9,209 MiB processmatches994x1482
Portablefp323360 9,608 MiB processmatches994x1482
Kernelsfp16not implemented–994x1482
NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16853 3,266 MiB/3,434 MiB–994x1482
Kernelsfp16358 1,088 MiB/1,300 MiB–994x1482
NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16268 3,266 MiB/3,434 MiB–994x1482
Kernelsfp16100 1,100 MiB/1,262 MiB–994x1482
NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16605 3,266 MiB/3,434 MiB–994x1482
Kernelsfp16283 1,090 MiB/1,262 MiB–994x1482
NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp16298 3,266 MiB/3,434 MiB–994x1482
Kernelsfp16125 1,062 MiB/1,142 MiB–994x1482
NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp16159 3,290 MiB/3,454 MiB–994x1482
Kernelsfp1660.1 1,130 MiB/1,242 MiB–994x1482

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use allowed

Code
BSD-3-Clause LICENSE
Weights
BSD-3-Clause source
Training data
  • WAFT-Stereo-B is labelled CC-BY-NC-4.0 conservatively although the Hugging Face card says BSD-3-Clause: the checkpoint embeds a fine-tuned Depth Anything V2 ViT-B whose original weights are CC-BY-NC-4.0.
  • Both checkpoints were trained on data that includes NVIDIA's FSD dataset, whose terms for commercial use of trained models are unclear; the status does not depend on the training data.

Our reading of the licences, not legal advice.

Weights

DAv2S-4.pth 748 MB· hosted on Hugging Face

fastforks downloads and checks these files on first use (fastforks download waft-stereo-s).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

ETH3D two-view train

bad > 1 px % / EPEtraining data not stated: possibly seen

Rundtypebad px % ↓EPE ↓Δ bad px % vs fp32 originalpairsms / pair
Original fp32fp320.950.177 reference 27 182
Original fp16fp160.950.177 ±0.00 27 107
Portable fp32fp320.950.177 ±0.00 27 181
Portablefp160.950.177 ±0.00 27 104
Kernelsfp160.950.177 ±0.00 27 60.3
Original .half()fp160.950.178 ±0.00 27 92.4

Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16, original .half(): RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-05; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10, 2026-11-05.

Middlebury 2014 trainingH

bad > 2 px % / EPEtraining data not stated: possibly seen

Rundtypebad px % ↓EPE ↓Δ bad px % vs fp32 originalpairsms / pair
Original fp32fp324.750.895 reference 15 1014
Original fp16fp164.740.895 +0.01 15 573
Portable fp32fp324.750.895 ±0.00 15 1012
Portablefp164.750.895 ±0.00 15 571
Kernelsfp164.770.897 −0.02 15 238
Original .half()fp164.730.896 +0.02 15 422

Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16, original .half(): RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-05; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10, 2026-11-05.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 px and p99 <= 0.25 px.

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.002 pxnot recorded
GPU default dtypes, mean |diff|≤ 0.02 px0.0013 px
GPU default dtypes, p99 |diff|≤ 0.25 px0.00398 px

Recorded for waft-stereo-s on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-15, with these kernels: cudnn_hacccutlass_convdpt_fusedfastbbigev

Details

WAFT-Stereo (Wang and Deng 2025): warping instead of a cost volume; Depth Anything V2 (LoRA) features, a ViT-based disparity proposal and 3 warp-and-refine iterations.

Input / output
Input: a rectified left / right image pair. Output: a disparity map (pixels, left view).
Input size
any H x W >= 17, resized or padded inside the model; tested up to 1024x2048 (5,405 MiB allocated)
Outputs
disparity
Checkpoint
arch="vits"
CUDA kernels
  • igevIGEV stereo: convolution epilogues, correlation lookups, GRU gates
  • cutlass_convCUTLASS convolutions with the recurrent update (GRU) fused in
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
  • fastbbfast backbone kernels: flash attention, window attention, instance norm and rotary embeddings for ViT and similar backbones
  • dpt_fusedfused fp16 matrix multiplies and convolutions for DINOv2 backbones and DPT depth heads
Apple (MPS)
fp32, fp16

Limitations

  • Only the two SynLarge checkpoints (S, B) are included; DAv2L-5 and the Real / KITTI / Middlebury fine-tunes are not.
  • Portable WAFT-B is slightly slower than the original code and allocates slightly more memory; kernels is about 3x faster with a third of the memory.
  • WAFT-Stereo-B kernels runs its ViT attention with fp16 accumulation: single attention outputs differ from fp32 by up to 34 % (relative), but end-to-end ETH3D / Middlebury-H accuracy matches the fp32 original (EPE 0.163 / 0.728).
Full reference, generated from the repository

A stereo network from the Princeton Vision & Learning Lab that warps features instead of building a cost volume, in sizes S and B. The licence differs by size, see the table.

Commercial use: waft-stereo-s: yes; waft-stereo-b: no (weights: CC-BY-NC-4.0).

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
waft-stereo-sMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
1252
689
689
284
357
170
3764 / 4352
3314 / 3398
3293 / 3456
954 / 1102
2024 / 2058
1061 / 1114
waft-stereo-bMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
1898
1140
1137
388
571
planned for 0.2.1
7348 / 7528
5743 / 5876
5775 / 5852
1664 / 1932
3908 / 3936
–
Details
  • Original code: https://github.com/princeton-vl/WAFT-Stereo at c534320860f4
  • Code licence: BSD-3-Clause (permissive); files: LICENSE
  • Weights licence: BSD-3-Clause
    • waft-stereo-b: CC-BY-NC-4.0
  • Licence evidence: https://github.com/princeton-vl/WAFT-Stereo/blob/c534320860f4bbb2c0df896e3ccb95de49284aec/LICENSE; vendored files (net/*.py) checked against c534320: none carries an NVIDIA or FoundationStereo header, original only credits FoundationStereo in its README, so BSD-3-Clause holds
  • Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa), not stated by the authors (SceneFlow, TartanAir, CREStereo, Falling Things, Sintel, Virtual KITTI 2, UnrealStereo4K, WMGStereo, CARLA, Spring, TartanGround, FSD (configs/SynLarge/*.yaml); only SceneFlow is in datasets.toml)
  • Licence note: WAFT-Stereo-B is labelled CC-BY-NC-4.0 conservatively although the Hugging Face card says BSD-3-Clause: the checkpoint embeds a fine-tuned Depth Anything V2 ViT-B whose original weights are CC-BY-NC-4.0.
  • Licence note: Both checkpoints were trained on data that includes NVIDIA's FSD dataset, whose terms for commercial use of trained models are unclear; the status does not depend on the training data.
  • Kernel libraries: igev, cutlass_conv, cudnn_hacc, fastbb, dpt_fused
  • Variants: waft-stereo-s, waft-stereo-b
  • Not in this release (planned for 0.2.1): waft-stereo-b TensorRT export: the fp16 engine outputs all NaN. At 994x1482, the fp32 builder also fails when a tactic requests 6.6 GiB of workspace with a 6 GiB cap
  • Outputs: disparity
  • Input size: any H x W >= 17, resized or padded inside the model
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): waft-stereo-s 1024x2048 (5.3 GiB peak allocated, 8.3 reserved); waft-stereo-b 1024x1024 (3.2 GiB peak allocated, 4.7 reserved)
  • waft-stereo-s 994x1482, first call: portable + torch.compile 95 s (cold Inductor cache), TensorRT fp16 152 s (ONNX + engine).
  • waft-stereo-b 994x1482, first call: portable + torch.compile 104 s (cold Inductor cache).
  • waft-stereo-s original 994x1482: torch.autocast(fp16) around the forward
  • waft-stereo-b original 994x1482: torch.autocast(fp16) around the forward
  • waft-stereo-s load / first call: original 1.6 s / 0.14 s (375x1242), portable 0.58 s / 0.691† s, kernels 1.47 s / 0.32 s (375x1242)
  • waft-stereo-b load / first call: original 3.07 s / 0.444 s (375x1242), portable 1.65 s / 1.148† s, kernels 1.77 s / 0.459 s (375x1242)
  • † measured in the speed sweep after the portable load (or an earlier size) in the same process: file cache and kernels are warm, so the time is lower than a fresh start.
  • Protocol, median of 5 after 3 warm-up, uint8 CUDA input (synthetic for bench_inputs sizes), card defaults; gc before each load; peak = max over the first call and the timed calls

Measured

Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16original halfportableportable fp32kernelsnote
waft-stereo-sETH3D two-view train, bad > 1 px % / EPE0.95 / 0.1770.95 / 0.1770.95 / 0.1780.95 / 0.1770.95 / 0.1770.95 / 0.177possibly in the training data
waft-stereo-sMiddlebury 2014 trainingH, bad > 2 px % / EPE4.75 / 0.8954.74 / 0.8954.73 / 0.8964.75 / 0.8954.75 / 0.8954.77 / 0.897possibly in the training data
waft-stereo-bETH3D two-view train, bad > 1 px % / EPE0.74 / 0.1630.74 / 0.1630.76 / 0.1650.74 / 0.1630.74 / 0.1630.74 / 0.163possibly in the training data
waft-stereo-bMiddlebury 2014 trainingH, bad > 2 px % / EPE3.38 / 0.7283.39 / 0.7283.37 / 0.7323.38 / 0.7293.39 / 0.7283.38 / 0.728possibly in the training data

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 468fba10, 2026-11-05.

Parity

CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 px and p99 <= 0.25 px.

variantkernels error vs original, mean / p99GPU, torchkernels used
waft-stereo-s0.0013 / 0.00398RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120, igev@f075827d68c6:sm_120
waft-stereo-b0.0013 / 0.00417RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120, igev@f075827d68c6:sm_120

Limitations

  • Only the two SynLarge checkpoints (S, B) are included; DAv2L-5 and the Real / KITTI / Middlebury fine-tunes are not.
  • Portable WAFT-B is slightly slower than the original code and allocates slightly more memory; kernels is about 3x faster with a third of the memory.
  • WAFT-Stereo-B kernels runs its ViT attention with fp16 accumulation: single attention outputs differ from fp32 by up to 34 % (relative), but end-to-end ETH3D / Middlebury-H accuracy matches the fp32 original (EPE 0.163 / 0.728).

Example output

One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).

Left view
Right view
Output
Motorcycle, Middlebury 2014 stereo (left and right view, downscaled 4x), left view
Left view · 100%

Input: Motorcycle, Middlebury 2014 stereo (left and right view, downscaled 4x), Scharstein et al., Middlebury College (research dataset, no licence stated).