From cf22cbd8d5e7cc32f5ee508171e195d251718382 Mon Sep 17 00:00:00 2001 From: Christopher Anderson Date: Thu, 28 Aug 2025 09:00:08 +1000 Subject: [PATCH] Added env_var for cudnn.benchmark --- comfy/customzluda/zluda.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/comfy/customzluda/zluda.py b/comfy/customzluda/zluda.py index 57050627f..5716b4245 100644 --- a/comfy/customzluda/zluda.py +++ b/comfy/customzluda/zluda.py @@ -438,6 +438,13 @@ try: else: print(" :: Disabled cuDNN") + if os.environ.get("TORCH_BACKENDS_CUDNN_BENCHMARK"): + torch.backends.cudnn.benchmark = os.environ.get("TORCH_BACKENDS_CUDNN_BENCHMARK", "1").strip().lower() not in {"0", "off", "false", "disable", "disabled", "no"} + if torch.backends.cudnn.benchmark: + print(" :: Enabled cuDNN Benchmark") + else: + print(" :: Disabled cuDNN Benchmark") + @triton.jit def _zluda_kernel_test(x_ptr, y_ptr, n_elements, BLOCK_SIZE: tl.constexpr): pid = tl.program_id(axis=0)