Models · Stereo matching

Cas-GwcNet

Alibaba's cascade version of GwcNet: two cost-volume stages, the second narrowed around the first disparity. Trained on synthetic data. Commercially usable.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
cas-gwcnet-gc-sceneflowMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
862
567
472
358
10079 / 10652
8317 / 8730
2338 / 2794
2272 / 2514
cas-gwcnet-c-sceneflowMiddlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
656
389
327
225
295
220
4816 / 5534
2791 / 2970
2006 / 2474
1725 / 1930
2098 / 2448
1440 (engine)
Details
  • Original code: https://github.com/alibaba/cascade-stereo at 2ae7da65515c
  • Code licence: MIT (permissive); files: LICENSE
  • Weights licence: MIT (assumed from code)
  • Licence evidence: https://github.com/alibaba/cascade-stereo/blob/2ae7da65515c82025383a0fbee8d6fe063dc7101/CasStereoNet/README.md#L17-L19
  • Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa)
  • Kernel libraries: igev, cutlass_conv, cudnn_hacc
  • Variants: cas-gwcnet-gc-sceneflow, cas-gwcnet-c-sceneflow
  • Outputs: disparity
  • Input size:
    • cas-gwcnet-gc-sceneflow: any H x W >= 32, padded to a multiple of 32
    • cas-gwcnet-c-sceneflow: any H x W >= 225, padded to a multiple of 32
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): cas-gwcnet-gc-sceneflow 1988x2880 (9.4 GiB peak allocated, 14.1 reserved); cas-gwcnet-c-sceneflow 1988x2880 (8.2 GiB peak allocated, 9.2 reserved)
  • cas-gwcnet-c-sceneflow 994x1482, first call: portable + torch.compile 62 s (cold Inductor cache), TensorRT fp16 131 s (ONNX + engine).
  • cas-gwcnet-gc-sceneflow original 994x1482: torch.autocast(float16) around the call
  • cas-gwcnet-c-sceneflow original 994x1482: torch.autocast(fp16) around the forward
  • cas-gwcnet-gc-sceneflow load / first call: original 0.39 s / 0.636 s, portable 0.97 s / 0.472† s, kernels 0.17† s / 0.358† s
  • cas-gwcnet-c-sceneflow load / first call: original 0.48 s / 0.415 s (375x1242), portable 1.29 s / 0.327† s, kernels 0.18† s / 0.226† 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 fp16portablekernelsnote
cas-gwcnet-gc-sceneflowETH3D two-view train, bad > 1 px % / EPE8.08 / 0.82199.90 / 13.127 (NaN / inf output)8.08 / 0.8238.09 / 0.823
cas-gwcnet-gc-sceneflowMiddlebury 2014 trainingH, bad > 2 px % / EPE23.83 / 6.54199.80 / 70.838 (NaN / inf output)23.84 / 6.54723.83 / 6.541
cas-gwcnet-c-sceneflowETH3D two-view train, bad > 1 px % / EPE7.85 / 0.5127.83 / 0.5137.84 / 0.5127.85 / 0.513
cas-gwcnet-c-sceneflowMiddlebury 2014 trainingH, bad > 2 px % / EPE30.07 / 8.56829.90 / 8.49030.07 / 8.56930.07 / 8.574

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
cas-gwcnet-gc-sceneflow0.00441 / 0.07446RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120
cas-gwcnet-c-sceneflow0.00354 / 0.02642RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120