# What does torch.backends.cudnn.benchmark do?

**URL:** <https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936>\
**Category:** Uncategorized\
**Created:** [August 8, 2017, 4:21pm UTC](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936 "2017-08-08T16:21:17Z")\
**Posts on this page:** 1\
**Showing post:** 43

<div class="post-metadata">

**Author:** ![Paloha](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/p/ad7895/32.png) [@Paloha](https://discuss.pytorch.org/u/Paloha)\
**Post date:** [February 24, 2024, 12:52am UTC](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936/43 "2024-02-24T00:52:16Z")

</div>

Thanks for your reply. I tried setting the env variable `CUDNN_CONV_WSCAP_DBG=38000` (My cudnn version is 8.2.1.32). I am testing on A100-40GB GPU and the [documentation](https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-831/pdf/cuDNN-Release-Notes.pdf) says the value should be set in MiB. However, I still get OOM. Did you anticipate that limiting the cudnn workspace would help?

I figured that doing the benchmarking on smaller input to figure out the best algorithm, and then just directly setting that algorithm without further benchmarking could help avoiding the VRAM usage peak. But I did not find out how to do this even after digging further into this [question](https://discuss.pytorch.org/t/how-to-get-print-convolution-algorithm-chosen-by-cudnn-autotune/66554) and this [git issue](https://github.com/pytorch/pytorch/issues/18536).

---

_[View the full topic](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936)._
