From da3907a17c2973b294b21a4a8aac2635887a0c8c Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sun, 21 Jun 2026 14:25:16 +0300 Subject: [PATCH] Set has_triton to True for CPU backend --- modules/devices.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/devices.py b/modules/devices.py index 43dc25888..381f4390f 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -401,8 +401,14 @@ def test_triton(early: bool = False): return triton_ok t0 = time.time() try: - from torch.utils._triton import has_triton as torch_has_triton - if torch_has_triton(): + if torch._dynamo.config.disable: # pylint: disable=protected-access + triton_is_available = False + elif backend == "cpu": # CPUs can use torch.compile / Inductor without Triton + triton_is_available = True + else: + from torch.utils._triton import has_triton as torch_has_triton + triton_is_available = torch_has_triton() + if triton_is_available: if early: return True def test_triton_func(a,b,c):