Models · Optical flow

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

Checkpoint

Paper 2025 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 519 ms 1080x1920, fp16
vs the faster original 3.0× original fp16: 1533 ms
Peak memory 1,851 MiB original: 5,537 MiB
Accuracy vs original fp32 +0.029 kernels EPE, KITTI 2015 train (2.395 original)

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.

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original fp16torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t.json), iters=5fp16 1533–5,537 MiB/5,916 MiB2.02.20
Portable fp32fp32not measured ––––
Portablefp16 7911.9×3,553 MiB/4,076 MiB0.30.79
Kernelsfp16 5193.0×1,851 MiB/2,264 MiB0.60.52
Portable + torch.compile 6102.5×3,479 MiB/3,638 MiB85 (build)–
TensorRT fp16fp16 3434.5×1,238 MiBenginenot comparable166 (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

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-17Originalfp3222117 11.9 GiB process–1080x1920
Portablefp167168 7,185 MiB processmatches1080x1920
Portablefp328225 8,183 MiB processmatches1080x1920
Kernelsfp16not implemented–1080x1920
Kernelsfp32not 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
  • 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 Drive

fastforks 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 %

RundtypeEPE ↓Fl-all % ↓Δ EPE vs fp32 originalpairsms / pair
Original fp32fp322.3958.52 reference 100 378
Original fp16fp162.3758.52 +0.021 100 224
Portable fp32fp322.6219.12 −0.225 200 358
Portablefp162.3158.51 +0.080 100 155
Kernelsfp162.3678.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).

CheckToleranceMeasured
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 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
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.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
waft-a1synthetic (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-kittisynthetic (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-sintelsynthetic (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-a1 1080x1920 (3.5 GiB peak allocated, 4.0 reserved); waft-a1-kitti 1080x1920 (3.5 GiB peak allocated, 4.1 reserved); waft-a1-sintel 1080x1920 (3.5 GiB peak allocated, 4.0 reserved)
  • waft-a1 1080x1920, first call: portable + torch.compile 85 s (cold Inductor cache), TensorRT fp16 166 s (ONNX + engine).
  • waft-a1-kitti 1080x1920, first call: portable + torch.compile 84 s (cold Inductor cache), TensorRT fp16 168 s (ONNX + engine).
  • waft-a1-sintel 1080x1920, first call: portable + torch.compile 85 s (cold Inductor cache), TensorRT fp16 166 s (ONNX + engine).
  • waft-a1 original 1080x1920: torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t.json), iters=5
  • waft-a1-kitti original 1080x1920: torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t-kitti.json), iters=5
  • waft-a1-sintel original 1080x1920: torch.autocast(float16) around the call; upstream ViTWarpV8 (config/a1/tar-c-t-sintel.json), iters=5
  • waft-a1 load / 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-kitti load / 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-sintel load / 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.

variantdatasetoriginal fp32original fp16portableportable fp32kernelsnote
waft-a1KITTI 2015 train, EPE / Fl-all %2.395 / 8.522.375 / 8.522.315 / 8.512.621 / 9.122.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).

variantkernels error vs original, mean / p99GPU, torchkernels used
waft-a10.00414 / 0.01608RTX 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-a1-kitti0.00557 / 0.02456RTX 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-a1-sintel0.00336 / 0.01352RTX 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

Example output

No example rendered for this checkpoint yet.