Enable comfy-kitchen Triton backend by default on ROCm/AMD (#14862)
On AMD/ROCm the CUDA backend is unavailable, so Triton is the only accelerated comfy-kitchen backend. It was disabled by default (opt-in --enable-triton-backend), leaving AMD on the slow eager path. Enable it by default when torch.version.hip is set AND Triton is >= 3.7 -- older Triton lacks libdevice.rint on the HIP backend and hard-crashes the INT8 path, so on Triton < 3.7 it stays disabled with a log line. NVIDIA behavior is unchanged; the explicit --enable-triton-backend flag still works as an override. Fixes #14861
This commit is contained in:
parent
62e025a4f3
commit
099522f85b
|
|
@ -25,10 +25,18 @@ try:
|
||||||
ck.registry.disable("cuda")
|
ck.registry.disable("cuda")
|
||||||
logging.warning("WARNING: You need pytorch with cu130 or higher to use optimized CUDA operations.")
|
logging.warning("WARNING: You need pytorch with cu130 or higher to use optimized CUDA operations.")
|
||||||
|
|
||||||
if args.enable_triton_backend:
|
# On ROCm/AMD the CUDA backend is unavailable, so Triton is the only accelerated
|
||||||
|
# comfy-kitchen backend. Enable it by default there, but only on Triton >= 3.7:
|
||||||
|
# older Triton lacks libdevice.rint on the HIP backend and hard-crashes the INT8 path.
|
||||||
|
if args.enable_triton_backend or torch.version.hip is not None:
|
||||||
try:
|
try:
|
||||||
import triton
|
import triton
|
||||||
logging.info("Found triton %s. Enabling comfy-kitchen triton backend.", triton.__version__)
|
triton_version = tuple(int(v) for v in triton.__version__.split(".")[:2])
|
||||||
|
if args.enable_triton_backend or triton_version >= (3, 7):
|
||||||
|
logging.info("Found triton %s. Enabling comfy-kitchen triton backend.", triton.__version__)
|
||||||
|
else:
|
||||||
|
logging.info("Triton %s is too old for the ROCm INT8 path (needs >= 3.7); comfy-kitchen triton backend disabled.", triton.__version__)
|
||||||
|
ck.registry.disable("triton")
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logging.error(f"Failed to import triton, Error: {e}, the comfy-kitchen triton backend will not be available.")
|
logging.error(f"Failed to import triton, Error: {e}, the comfy-kitchen triton backend will not be available.")
|
||||||
ck.registry.disable("triton")
|
ck.registry.disable("triton")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue