LiteAnyStereo V2
LiteAnyStereo V2, an efficient zero-shot stereo family in sizes S, M, L and H.
stable Fork of TomTomTommi/LiteAnyStereo@8c97bd4 · backends: portable, kernels
- Paper Lite Any Stereo V2: Faster and Stronger Efficient Zero-Shot Stereo Matching arXiv · first released 23 Jun 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("las2-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 las2-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 | 62.0 | 0.70× | 1,676 MiB/1,746 MiB | – | – |
| Original fp16torch.autocast(fp16) around the forward | fp16 | 43.5 | – | 933 MiB/978 MiB | – | – |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 27.9 | 1.6× | 557 MiB/608 MiB | 0.7 | 0.03 |
| Kernels | fp16 | 14.3 | 3.0× | 226 MiB/320 MiB | 0.6 | 0.02 |
| Portable + torch.compile | 23.7 | 1.8× | 238 MiB/264 MiB | 22 (build) | – | |
| TensorRT fp16 | fp16 | 10.3 | 4.2× | 162 MiBenginenot comparable | 87 (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 | 273 | 4,556 MiB process | matches | 994x1482 |
| Portable | fp16 | 192 | 3,590 MiB process | matches | 994x1482 | |
| Portable | fp32 | 245 | 3,983 MiB process | matches | 994x1482 | |
| Kernels | fp16 | 198 | 2,620 MiB process | matches | 994x1482 | |
| NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 66.7 | 921 MiB/966 MiB | – | 994x1482 |
| Kernels | fp16 | 23.0 | 255 MiB/360 MiB | – | 994x1482 | |
| NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 28.2 | 921 MiB/966 MiB | – | 994x1482 |
| Kernels | fp16 | 15.3 | 255 MiB/340 MiB | – | 994x1482 | |
| NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 56.2 | 921 MiB/966 MiB | – | 994x1482 |
| Kernels | fp16 | 16.9 | 196 MiB/280 MiB | – | 994x1482 | |
| NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 30.5 | 921 MiB/966 MiB | – | 994x1482 |
| Kernels | fp16 | 15.7 | 255 MiB/360 MiB | – | 994x1482 | |
| NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 14.5 | 921 MiB/966 MiB | – | 994x1482 |
| Kernels | fp16 | 4.99 | 255 MiB/380 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
- MIT LICENSE
- Weights
- MIT source
- Training data
- Zero-shot model trained on a mixture of synthetic stereo datasets that includes FSD and Dynamic Replica (non-commercial data terms); the repository does not list the data or its terms
- Trained on a mixture that includes NVIDIA's FSD dataset and Dynamic Replica, whose terms for commercial use of trained models are unclear (the repository lists no data terms); the status does not depend on the training data.
Our reading of the licences, not legal advice.
Weights
LAS2_S.pth 24.4 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download las2-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 | 4.10 | 0.382 | reference | 27 | 18.7 |
| Original fp16 | fp16 | 4.10 | 0.382 | ±0.00 | 27 | 19.8 |
| Portable fp32 | fp32 | 4.10 | 0.382 | ±0.00 | 27 | 19.1 |
| Portable | fp16 | 4.10 | 0.382 | ±0.00 | 27 | 20.2 |
| Kernels | fp16 | 4.10 | 0.383 | ±0.00 | 27 | 12.6 |
| Original .half() | fp16 | 4.10 | 0.383 | ±0.00 | 27 | 18.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 | 16.19 | 3.464 | reference | 15 | 56.2 |
| Original fp16 | fp16 | 16.18 | 3.460 | +0.01 | 15 | 50.8 |
| Portable fp32 | fp32 | 16.19 | 3.464 | ±0.00 | 15 | 57.9 |
| Portable | fp16 | 16.18 | 3.460 | +0.01 | 15 | 49.9 |
| Kernels | fp16 | 16.18 | 3.461 | +0.01 | 15 | 18.4 |
| Original .half() | fp16 | 16.19 | 3.462 | ±0.00 | 15 | 39.2 |
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.05 px and p99 <= 0.5 px.
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 px | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.05 px | 0.00524 px |
| GPU default dtypes, p99 |diff| | ≤ 0.5 px | 0.01843 px |
Recorded for las2-s on RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-31, with these kernels: cudnn_hacccutlass_convigevstereo_ops
Details
LiteAnyStereo V2: efficient zero-shot stereo with FasterNet-T0 features, a correlation volume and FasterNet 2-D cost aggregation (sizes S / M / L), or a group-wise volume with a selective-GRU update (H).
- Input / output
- Input: a rectified left / right image pair. Output: a disparity map (pixels, left view).
- Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (7,119 MiB allocated)
- Options
cuda_graphs=true
- Outputs
disparity- Checkpoint
size="s"- CUDA kernels
igevIGEV stereo: convolution epilogues, correlation lookups, GRU gatescutlass_convCUTLASS convolutions with the recurrent update (GRU) fused incudnn_haccconvolutions with fp16 accumulation (cuDNN)stereo_opsstereo building blocks: cost volume, soft-argmax, upsampling
- Apple (MPS)
stereo_metalMetal: stereo kernels. fp32, fp16
Limitations
- The original code's LAS1 (LiteAnyStereo.pth, another architecture) is not included.
- Portable LAS2-H at 375 x 1242 is faster than the original code (35.6 vs 36.4 ms) but peaks 13 MB (3.7 %) higher (365 vs 352 MB). Kernels at 994 x 1482 allocate less than the original (917 vs 1022 MB) but reserve more (1248 vs 1084 MB): graph / cuDNN workspace blocks.
Full reference, generated from the repository
LiteAnyStereo V2, an efficient zero-shot stereo family in sizes S, M, L and H.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
las2-s | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 62.0 43.5 27.9 14.3 23.7 10.3 | 1676 / 1746 933 / 978 557 / 608 226 / 320 238 / 264 258 / 304 |
las2-m | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 79.1 52.4 37.1 18.1 28.6 13.2 | 1691 / 1762 948 / 1000 584 / 664 235 / 336 252 / 300 343 / 386 |
las2-l | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 154 90.8 75.7 30.1 46.6 23.4 | 1753 / 1812 1010 / 1082 648 / 716 268 / 362 385 / 432 393 / 424 |
las2-h | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 205 135 113 53.6 75.0 planned for 0.2.1 | 1839 / 1884 1022 / 1084 1002 / 1046 872 / 960 579 / 724 – |
Details
- Original code: https://github.com/TomTomTommi/LiteAnyStereo at
8c97bd4c4da3 - Code licence: MIT (permissive); files:
LICENSE - Weights licence: MIT
- Licence evidence: https://huggingface.co/tomtomtommi/LiteAnyStereoV2/blob/17788d91618646fa781a14462e2926a034b9f49d/README.md#L2
- Training data: Zero-shot model trained on a mixture of synthetic stereo datasets that includes FSD and Dynamic Replica (non-commercial data terms); the repository does not list the data or its terms
- Licence note: Trained on a mixture that includes NVIDIA's FSD dataset and Dynamic Replica, whose terms for commercial use of trained models are unclear (the repository lists no data terms); the status does not depend on the training data.
- Options:
cuda_graphs= True (speed only) - Kernel libraries:
igev,cutlass_conv,cudnn_hacc,stereo_ops - Variants:
las2-s,las2-m,las2-l,las2-h - Not in this release (planned for 0.2.1):
las2-hTensorRT export: the TensorRT 10 engine build fails (Myelin autotuner skips all tactics) - Outputs: disparity
- Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
las2-s3000x4000 (7.0 GiB peak allocated, 7.4 reserved);las2-m3000x4000 (7.0 GiB peak allocated, 7.4 reserved);las2-l3000x4000 (7.0 GiB peak allocated, 7.4 reserved);las2-h3000x4000 (8.5 GiB peak allocated, 11.7 reserved) las2-s994x1482, first call: portable + torch.compile 22 s (cold Inductor cache), TensorRT fp16 87 s (ONNX + engine).las2-m994x1482, first call: portable + torch.compile 24 s (cold Inductor cache), TensorRT fp16 98 s (ONNX + engine).las2-l994x1482, first call: portable + torch.compile 31 s (cold Inductor cache), TensorRT fp16 98 s (ONNX + engine).las2-h994x1482, first call: portable + torch.compile 37 s (cold Inductor cache).las2-soriginal 994x1482: torch.autocast(fp16) around the forwardlas2-moriginal 994x1482: torch.autocast(fp16) around the forwardlas2-loriginal 994x1482: torch.autocast(fp16) around the forwardlas2-horiginal 994x1482: torch.autocast(fp16) around the forwardlas2-sload / first call: original 0.11 s / 0.019 s (375x1242), portable 0.66 s / 0.342 s (375x1242), kernels 0.6 s / 0.175 s (375x1242)las2-mload / first call: original 0.17 s / 0.023 s (375x1242), portable 0.25 s / 0.402 s (375x1242), kernels 0.77 s / 0.179 s (375x1242)las2-lload / first call: original 0.39 s / 0.044 s (375x1242), portable 0.53 s / 0.329 s (375x1242), kernels 0.66 s / 0.177 s (375x1242)las2-hload / first call: original 0.26 s / 1.212 s (375x1242), portable 0.38 s / 0.409 s (375x1242), kernels 0.6 s / 0.243 s (375x1242)- Protocol,
las2-s,las2-h: first call, 3 warm-up, peak reset, median of 3 rounds x median of 5 - Protocol,
las2-m,las2-l: 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 |
|---|---|---|---|---|---|---|---|---|
las2-s | ETH3D two-view train, bad > 1 px % / EPE | 4.10 / 0.382 | 4.10 / 0.382 | 4.10 / 0.383 | 4.10 / 0.382 | 4.10 / 0.382 | 4.10 / 0.383 | possibly in the training data |
las2-s | Middlebury 2014 trainingH, bad > 2 px % / EPE | 16.19 / 3.464 | 16.18 / 3.460 | 16.19 / 3.462 | 16.18 / 3.460 | 16.19 / 3.464 | 16.18 / 3.461 | possibly in the training data |
las2-m | ETH3D two-view train, bad > 1 px % / EPE | 2.97 / 0.310 | 2.97 / 0.310 | 2.97 / 0.310 | 2.97 / 0.310 | 2.98 / 0.310 | 2.98 / 0.310 | possibly in the training data |
las2-m | Middlebury 2014 trainingH, bad > 2 px % / EPE | 11.24 / 2.324 | 11.23 / 2.324 | 11.26 / 2.325 | 11.23 / 2.324 | 11.24 / 2.324 | 11.24 / 2.324 | possibly in the training data |
las2-l | ETH3D two-view train, bad > 1 px % / EPE | 2.24 / 0.268 | 2.24 / 0.268 | 4.57 / 0.389 | 2.24 / 0.268 | 2.24 / 0.268 | 2.24 / 0.268 | possibly in the training data |
las2-l | Middlebury 2014 trainingH, bad > 2 px % / EPE | 11.87 / 2.615 | 11.85 / 2.614 | 17.75 / 3.202 | 11.85 / 2.614 | 11.87 / 2.615 | 11.85 / 2.614 | possibly in the training data |
las2-h | ETH3D two-view train, bad > 1 px % / EPE | 2.14 / 0.258 | 2.14 / 0.258 | 5.54 / 0.338 | 2.13 / 0.258 | 2.14 / 0.258 | 2.14 / 0.258 | possibly in the training data |
las2-h | Middlebury 2014 trainingH, bad > 2 px % / EPE | 9.27 / 2.141 | 9.28 / 2.141 | 12.62 / 2.546 | 9.27 / 2.141 | 9.27 / 2.141 | 9.27 / 2.141 | 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.05 px and p99 <= 0.5 px.
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
las2-s | 0.00524 / 0.01843 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120, stereo_ops@899b54f4a755:sm_120 |
las2-m | 0.00574 / 0.02524 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120, stereo_ops@899b54f4a755:sm_120 |
las2-l | 0.0082 / 0.04395 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120, stereo_ops@899b54f4a755:sm_120 |
las2-h | 0.00169 / 0.00883 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120, stereo_ops@899b54f4a755:sm_120 |
Limitations
- The original code's LAS1 (LiteAnyStereo.pth, another architecture) is not included.
- Portable LAS2-H at 375 x 1242 is faster than the original code (35.6 vs 36.4 ms) but peaks 13 MB (3.7 %) higher (365 vs 352 MB). Kernels at 994 x 1482 allocate less than the original (917 vs 1022 MB) but reserve more (1248 vs 1084 MB): graph / cuDNN workspace blocks.
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).