patch_denoise.gpu.autotune#

Auto-tune the GPU batch size for a given denoising configuration.

The best batch size depends on the GPU, the denoising method and the patch shape in ways that aren’t predictable from hardware specs alone (see the benchmarks that motivated this: the sweet spot moved from ~96-192 for (11,11,11) patches to a flat plateau across 64-1024 for (5,5,5) patches on the same GPU). Instead of guessing, this times a short forward pass at a handful of candidate sizes on the real GPU/method/patch shape and picks the fastest, then caches the result to disk so repeat runs skip calibration.

Functions

autotune_batch_size

Return the fastest batch size for this (GPU, method, patch_shape).