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
- Paper WAFT-Stereo: Warping-Alone Field Transforms for Stereo Matching arXiv · first released 25 Mar 2026
Paper 2026 Added in 0.1.0 Evaluated with 0.2.0
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.
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 1252 | 0.55× | 3,764 MiB/4,352 MiB | – | – |
| Original fp16torch.autocast(fp16) around the forward | fp16 | 689 | – | 3,314 MiB/3,398 MiB | – | – |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 689 | 1.0× | 3,293 MiB/3,456 MiB | 0.6 | 0.69 |
| Kernels | fp16 | 284 | 2.4× | 954 MiB/1,102 MiB | 1.4 | 0.28 |
| Portable + torch.compile | 357 | 1.9× | 2,024 MiB/2,058 MiB | 95 (build) | – | |
| TensorRT fp16 | fp16 | 170 | 4.1× | 662 MiBenginenot comparable | 153 (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
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 4098 | 10,164 MiB process | matches | 994x1482 |
| Portable | fp16 | 6090 | 9,209 MiB process | matches | 994x1482 | |
| Portable | fp32 | 3360 | 9,608 MiB process | matches | 994x1482 | |
| Kernels | fp16 | not implemented | – | 994x1482 | ||
| NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 853 | 3,266 MiB/3,434 MiB | – | 994x1482 |
| Kernels | fp16 | 358 | 1,088 MiB/1,300 MiB | – | 994x1482 | |
| NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 268 | 3,266 MiB/3,434 MiB | – | 994x1482 |
| Kernels | fp16 | 100 | 1,100 MiB/1,262 MiB | – | 994x1482 | |
| NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 605 | 3,266 MiB/3,434 MiB | – | 994x1482 |
| Kernels | fp16 | 283 | 1,090 MiB/1,262 MiB | – | 994x1482 | |
| NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 298 | 3,266 MiB/3,434 MiB | – | 994x1482 |
| Kernels | fp16 | 125 | 1,062 MiB/1,142 MiB | – | 994x1482 | |
| NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 159 | 3,290 MiB/3,454 MiB | – | 994x1482 |
| Kernels | fp16 | 60.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
-
- Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa) research-only, non-commercial
- 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 Facefastforks 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
| Run | dtype | bad px % ↓ | EPE ↓ | Δ bad px % vs fp32 original | pairs | ms / pair |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 0.95 | 0.177 | reference | 27 | 182 |
| Original fp16 | fp16 | 0.95 | 0.177 | ±0.00 | 27 | 107 |
| Portable fp32 | fp32 | 0.95 | 0.177 | ±0.00 | 27 | 181 |
| Portable | fp16 | 0.95 | 0.177 | ±0.00 | 27 | 104 |
| Kernels | fp16 | 0.95 | 0.177 | ±0.00 | 27 | 60.3 |
| Original .half() | fp16 | 0.95 | 0.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
| Run | dtype | bad px % ↓ | EPE ↓ | Δ bad px % vs fp32 original | pairs | ms / pair |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 4.75 | 0.895 | reference | 15 | 1014 |
| Original fp16 | fp16 | 4.74 | 0.895 | +0.01 | 15 | 573 |
| Portable fp32 | fp32 | 4.75 | 0.895 | ±0.00 | 15 | 1012 |
| Portable | fp16 | 4.75 | 0.895 | ±0.00 | 15 | 571 |
| Kernels | fp16 | 4.77 | 0.897 | −0.02 | 15 | 238 |
| Original .half() | fp16 | 4.73 | 0.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.
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 px | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.02 px | 0.0013 px |
| GPU default dtypes, p99 |diff| | ≤ 0.25 px | 0.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 gatescutlass_convCUTLASS convolutions with the recurrent update (GRU) fused incudnn_haccconvolutions with fp16 accumulation (cuDNN)fastbbfast backbone kernels: flash attention, window attention, instance norm and rotary embeddings for ViT and similar backbonesdpt_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).
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
waft-stereo-s | Middlebury 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-b | Middlebury 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-bTensorRT 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-s1024x2048 (5.3 GiB peak allocated, 8.3 reserved);waft-stereo-b1024x1024 (3.2 GiB peak allocated, 4.7 reserved) waft-stereo-s994x1482, first call: portable + torch.compile 95 s (cold Inductor cache), TensorRT fp16 152 s (ONNX + engine).waft-stereo-b994x1482, first call: portable + torch.compile 104 s (cold Inductor cache).waft-stereo-soriginal 994x1482: torch.autocast(fp16) around the forwardwaft-stereo-boriginal 994x1482: torch.autocast(fp16) around the forwardwaft-stereo-sload / 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-bload / 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.
| variant | dataset | original fp32 | original fp16 | original half | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|---|
waft-stereo-s | ETH3D two-view train, bad > 1 px % / EPE | 0.95 / 0.177 | 0.95 / 0.177 | 0.95 / 0.178 | 0.95 / 0.177 | 0.95 / 0.177 | 0.95 / 0.177 | possibly in the training data |
waft-stereo-s | Middlebury 2014 trainingH, bad > 2 px % / EPE | 4.75 / 0.895 | 4.74 / 0.895 | 4.73 / 0.896 | 4.75 / 0.895 | 4.75 / 0.895 | 4.77 / 0.897 | possibly in the training data |
waft-stereo-b | ETH3D two-view train, bad > 1 px % / EPE | 0.74 / 0.163 | 0.74 / 0.163 | 0.76 / 0.165 | 0.74 / 0.163 | 0.74 / 0.163 | 0.74 / 0.163 | possibly in the training data |
waft-stereo-b | Middlebury 2014 trainingH, bad > 2 px % / EPE | 3.38 / 0.728 | 3.39 / 0.728 | 3.37 / 0.732 | 3.38 / 0.729 | 3.39 / 0.728 | 3.38 / 0.728 | possibly 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.
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
waft-stereo-s | 0.0013 / 0.00398 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120, igev@f075827d68c6:sm_120 |
waft-stereo-b | 0.0013 / 0.00417 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_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).
Input: Motorcycle, Middlebury 2014 stereo (left and right view, downscaled 4x), Scharstein et al., Middlebury College (research dataset, no licence stated).