WAFT
WAFT a1 (Princeton, 2025): optical flow without a cost volume. Each step warps the second image's features by the current flow and a small vision transformer refines it; uses a frozen Depth Anything V2 Small. BSD-3-Clause code; the authors' weights carry no separate licence.
experimental Fork of princeton-vl/WAFT@b152ff1 · backends: portable, kernels
- Paper WAFT: Warping-Alone Field Transforms for Optical Flow arXiv · first released 26 Jun 2025
Paper 2025 Added in 0.2.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 flow
model = flow.load("waft-a1") # kernels on a supported GPU, else portable PyTorch
result = model(frame1, frame2)
result.flow
result.backend # what ran: mode, device, dtype, kernels fastforks bench waft-a1 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 | not measured | – | – | – | – |
| Original fp16torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t.json), iters=5 | fp16 | 1533 | – | 5,537 MiB/5,916 MiB | 2.0 | 2.20 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 791 | 1.9× | 3,553 MiB/4,076 MiB | 0.3 | 0.79 |
| Kernels | fp16 | 519 | 3.0× | 1,851 MiB/2,264 MiB | 0.6 | 0.52 |
| Portable + torch.compile | 610 | 2.5× | 3,479 MiB/3,638 MiB | 85 (build) | – | |
| TensorRT fp16 | fp16 | 343 | 4.5× | 1,238 MiBenginenot comparable | 166 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-14 to 2026-11-15. 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-17 | Original | fp32 | 22117 | 11.9 GiB process | – | 1080x1920 |
| Portable | fp16 | 7168 | 7,185 MiB process | matches | 1080x1920 | |
| Portable | fp32 | 8225 | 8,183 MiB process | matches | 1080x1920 | |
| Kernels | fp16 | not implemented | – | 1080x1920 | ||
| Kernels | fp32 | not implemented | – | 1080x1920 | ||
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 (assumed from code)(not stated by the authors; assumed to follow the code) source
- Training data
-
- TartanAir CC-BY-4.0
- FlyingChairs (Freiburg) research-only, non-commercial
- Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa) research-only, non-commercial
- weights licence not stated by the original authors; assumed to be the code licence
Our reading of the licences, not legal advice.
Weights
waft-a1-tar-c-t.pth 257 MB· hosted on Google Drivefastforks downloads and checks these files on first use (fastforks download waft-a1).
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.
KITTI 2015 train
EPE / Fl-all %
| Run | dtype | EPE ↓ | Fl-all % ↓ | Δ EPE vs fp32 original | pairs | ms / pair |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 2.395 | 8.52 | reference | 100 | 378 |
| Original fp16 | fp16 | 2.375 | 8.52 | +0.021 | 100 | 224 |
| Portable fp32 | fp32 | 2.621 | 9.12 | −0.225 | 200 | 358 |
| Portable | fp16 | 2.315 | 8.51 | +0.080 | 100 | 155 |
| Kernels | fp16 | 2.367 | 8.53 | +0.029 | 100 | 91.6 |
Frames _10 -> _11 at full size against the flow_occ ground truth; EPE = mean of the per-pair mean end-point error, Fl-all = share of all valid pixels with an error > 3 px and > 5 % of the GT magnitude. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6f0a70e1, 2026-11-17; portable: RTX 5060 Ti, torch 2.14.1+cu130, fastforks ec1d48ea, 2026-11-14; kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 68b2f345, 2026-11-16.
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.005 and p99 <= 0.02 (absolute error of the output flow).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.005 | 0.00414 |
| GPU default dtypes, p99 |diff| | ≤ 0.02 | 0.01608 |
| gpu_mean_kernels | ≤ 0.008 | not recorded |
| gpu_p99_kernels | ≤ 0.04 | not recorded |
Recorded for waft-a1 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-15, with these kernels: cudnn_hacccutlass_convdpt_fusedfastbbigev
Details
WAFT (Wang & Deng 2025), version a1: optical flow without a cost volume. A frozen Depth Anything V2 Small and a ResNet18 encoder give half-resolution features; each of 5 iterations warps the second image's features by the current flow and a small ViT-S (patch 8) refines the flow, which is convex-upsampled to full resolution. The authors' released weights; the network is ported from princeton-vl/WAFT. `waft-a1` is the general checkpoint the authors recommend for downstream use (TartanAir, FlyingChairs, FlyingThings3D); `-kitti` and `-sintel` are their benchmark fine-tunes.
- Input / output
- Input: two RGB images (consecutive frames). Output: per-pixel motion from the first to the second (dx, dy in pixels).
- Input size
- any H x W >= 112, resized or padded inside the model; tested up to 1080x1920 (3,553 MiB allocated)
- Options
iters=5>= 1· changes the output
- Outputs
flow- 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
Full reference, generated from the repository
WAFT a1 (Princeton, 2025): optical flow without a cost volume. Each step warps the second image's features by the current flow and a small vision transformer refines it; uses a frozen Depth Anything V2 Small. BSD-3-Clause code; the authors' weights carry no separate licence.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
waft-a1 | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 1533 791 519 610 343 | 5537 / 5916 3553 / 4076 1851 / 2264 3479 / 3638 1625 / 1672 |
waft-a1-kitti | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 1533 791 519 610 343 | 5537 / 5936 3553 / 4196 1851 / 2264 3479 / 3758 1625 / 1672 |
waft-a1-sintel | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 1533 791 519 610 343 | 5537 / 5916 3553 / 4076 1851 / 2264 3479 / 3578 1625 / 1672 |
Details
- Original code: https://github.com/princeton-vl/WAFT at
b152ff1cad1a - Code licence: BSD-3-Clause (permissive); files:
LICENSE - Weights licence: BSD-3-Clause (assumed from code)
- Licence evidence: https://github.com/princeton-vl/WAFT/blob/b152ff1cad1af8c185ee7b141997c48ff3334c87/README.md#model-zoo
- Training data: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa) (TartanAir pretraining, FlyingChairs, then FlyingThings3D (part of SceneFlow), as the checkpoint name tar-c-t says; the Depth Anything V2 Small inside was trained by its authors on synthetic and pseudo-labelled real images)
waft-a1-kitti: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa), MPI Sintel optical flow, KITTI stereo / optical flow 2012 / 2015, HCI HD1K optical flow benchmark (TartanAir, FlyingChairs, FlyingThings3D, then fine-tuned on KITTI 2015 (5000 steps; the config does not name the starting checkpoint, counted as the TSKH stage as in SEA-RAFT))waft-a1-sintel: TartanAir, FlyingChairs (Freiburg), Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa), MPI Sintel optical flow, KITTI stereo / optical flow 2012 / 2015, HCI HD1K optical flow benchmark (TartanAir, FlyingChairs, FlyingThings3D, then the mix of FlyingThings3D, Sintel, KITTI 2015 and HD1K (TSKH))
- Options:
iters= 5 (>= 1) - Kernel libraries:
igev,cutlass_conv,cudnn_hacc,fastbb,dpt_fused - Variants:
waft-a1,waft-a1-kitti,waft-a1-sintel - Outputs: flow
- Input size: any H x W >= 112, resized or padded inside the model
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
waft-a11080x1920 (3.5 GiB peak allocated, 4.0 reserved);waft-a1-kitti1080x1920 (3.5 GiB peak allocated, 4.1 reserved);waft-a1-sintel1080x1920 (3.5 GiB peak allocated, 4.0 reserved) waft-a11080x1920, first call: portable + torch.compile 85 s (cold Inductor cache), TensorRT fp16 166 s (ONNX + engine).waft-a1-kitti1080x1920, first call: portable + torch.compile 84 s (cold Inductor cache), TensorRT fp16 168 s (ONNX + engine).waft-a1-sintel1080x1920, first call: portable + torch.compile 85 s (cold Inductor cache), TensorRT fp16 166 s (ONNX + engine).waft-a1original 1080x1920: torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t.json), iters=5waft-a1-kittioriginal 1080x1920: torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t-kitti.json), iters=5waft-a1-sinteloriginal 1080x1920: torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t-sintel.json), iters=5waft-a1load / first call: original 5.87 s / 3.409 s, portable 0.51 s / 0.79 s, kernels 0.57 s / 0.21 s (375x1242)waft-a1-kittiload / first call: original 4.06 s / 2.874 s, portable 0.54 s / 0.79 s, kernels 1.4 s / 0.285 s (375x1242)waft-a1-sintelload / first call: original 2.93 s / 2.873 s, portable 0.51 s / 0.79 s, kernels 0.69 s / 0.21 s (375x1242)- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
Frames _10 -> _11 at full size against the flow_occ ground truth; EPE = mean of the per-pair mean end-point error, Fl-all = share of all valid pixels with an error > 3 px and > 5 % of the GT magnitude. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
waft-a1 | KITTI 2015 train, EPE / Fl-all % | 2.395 / 8.52 | 2.375 / 8.52 | 2.315 / 8.51 | 2.621 / 9.12 | 2.367 / 8.53 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks ec1d48ea, 2026-11-14; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6f0a70e1, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 68b2f345, 2026-11-16.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.005 and p99 <= 0.02 (absolute error of the output flow).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
waft-a1 | 0.00414 / 0.01608 | 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-a1-kitti | 0.00557 / 0.02456 | 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-a1-sintel | 0.00336 / 0.01352 | 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 |
Example output
No example rendered for this checkpoint yet.