Put ROCm version in tuple to make it easier to enable stuff based on it. (#8348)

This commit is contained in:
comfyanonymous 2025-05-30 12:41:02 -07:00 committed by GitHub
parent 1d9fee79fd
commit 704fc78854
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -297,8 +297,13 @@ except:
try:
if is_amd():
try:
rocm_version = tuple(map(int, str(torch.version.hip).split(".")[:2]))
except:
rocm_version = (6, -1)
arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName
logging.info("AMD arch: {}".format(arch))
logging.info("ROCm version: {}".format(rocm_version))
if args.use_split_cross_attention == False and args.use_quad_cross_attention == False:
if torch_version_numeric[0] >= 2 and torch_version_numeric[1] >= 7: # works on 2.6 but doesn't actually seem to improve much
if any((a in arch) for a in ["gfx1100", "gfx1101", "gfx1151"]): # TODO: more arches