Models · Stereo matching

GwcNet

A classic stereo network by Xiaoyang Guo et al. that builds a group-wise correlation cost volume.

stable Fork of xy-guo/GwcNet@0987074 · backends: portable, kernels

Checkpoint

Paper 2019 Added in 0.1.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 257 ms 994x1482, fp16
vs the faster original 1.4× original fp16: 365 ms
Peak memory 1,768 MiB original: 5,887 MiB
Accuracy vs original fp32 +0.01 kernels bad px %, ETH3D two-view train (10.97 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("gwcnet-gc-sceneflow")  # kernels on a supported GPU, else portable PyTorch
result = model(left, right)
result.disparity
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench gwcnet-gc-sceneflow

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 6320.58×8,252 MiB/8,822 MiB––
Original fp16torch.autocast(fp16) around the forwardfp16 365–5,887 MiB/6,214 MiB––
Portable fp32fp32not measured ––––
Portablefp16 3531.0×2,082 MiB/2,402 MiB0.40.35
Kernelsfp16 2571.4×1,768 MiB/1,962 MiB0.40.26
Portable + torch.compile 4200.87×1,774 MiB/2,246 MiB84 (build)–
TensorRT fp16fp16 6690.55×2,644 MiBenginenot comparable117 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-01 to 2026-11-03. 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. 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-14Originalfp32out of memory–994x1482
Portablefp162455 7,108 MiB processmatches994x1482
Portablefp324461 12.1 GiB processmatches994x1482
Kernelsfp16not implemented–994x1482
NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16413 1,801 MiB/2,102 MiB–994x1482
Kernelsfp16342 1,783 MiB/2,322 MiB–994x1482
NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16152 1,801 MiB/2,102 MiB–994x1482
Kernelsfp16109 1,783 MiB/2,322 MiB–994x1482
NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16297 1,801 MiB/2,102 MiB–994x1482
Kernelsfp16244 1,765 MiB/1,942 MiB–994x1482
NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16166 1,801 MiB/2,102 MiB–994x1482
Kernelsfp1697.7 1,765 MiB/1,942 MiB–994x1482
NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp16104 2,047 MiB/2,142 MiB–994x1482
Kernelsfp1656.7 1,765 MiB/1,942 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 (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

sceneflow/gwcnet-gc/checkpoint_000015.ckpt 83.1 MB· inside a 298 MB archive· hosted on Google Drive

fastforks downloads and checks these files on first use (fastforks download gwcnet-gc-sceneflow).

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 % / EPE

Rundtypebad px % ↓EPE ↓Δ bad px % vs fp32 originalpairsms / pair
Original fp32fp3210.971.794 reference 27 147
Original fp16fp1610.971.794 ±0.00 27 88.1
Portable fp32fp3210.971.794 ±0.00 27 152
Portablefp1610.951.787 +0.02 27 86.9
Kernelsfp1610.961.793 +0.01 27 64.7
Original .half()fp1610.951.787 +0.02 27 84.9

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 % / EPE

Rundtypebad px % ↓EPE ↓Δ bad px % vs fp32 originalpairsms / pair
Original fp32fp3225.636.967 reference 15 533
Original fp16fp1625.636.970 ±0.00 15 308
Portable fp32fp3225.636.971 ±0.00 15 527
Portablefp1625.636.968 ±0.00 15 299
Kernelsfp1625.636.974 ±0.00 15 218
Original .half()fp1625.616.968 +0.02 15 295

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.

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.002 pxnot recorded
GPU default dtypes, mean |diff|≤ 0.05 px0.00494 px
GPU default dtypes, p99 |diff|≤ 0.5 px0.01739 px

Recorded for gwcnet-gc-sceneflow on RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-31, with these kernels: cudnn_hacccutlass_convigev

Details

GwcNet (Guo et al. 2019): group-wise correlation 3-D cost volume, stacked 3-D hourglasses and soft-argmin regression (max disparity 192).

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 (13.6 GiB allocated)
Outputs
disparity
Checkpoint
concat_volume=true
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)
Apple (MPS)
fp32, fp16

Limitations

  • The original code's KITTI 2012 / 2015 fine-tuned weights are not included.
  • The dominant 3D convolutions run in cuDNN in both modes, so kernels gains less over portable than for other stereo models. Portable is slightly slower than the original code at 994x1482 but allocates less than half the memory.
Full reference, generated from the repository

A classic stereo network by Xiaoyang Guo et al. that builds a group-wise correlation cost volume.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
gwcnet-gc-sceneflowMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
632
365
353
257
420
669
8252 / 8822
5887 / 6214
2082 / 2402
1768 / 1962
1774 / 2246
2732 / 2786
gwcnet-g-sceneflowMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
604
352
344
238
417
275
6691 / 7280
5105 / 5414
2081 / 2402
1799 / 2102
1527 / 1864
3634 / 3648
Details
  • Original code: https://github.com/xy-guo/GwcNet at 0987074f48b0
  • Code licence: MIT (permissive); files: LICENSE
  • Weights licence: MIT (assumed from code)
  • Licence evidence: https://github.com/xy-guo/GwcNet/blob/0987074f48b098c6e975a58ca5aacf233b0fb0eb/README.md#L27
  • Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa)
  • Kernel libraries: igev, cutlass_conv, cudnn_hacc
  • Variants: gwcnet-gc-sceneflow, gwcnet-g-sceneflow
  • 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): gwcnet-gc-sceneflow 3000x4000 (13.6 GiB peak allocated, 13.7 reserved); gwcnet-g-sceneflow 3000x4000 (13.3 GiB peak allocated, 14.8 reserved)
  • gwcnet-gc-sceneflow 994x1482, first call: portable + torch.compile 84 s (cold Inductor cache), TensorRT fp16 117 s (ONNX + engine).
  • gwcnet-g-sceneflow 994x1482, first call: portable + torch.compile 53 s (cold Inductor cache), TensorRT fp16 66 s (ONNX + engine).
  • gwcnet-gc-sceneflow original 994x1482: torch.autocast(fp16) around the forward
  • gwcnet-g-sceneflow original 994x1482: torch.autocast(fp16) around the forward
  • gwcnet-gc-sceneflow load / first call: original 0.29 s / 0.119 s (375x1242), portable 0.39 s / 0.353† s, kernels 0.44† s / 0.258† s
  • gwcnet-g-sceneflow load / first call: original 0.26 s / 0.46 s (375x1242), portable 0.4 s / 0.344† s, kernels 0.14† s / 0.238† s
  • † 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
gwcnet-gc-sceneflowETH3D two-view train, bad > 1 px % / EPE10.97 / 1.79410.97 / 1.79410.95 / 1.78710.95 / 1.78710.97 / 1.79410.96 / 1.793
gwcnet-gc-sceneflowMiddlebury 2014 trainingH, bad > 2 px % / EPE25.63 / 6.96725.63 / 6.97025.61 / 6.96825.63 / 6.96825.63 / 6.97125.63 / 6.974
gwcnet-g-sceneflowETH3D two-view train, bad > 1 px % / EPE9.60 / 0.6209.60 / 0.6229.60 / 0.6249.60 / 0.6249.59 / 0.6229.59 / 0.621
gwcnet-g-sceneflowMiddlebury 2014 trainingH, bad > 2 px % / EPE25.84 / 6.71225.84 / 6.71425.82 / 6.71325.84 / 6.71325.84 / 6.71425.84 / 6.713

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.

variantkernels error vs original, mean / p99GPU, torchkernels used
gwcnet-gc-sceneflow0.00494 / 0.01739RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120
gwcnet-g-sceneflow0.00375 / 0.01272RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120

Limitations

  • The original code's KITTI 2012 / 2015 fine-tuned weights are not included.
  • The dominant 3D convolutions run in cuDNN in both modes, so kernels gains less over portable than for other stereo models. Portable is slightly slower than the original code at 994x1482 but allocates less than half the memory.

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