RiptideRiptide
Download Riptide SDKInstall Riptorch
Menu
Whitepapers · Riptide · Exact integers on GPUs

Exact image and audio filters on GPUs

An 8-bit image filtered with an integer kernel, or 16-bit audio filtered with integer taps, has one exact answer. GPU libraries compute it in floating point or in 8-bit fixed point, and many of their outputs differ from it. This paper measures exact integer kernels for the common filters against every major GPU library at its fastest setting, and records how often each library's output is wrong.

Version
1
Date
1 December 2026
Author
Samario Torres, Riptide
Software
Riptide's GPU filter kernels (not published), compiled at run time with NVRTC 13.2 (CuPy 14.2); OpenCV 4.13.0 with CUDA 13.1 (cudawarped build); NPP 13.2; CV-CUDA 0.19.0; cuCIM 26.10 (B200 run only); PyTorch 2.15.0+cu132 with cuDNN 9.26 and torch.compile; Kornia 0.9.2; NVIDIA driver 620.70.06 (A10G, L4) and 595.112.07 (B200)
Download PDFOpen in new tabriptidecompute.com/whitepapers/exact-filters-gpu

Abstract

Image and audio filters with integer inputs and integer weights (a box blur, a Gaussian with integer taps, a general int8 kernel, an audio FIR with 16-bit taps) have an exact integer answer, but GPU libraries compute them in float32, float16 or 8-bit fixed point. This paper measures exact integer kernels for these four filters on three NVIDIA GPUs (A10G and L4 on AWS for every case, B200 for a reduced set) against OpenCV CUDA, NPP, CV-CUDA, CuPy, cuDNN through PyTorch (every precision, cudnn.benchmark, torch.compile), Kornia and cuFFT, each at its fastest setting, and compares every output of every library with the exact answer on every pixel and sample.

  • Box filter: constant time in the kernel size. The exact kernel takes 0.17–0.44 ms on an 8K frame on the A10G from 3 × 3 to 31 × 31 (0.26–0.54 ms on the L4); NPP and OpenCV CUDA take 21–40 ms at 31 × 31. From 7 × 7 up it is 3.8–7.5× faster than the fastest stock path at 4K and 8K. At 3 × 3 and 5 × 5 NPP's 8-bit box is about as fast or faster (the exact kernel runs at 0.52–1.02×) and wrong on 44–50% of pixels.
  • Separable Gaussian. From 11 × 11 the exact kernel is 2.8–3.3× faster than OpenCV CUDA's separable filter, the fastest stock path, at 4K and 8K, and 9.4–27× faster than float64, the stock path that is always exact. At 3 × 3 to 7 × 7 NPP's 8-bit Gaussian is faster (the exact kernel runs at 0.45–0.83×) and wrong on 50–62% of pixels.
  • General int8 filter on int8 tensor cores. From 7 × 7 at 1080p and above, 2.6–13× faster than the fastest stock path (usually cuDNN, NPP or OpenCV CUDA in float32, which are exact for these kernels, or cuFFT float32; at L4 4K, 7 × 7 the fastest is cuDNN float16, which is wrong on 88% of pixels).
  • Audio FIR on int8 tensor cores. 60 s of 16-bit audio at 48 kHz in 0.031–0.73 ms for 16–4,096 taps; 2.5–38× faster than float64, the only exact stock path, on the A10G and L4 (1.17–9.97× on the B200). Every float32, TF32, float16 and bfloat16 path is wrong on at least 98.6% of samples. cuFFT float32 is faster only at 4,096 taps on 24-bit audio (the exact kernel runs at 0.72–0.80×), and wrong on all of those samples.
  • NVIDIA B200. On 4K frames the exact box filter is 4.2–5.7× faster than the fastest stock path from 7 × 7, the Gaussian 1.7–1.9× faster from 15 × 15 and 2.9–3.6× faster than float64 at every size, the int8 filter 3.1–7.0× faster from 7 × 7; the FIR is faster than every stock path in all 12 cases measured (1.1–7.4×), including 4,096 taps on 24-bit audio. The same small-kernel losses as on the other GPUs remain (0.40–0.82× at 3 × 3 to 7 × 7).
  • The same answer on every GPU. Every exact output was identical on the A10G, L4 and B200. Several stock paths gave different outputs on different GPUs for the same input: cuDNN's float16, bfloat16 and separable float paths, Kornia's separable filter, CuPy's FFT and overlap-add convolution, and NPP's Gaussian (details below).

What this lets you do

  • Filter 8-bit images and integer audio on a GPU and get the exact integer answer: the same bytes on every GPU tested, so a pipeline validated on one machine needs no tolerance on another.
  • Use large box and Gaussian kernels (15 × 15 to 31 × 31) at a fraction of the cost of the library paths, whose time grows with the kernel area.
  • Know, for each library and setting, how often its output differs from the exact answer and by how much.

Method

This section describes the methods at the level of the algorithm; the kernels are not published. Every Riptide output below is an integer computed exactly: no floating-point operation touches a pixel or a sample.

Box filter: running sums, one pass, constant work per pixel

The box filter's exact answer is the window sum of bytes and, for an 8-bit image, the mean correctly rounded to an integer. Because is odd for odd , the rounding never ties, so is the correctly rounded mean.

One thread block produces a tile of 128 output columns and output rows ( = 8–64, picked per GPU and per by a short timing pass). It copies the tile plus its halo into shared memory, using 32-bit loads where the tile is inside the image and replicating the edge pixels where it is not. It then forms horizontal running sums of bytes along every staged row (16-bit, since for ), and vertical running sums of those down each column: each step adds one row and subtracts the row that left the window, so the work per pixel does not grow with . Each thread owns four adjacent output columns and writes them as one 32-bit word. The division by is a multiply-high by ; it is exact because the error term times the largest numerator stays below , which the host checks for every .

Separable integer Gaussian: two exact passes in one kernel

A separable integer kernel (here with , so ) gives the 2-D sum , which fits in 32 bits for 8-bit images. One block stages a 64-column tile and its halo, computes the row products into 32-bit shared memory (four outputs per thread, a -byte window sliding through registers), then the column products. The normalized output is the sum divided by and rounded half to even: the quotient comes from a 64-bit multiply-high by (exact for numerators below and ), and the remainder decides the rounding. Every float library in the comparison gets the same taps divided by , so all of them compute the same filter.

General int8 filters on int8 tensor cores

A filter with int8 weights on an 8-bit image is a sum over the kernel rows of 1-D correlations. For one kernel row, sixteen consecutive outputs of an image row are a matrix-vector product with a Toeplitz matrix ( for , otherwise 64). Taking eight such groups of sixteen outputs as eight columns turns it into the integer matrix product the tensor cores execute in one instruction (mma with uint8 image values, int8 weights and int32 accumulation, which is exact for ; here at most ). Each warp computes one output row; eight warps of a block share the staged input rows. The Toeplitz operand wastes of each instruction, so the method pays off from about ; a dp4a kernel (four byte products per instruction, from the earlier exact-filter work) is also measured.

Audio FIR on int8 tensor cores with byte limbs

A valid correlation of 16-bit samples with 16-bit taps is the same Toeplitz product with rounded up to a multiple of 32. Tensor cores multiply bytes, so each value is split exactly into limbs: with signed and unsigned, and likewise (three limbs for 24-bit samples). Each limb pair is one stream of matrix products with the matching signed/unsigned operand types, accumulated in int32 (each limb product is below in magnitude, so taps stay exact), and the streams are combined in 64-bit integers at the end: . A block stages its signal window and the taps as byte arrays in shared memory; a CUDA-core kernel with int64 accumulation is also measured.

How the comparison is made

Every implementation runs on one CUDA stream (OpenCV CUDA through a wrapped stream, NPP through its stream context, CV-CUDA through as_stream, CuPy through an external stream) and is timed with CUDA events over batches of calls, keeping the best per-call time of up to five batches. Inputs and outputs are already on the GPU unless a row says end-to-end. Each library is called in the form its documentation recommends for speed: preallocated outputs, _into variants, cudnn.benchmark, and torch.compile(mode="max-autotune") for the PyTorch 2-D paths at K = 7 and 31 on 8K frames (K = 31 on the B200 at 4K); the FIR and batch PyTorch paths ran without torch.compile. Every output, float or integer, is compared with the exact answer on every pixel or sample: floats are rounded to the nearest integer the way a user would store them, and their raw error against the exact rational value is recorded too. Riptide's exact output is itself checked against an independent int64 CPU reference at 4,096 random positions per 2-D case and 2,048 samples per FIR case (the batch cases have no CPU spot check), and its kernels pass 422 exactness tests against full CPU references (odd sizes, batches, edge values).

Setup

Machines

Table 1. Machines. A machine record and the full package list sit next to every result file.
machineGPUhostused for
AWS g5.xlarge (on-demand, us-east-1)NVIDIA A10G (Ampere, sm_86, 24 GB), driver 620.70.064 vCPU, 16 GBevery case
AWS g6.xlarge (on-demand, us-east-1)NVIDIA L4 (Ada, sm_89, 24 GB), driver 620.70.064 vCPU, 16 GBevery case
RunPod secure cloud, one GPUNVIDIA B200 (Blackwell, sm_100, 180 GB), driver 595.112.07Xeon 6960P (shared host)reduced set: 4K frames at K = 3, 7, 15, 31; 64 × 1080p at K = 7, 31; FIR at 16, 256, 4,096 taps; end to end at 4K

No H100 could be rented on AWS during the measurement window (no capacity in any zone of the one region with P-instance quota on this account). The B200 ran the same pip-only bundle as the AWS GPUs in one 400-second session (422 of 422 kernel tests passed); RunPod's B200 shares its host with other tenants.

Cases

  • Box: uint8 images at 512², 1080p, 4K and 8K; K × K box, K = 3, 5, 7, 11, 15, 21, 31; replicate border. Exact answer: the window sum and the correctly rounded mean.
  • Gaussian: the same images; integer taps , ; every float library receives , so all compute the same filter. Exact answer: the sum divided by , rounded half to even. OpenCV's createGaussianFilter and CV-CUDA's gaussian build their own kernels from σ; they are timed and scored, but not counted as the fastest stock path, since they compute a different filter.
  • int8 K × K: random signed int8 kernels, zero border, int32 sums, scored on the interior (NPP offers only a replicate border).
  • Batches: 64 frames at 1080p, box and Gaussian, K = 3, 7, 15, 31 (OpenCV CUDA and NPP called once per frame).
  • FIR: 60 s of 48 kHz audio (two tones and noise) as 16-bit and 24-bit samples; low-pass (windowed-sinc) and random int16 taps, 16–4,096 taps; valid correlation, int64 output.
  • End to end: an 8K frame from pinned host memory to the GPU, filtered, and back.

Every GPU filters the same inputs (seeded per case).

Results

Box filter

Table 2. Box filter, one 8K frame (7680 × 4320) on the GPU. Ratios > 1: the exact kernel is faster. Wrong = share of outputs that differ from the exact answer.
GPUKexact msfastest stock ms (wrong)fastest exact stock msOpenCV CUDA ms× vs fastest× vs fastest exact
A10G30.170.16 NPP 8u (44.4%)0.56 NPP f320.370.94×3.35×
A10G70.190.81 CuPy uniform u8 (85.5%)1.10 CuPy uniform f322.134.34×5.84×
A10G150.271.26 CuPy uniform u8 (93.0%)1.38 CuPy uniform f326.014.62×5.07×
A10G310.442.52 CuPy uniform u8 (97.7%)2.71 CuPy uniform f3220.795.76×6.21×
L430.260.27 NPP 8u (44.4%)1.04 NPP f320.551.02×3.94×
L470.271.16 CuPy uniform u8 (85.5%)1.65 CV-CUDA u82.664.25×6.04×
L4150.371.81 CuPy uniform u8 (93.0%)2.18 CuPy uniform f328.894.92×5.93×
L4310.543.48 CuPy uniform u8 (97.7%)3.86 CuPy uniform f3233.386.46×7.18×
Line chart, log scale, two panels (A10G, L4): milliseconds per 8K frame against box size K from 3 to 31. Riptide stays between 0.17 and 0.54 ms; NPP and OpenCV CUDA rise to 27–40 ms at 31 × 31, CV-CUDA and PyTorch float16 to 16–26 ms, CuPy float32 to 2.7–3.9 ms.
Figure 1. Box filter on an 8K frame (uint8, replicate border, data on the GPU).

The exact kernel's time hardly depends on K, because running sums make the work per pixel constant. NPP's box filter (which OpenCV CUDA calls), CV-CUDA and PyTorch's average pooling all grow with the kernel area. CuPy's uniform_filter also uses running sums and is the closest stock path; its uint8 output, the faster one, is wrong on 67–98% of pixels at 8K (by one or two levels), and its float32 output is exact but slower.

Separable Gaussian

Table 3. Separable Gaussian, one 8K frame (7680 × 4320) on the GPU. Ratios > 1: the exact kernel is faster. Wrong = share of outputs that differ from the exact answer.
GPUKexact msfastest stock ms (wrong)fastest exact stock msOpenCV CUDA ms× vs fastest× vs fastest exact
A10G30.210.16 NPP Gauss 8u (50.0%)2.17 CuPy sep f640.700.76×10.49×
A10G70.250.19 NPP Gauss 8u (50.0%)4.03 CuPy sep f640.740.75×16.19×
A10G150.361.09 OpenCV CUDA sep 8u (0.001%)8.60 CuPy sep f641.093.00×23.62×
A10G310.652.07 OpenCV CUDA sep 8u (0.001%)17.75 CuPy sep f642.073.20×27.40×
L430.330.27 NPP Gauss 8u (50.0%)4.54 CuPy sep f641.380.83×13.87×
L470.360.29 NPP Gauss 8u (50.0%)4.80 CuPy sep f641.400.78×13.20×
L4150.491.50 OpenCV CUDA sep 8u (0.001%)10.24 CuPy sep f641.503.04×20.78×
L4310.842.49 OpenCV CUDA sep 8u (0.001%)21.17 CuPy sep f642.492.98×25.28×
Line chart, log scale, two panels (A10G, L4): milliseconds per 8K frame for the separable Gaussian against K. NPP's 8-bit Gaussian is fastest at 3 × 3 to 7 × 7; from 11 × 11 the exact kernel is about 3× faster than OpenCV CUDA's separable filter.
Figure 2. Separable Gaussian on an 8K frame, the same normalized taps for every library.

At 3 × 3 to 7 × 7 NPP's 8-bit Gaussian (FilterGaussAdvanced, or its 8-bit row/column filter at L4 4K, 7 × 7) is the fastest stock path and the exact kernel is slower (0.45–0.83× at 4K and 8K). NPP's 8-bit output is off by one level on about half the pixels; at 5 × 5 it is wrong on 62% of pixels, with a 99th-percentile error of 64 levels and a maximum of 107–115 levels, at every image size on the A10G and the L4 (5 × 5 was not in the B200 set). NPP's float32 path with the same taps is wrong on at most 0.002% of pixels; the cause of the 8-bit errors is under investigation (see Limitations). From 11 × 11 OpenCV CUDA's separable filter is the fastest stock path, wrong on at most 0.001% of pixels, and the exact kernel is about 3× faster.

General int8 filters

Table 4. int8 K × K filter, one 8K frame (7680 × 4320) on the GPU. Ratios > 1: the exact kernel is faster. Wrong = share of outputs that differ from the exact answer.
GPUKexact msfastest stock ms (wrong)fastest exact stock msOpenCV CUDA ms× vs fastest× vs fastest exact
A10G30.360.57 NPP f32 (0.0%)0.57 NPP f320.631.59×1.59×
A10G70.391.67 NPP f32 (0.0%)1.67 NPP f321.834.29×4.29×
A10G150.537.07 NPP f32 (0.0%)7.07 NPP f327.2413.31×13.31×
A10G311.7112.02 cuFFT f32 (0.000%)29.44 OpenCV CUDA f3229.447.02×17.21×
L430.710.66 cuDNN bf16 (96.7%)1.03 CuPy correlate f321.060.92×1.44×
L470.711.84 cuDNN f32 (0.0%)1.84 cuDNN f322.552.60×2.60×
L4150.828.98 NPP f32 (0.0%)8.98 NPP f3211.3510.94×10.94×
L4312.3223.96 cuFFT f32 (0.000%)37.81 NPP f3248.2010.34×16.32×

The exact column is the faster of the tensor-core and dp4a kernels for each case.

Line chart, log scale, two panels (A10G, L4): milliseconds per 8K frame for a random int8 K × K filter. The exact tensor-core kernel grows slowly with K; NPP, OpenCV CUDA and cuDNN float32 grow with the kernel area.
Figure 3. General int8 filter on an 8K frame, int32 sums.

For random signed int8 kernels the float32 paths are exact here (the sums stay inside float32's 24-bit significand); float16 and bfloat16 are wrong on almost every pixel. The tensor-core kernel runs at 0.21–0.77× at 512² for K ≤ 7, at 0.68–0.92× on the L4 at 3 × 3 (1080p and 8K) and at 0.82× on the B200 at 3 × 3 (4K): its 32-tap matrix tile wastes of each instruction for small kernels.

NVIDIA B200, 4K frames

Table 5. B200, one 4K frame (3840 × 2160) on the GPU, reduced case set. Ratios > 1: the exact kernel is faster. Wrong = share of outputs that differ from the exact answer.
filterKexact msfastest stock ms (wrong)fastest exact stock msOpenCV CUDA ms× vs fastest× vs fastest exact
box30.0230.010 NPP 8u (44.4%)0.047 NPP f320.0280.44×2.07×
box70.0240.102 CuPy uniform f32 (0.0%)0.102 CuPy uniform f320.1724.21×4.21×
box150.0330.150 CuPy uniform f32 (0.0%)0.150 CuPy uniform f320.5004.55×4.55×
box310.0450.257 CuPy uniform f32 (0.0%)0.257 CuPy uniform f321.7855.68×5.68×
Gaussian30.0280.011 NPP Gauss 8u (50.0%)0.080 CuPy sep f640.0300.40×2.92×
Gaussian70.0330.023 NPP Gauss 8u (50.0%)0.103 CuPy sep f640.0450.70×3.16×
Gaussian150.0440.075 OpenCV CUDA sep 8u (0.001%)0.152 CuPy sep f640.0751.70×3.44×
Gaussian310.0730.138 OpenCV CUDA sep 8u (0.001%)0.261 CuPy sep f640.1381.91×3.59×
int830.0220.018 NPP f32 (0.0%)0.018 NPP f320.0710.82×0.82×
int870.0330.151 NPP f32 (0.0%)0.151 NPP f320.2224.62×4.62×
int8150.0550.383 cuFFT f32 (0.0%)0.383 cuFFT f320.7586.95×6.95×
int8310.1370.431 cuFFT f32 (0.0001%)0.554 cuFFT f642.7053.14×4.04×

The B200 shows the same pattern as the other GPUs with smaller margins on the Gaussian: from 15 × 15 OpenCV CUDA's separable filter is about half the exact kernel's speed, against a third on the A10G and L4. The box filter's fastest stock path at 7 × 7 and up is CuPy's float32 uniform_filter, which is exact here and still 4.2–5.7× slower. Every library's timings and error statistics for these cases are in the results files.

Batches

On 64 frames at 1080p the exact kernels run in one launch: box 0.68–1.69 ms and Gaussian 0.84–2.63 ms on the A10G for K = 3–31, 1.02–8.6× faster than the fastest stock path on the A10G and L4; OpenCV CUDA and NPP take one call per frame. On the B200 the same batches take 0.28–0.60 ms (box) and 0.47–1.06 ms (Gaussian) at K = 7 and 31, 2.0–7.5× faster than the fastest stock path.

Audio FIR

Table 6. Audio FIR, 60 s of 48 kHz audio (2,880,000 samples), low-pass int16 taps, int64 output.
GPUbitstapsexact msfastest stock ms (wrong)fastest exact stock ms× vs fastest× vs fastest exact
A10G16160.0650.086 cuDNN f16 (100.0%)0.242 cuDNN f641.32×3.72×
A10G16640.0670.218 cuDNN f16 (100.0%)0.765 cuDNN f643.27×11.49×
A10G162560.0800.637 cuFFT OA f32 (99.9%)2.029 cuFFT OA f647.93×25.25×
A10G161,0240.1940.657 cuFFT OA f32 (100.0%)2.783 cuFFT OA f643.38×14.31×
A10G164,0960.7290.876 cuFFT OA f32 (99.9%)2.762 cuFFT OA f641.20×3.79×
A10G24160.0800.086 cuDNN f16 (100.0%)0.242 cuDNN f641.07×3.01×
A10G24640.0870.217 cuDNN f16 (100.0%)0.765 cuDNN f642.49×8.75×
A10G242560.1040.638 cuFFT OA f32 (100.0%)2.030 cuFFT OA f646.14×19.55×
A10G241,0240.2970.656 cuFFT OA f32 (100.0%)2.787 cuFFT OA f642.21×9.39×
A10G244,0961.0980.876 cuFFT OA f32 (100.0%)2.762 cuFFT OA f640.80×2.51×
L416160.0310.095 cuDNN conv1d TF32 (99.5%)0.266 cuDNN f643.11×8.73×
L416640.0350.268 cuDNN f16 (100.0%)0.860 cuDNN f647.54×24.24×
L4162560.0570.511 cuFFT OA f32 (99.9%)2.147 cuFFT OA f649.03×37.89×
L4161,0240.1460.490 cuFFT OA f32 (100.0%)3.006 cuFFT OA f643.35×20.55×
L4164,0960.5050.540 cuFFT OA f32 (99.9%)2.898 cuFFT OA f641.07×5.74×
L424160.0390.088 cuDNN conv1d TF32 (100.0%)0.268 cuDNN f642.28×6.91×
L424640.0470.250 cuDNN conv1d TF32 (100.0%)0.866 cuDNN f645.36×18.54×
L4242560.0760.511 cuFFT OA f32 (100.0%)2.146 cuFFT OA f646.76×28.39×
L4241,0240.2070.512 cuFFT OA f32 (100.0%)3.006 cuFFT OA f642.48×14.55×
L4244,0960.7360.569 cuFFT OA f32 (100.0%)2.927 cuFFT OA f640.77×3.97×
B20016160.0120.041 cuDNN f32 (99.5%)0.046 cuDNN f643.31×3.72×
B200162560.0210.153 cuFFT fftconvolve f32 (99.9%)0.207 cuFFT fftconvolve f647.37×9.93×
B200164,0960.1330.210 cuFFT fftconvolve f32 (99.9%)0.228 cuFFT OA f641.58×1.72×
B20024160.0170.041 cuDNN f32 (100.0%)0.046 cuDNN f642.43×2.74×
B200242560.0300.153 cuFFT fftconvolve f32 (100.0%)0.207 cuFFT fftconvolve f645.13×6.96×
B200244,0960.1880.209 cuFFT fftconvolve f32 (100.0%)0.220 cuFFT OA f641.11×1.17×
Line chart, log scale, three panels (A10G, L4, B200): milliseconds for 60 s of 16-bit audio against the number of taps. The exact FIR is the lowest line on every GPU; float64 paths are 2.5–38× slower on the A10G and L4 and 1.17–9.97× slower on the B200.
Figure 4. Audio FIR, 60 s at 48 kHz, low-pass int16 taps, int64 output.

Float64 (cuDNN or cuFFT overlap-add) is the only exact stock path for these sizes. cuFFT float32 overlap-add is the fastest stock path from 256 taps and is wrong on 99.6–100% of samples, by up to 6.2 million LSB (6.6 million on the B200). On the B200 the exact FIR is faster than every stock path in all 12 cases (low-pass and random taps; the random-tap rows are in the results files), including 24-bit audio at 4,096 taps, where cuFFT float32 is faster on the A10G and L4.

End to end

With an 8K frame copied from pinned host memory and back (4.99 ms for the copies alone on the A10G and L4), the exact box and Gaussian add 0.17–0.82 ms. NPP's 8-bit box matches that at 3 × 3 and is 2.3–7.8× slower at 15 × 15 to 31 × 31. cuDNN, with the int8 kernel as float, takes 15–99 ms against 12.9–14.8 ms for the exact int8 filter with its int32 output. On the B200 with a 4K frame the copies take 0.31 ms; the exact box and Gaussian add 0.02–0.08 ms, NPP's 8-bit box is 0.01 ms faster at 3 × 3 and 2.3–5.6× slower (whole round trip) at 15 × 15 and 31 × 31, and the exact int8 filter takes 0.78–0.89 ms against 1.08–4.57 ms for cuDNN float32.

How often each library is wrong

Bar charts, four panels (box 7 × 7, box 31 × 31, Gaussian 7 × 7, Gaussian 31 × 31): share of pixels each library gets wrong on an 8K frame on the A10G. CuPy uniform_filter uint8 85.5–97.7%, NPP and OpenCV CUDA 8-bit box 49–50%, NPP row/column 94–97%, NPP GaussAdvanced 8-bit 50%, cuDNN float16 4.4–5.1%, float32 paths 0–0.001%, Riptide 0%.
Figure 5. Share of uint8 outputs that differ from the correctly rounded exact answer, 8K frame, A10G.
Table 7. What each stock path gets wrong: every 8K box and Gaussian case and every FIR case on the A10G. Errors in grey levels (images) or least significant bits (audio).
implementationpartwrong outputsmax errormedian error of wrong outputs
CuPy uniform_filter uint8box66.7%–97.7%21
OpenCV CUDA box 8ubox44.4%–50.0%11
NPP box 8ubox44.4%–50.0%11
PyTorch avg-pool f16box4.4%–5.9%11
PyTorch avg-pool f16, compiledbox4.4%–5.1%11
CV-CUDA averageBlur u8box0.0%–0.000%11
OpenCV CUDA box f32box0.0%–0.0%0–
NPP box f32box0.0%–0.0%0–
CuPy uniform_filter f32box0.0%–0.0%0–
PyTorch avg-pool f32box0.0%–0.0%0–
Kornia box_blur f32box0.0%–0.0%0–
PyTorch avg-pool f32, compiledbox0.0%–0.0%0–
cuDNN conv1d f16fir100.0%–100.0%∞ (overflow)1,897,053
cuDNN conv1d bf16fir100.0%–100.0%42,751,895,4315,829,674,865
cuFFT overlap-add f32fir99.6%–100.0%6,162,749859,954
cuDNN conv1d f32fir98.6%–100.0%28,555,5201,686,205
cuDNN conv1d TF32fir98.6%–100.0%28,555,5201,686,205
cuFFT fftconvolve f32fir99.8%–100.0%4,407,688561,266
cuDNN conv1d f64fir0.0%–0.0%0–
cuFFT fftconvolve f64fir0.0%–0.0%0–
cuFFT overlap-add f64fir0.0%–0.0%0–
NPP row/column 8ugauss89.7%–97.3%21
NPP GaussAdvanced 8ugauss50.0%–62.2%1151
CV-CUDA gaussian u8 (own kernel)gauss1.9%–19.4%11
OpenCV CUDA Gaussian 8u (own kernel)gauss1.9%–19.4%11
cuDNN separable f16gauss4.6%–6.5%11
cuDNN separable f16, compiledgauss4.6%–4.7%11
OpenCV CUDA separable 8ugauss0.000%–0.001%11
OpenCV CUDA separable f32gauss0.000%–0.001%11
CuPy correlate1d f32gauss0.000%–0.001%11
NPP GaussAdvanced f32gauss0.000%–0.001%11
cuDNN separable f32gauss0.000%–0.001%11
cuDNN separable TF32gauss0.000%–0.001%11
Kornia separable f32gauss0.000%–0.001%11
cuDNN separable f32, compiledgauss0.001%–0.001%11
CuPy correlate1d f64gauss0.0%–0.0%0–

On the B200 the same paths make the same errors (the per-GPU error tables are in the results files). Two notes: cuCIM's Gaussian (float32, its own kernel from σ, B200 only) is wrong on 1.9–19.4% of pixels by one level, like OpenCV CUDA's and CV-CUDA's own kernels; cuFFT float32 overlap-add (listed in the error table) is wrong on 99.6–100% of samples there too, with a larger maximum of 6,598,843 LSB.

Every Riptide output was exact on every pixel and sample in all 252 cases (112 on the A10G, 112 on the L4, 28 on the B200), and identical on every GPU that ran the case (216 of 216 comparisons). Stock paths whose outputs differ between GPUs for the same input: cuDNN conv1d bfloat16 (11 of 20 cases) and float16 (6 of 20); cuDNN separable float16 (7 of 32), float32 and TF32 (3 of 28 each), and their compiled forms (1 of 2); Kornia's separable filter (3 of 28); CuPy fftconvolve float32 and float64 (16 of 48 each) and oaconvolve (12 of 20 each); NPP FilterGaussAdvanced 8-bit (2 of 28) and float32 (1 of 28). OpenCV CUDA, CV-CUDA, NPP's box and general filter, and cuDNN's 2-D convolution gave identical outputs on every GPU.

Limitations and next steps

The limits of these results, each with its cause and, where one is planned, the next step.

  • Small kernels: NPP's 8-bit box is faster at 3 × 3 and 5 × 5, and its 8-bit Gaussian at 3 × 3 to 7 × 7 (box: NPP's 8-bit box wins only at 3 × 3 and 5 × 5, where the exact kernel runs at 0.52–1.02× at 4K and 8K and 0.2–0.7× at 512² and 1080p; Gaussian: the exact kernel runs at 0.45–0.83× at 3 × 3 to 7 × 7 at 4K and 8K and 0.17–0.86× at 512² and 1080p; one launch dominates at small sizes; 0.40–0.70× on the B200 at 4K). NPP's outputs there are wrong on 44–62% of pixels. Cause: at small K the filter is a few memory passes, and staging a halo tile in shared memory costs more than it saves.
  • Small images and 3 × 3 with the tensor-core filter (512², K ≤ 7: 0.21–0.77×; at 3 × 3, 0.68–0.92× on the L4 and 0.82× of NPP float32 on the B200 at 4K). Cause: the tensor-core tile is 32 taps wide, so small kernels waste most of each instruction, and a 512² image is too small to fill the GPU. The dp4a kernel (four byte products per instruction) does not close the gap: the tables report the faster of the two.
  • 24-bit audio at 4,096 taps on the A10G and L4: cuFFT float32 is faster (0.72–0.80×) and wrong on every sample; on the B200 the exact FIR is 1.11× faster. Cause: an FFT's cost hardly grows with the number of taps. Next: an exact number-theoretic transform on the GPU.
  • GPUs. Every case ran on two inference GPUs (Ampere and Ada); the B200 ran a reduced set (4K frames, two batch sizes, three FIR lengths), and there are no H100 or AMD results. Cause: no H100 capacity in any zone of the one AWS region with P-instance quota on this account during the window; the B200 run was one short shared session with a reduced case set. Next: the full case set on H100 and B200 when AWS capacity opens.
  • NPP's 8-bit 5 × 5 Gaussian errors are not explained (62% of pixels wrong, up to 115 levels). Cause: under investigation (NPP is closed source; its float32 path with the same taps is correct on all but 0.002% of pixels). Next: report it to NVIDIA with the inputs and outputs.

Reproduction notes

  • Software. The kernels are a Riptide prototype and are not published. Evaluation builds are available through Request an evaluation.
  • Records. Every row with all raw times, the error statistics of every output and its SHA-256 prefix, the kernel tests (422 cases, all passing on every GPU), and a machine record and package list per GPU. Evaluation partners can have the raw files on request.
  • Cost. About $4.40 of AWS GPU time, including development (A10G $1.63, L4 $0.87, development boxes about $1.9), and a share of one RunPod B200 session ($5.06: 34 minutes at $8.99 per hour) that also ran two other experiments.

References

  • NVIDIA, NPP library documentation (image filtering functions), CUDA 13.
  • OpenCV, cv::cuda filtering module, version 4.13.
  • NVIDIA, CV-CUDA documentation.
  • Chetlur et al., cuDNN: efficient primitives for deep learning, arXiv:1410.0759, 2014.
  • NVIDIA, PTX ISA (warp-level mma with integer operands).
  • Riptide, Exact integer filters for images, audio and quantized CNNs, December 2026 (the CPU kernels and the dp4a GPU kernel).

Date and version

Version 1, 1 December 2026: A10G, L4 and B200. Measurements from 1 December 2026.

Working with Riptide

Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.