From 6207b6d84183d8fad68b7e255d3bd427ae4aeb37 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Wed, 6 Aug 2025 21:33:50 +0300 Subject: [PATCH] Update ROCm and OpenVINO to Torch 2.8 --- CHANGELOG.md | 2 ++ installer.py | 15 ++++++++------- modules/intel/ipex/int_mm.py | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed9de046..b43e60f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ And (*as always*) many bugfixes and improvements to existing features! great model based on FLUX.1 and then redesigned and retrained by *lodestones* update with latest **v48**, **v48 Detail Calibrated** and **v46 Flash** variants available via *networks -> models -> reference* +**Torch** + - Set default for ROCm and OpenVINO to `torch==2.8.0` - **UI** - new embedded docs/wiki search! **Docs** search: fully-local and works in real-time on all document pages diff --git a/installer.py b/installer.py index 194e585d2..35795a430 100644 --- a/installer.py +++ b/installer.py @@ -738,13 +738,13 @@ def install_rocm_zluda(): if args.use_nightly: if rocm.version is None or float(rocm.version) >= 6.4: # assume the latest if version check fails torch_command = os.environ.get('TORCH_COMMAND', '--upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm6.4') - elif rocm.version == "6.3": + else: # oldest rocm version on nightly is 6.3 torch_command = os.environ.get('TORCH_COMMAND', '--upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm6.3') - else: # oldest rocm version on nightly is 6.2.4 - torch_command = os.environ.get('TORCH_COMMAND', '--upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm6.2.4') else: - if rocm.version is None or float(rocm.version) >= 6.3: # assume the latest if version check fails - torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.7.1+rocm6.3 torchvision==0.22.1+rocm6.3 --index-url https://download.pytorch.org/whl/rocm6.3') + if rocm.version is None or float(rocm.version) >= 6.4: # assume the latest if version check fails + torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.8.0+rocm6.4 torchvision==0.23.0+rocm6.4 --index-url https://download.pytorch.org/whl/rocm6.4') + elif rocm.version == "6.3": + torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.8.0+rocm6.3 torchvision==0.23.0+rocm6.3 --index-url https://download.pytorch.org/whl/rocm6.3') elif rocm.version == "6.2": # use rocm 6.2.4 instead of 6.2 as torch==2.7.1+rocm6.2 doesn't exists torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.7.1+rocm6.2.4 torchvision==0.22.1+rocm6.2.4 --index-url https://download.pytorch.org/whl/rocm6.2.4') @@ -804,6 +804,7 @@ def install_ipex(): if args.use_nightly: torch_command = os.environ.get('TORCH_COMMAND', '--upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/xpu') else: + # torch 2.8 segfaults with torch.compile: https://github.com/pytorch/pytorch/issues/159974 torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.7.1+xpu torchvision==0.22.1+xpu --index-url https://download.pytorch.org/whl/xpu') ts('ipex', t_start) @@ -815,9 +816,9 @@ def install_openvino(): #check_python(supported_minors=[9, 10, 11, 12, 13], reason='OpenVINO backend requires a Python version between 3.9 and 3.13') log.info('OpenVINO: selected') if sys.platform == 'darwin': - torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.7.1 torchvision==0.22.1') + torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.8.0 torchvision==0.23.0') else: - torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.7.1+cpu torchvision==0.22.1+cpu --index-url https://download.pytorch.org/whl/cpu') + torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.8.0+cpu torchvision==0.23.0+cpu --index-url https://download.pytorch.org/whl/cpu') install(os.environ.get('OPENVINO_COMMAND', 'openvino==2025.2.0'), 'openvino') install(os.environ.get('NNCF_COMMAND', 'nncf==2.17.0'), 'nncf') diff --git a/modules/intel/ipex/int_mm.py b/modules/intel/ipex/int_mm.py index 9c5fab093..4256937ac 100644 --- a/modules/intel/ipex/int_mm.py +++ b/modules/intel/ipex/int_mm.py @@ -49,7 +49,7 @@ def qlinear_unary( # GEMM template needs 2D input, normalize input shape here x = view(x, [-1, x_size[-1]]) if not isinstance(x_scale, ir.TensorBox): - assert type(x_scale) == float + assert isinstance(x_scale, float) x_scale = V.graph.add_tensor_constant( torch.tensor(x_scale, dtype=torch.float32), name="x_scale" ) @@ -71,7 +71,7 @@ def qlinear_unary( torch.tensor(0, dtype=torch.int32), name="x_zp" ) if not isinstance(x_zp, ir.TensorBox): - assert type(x_zp) == int + assert isinstance(x_zp, int) x_zp = V.graph.add_tensor_constant( torch.tensor(x_zp, dtype=torch.int32), name="x_zp" )