update ipex and rocm to torch 2.12

This commit is contained in:
Disty0
2026-05-17 18:26:19 +03:00
parent 10febba1a2
commit 39b768564a
2 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -668,9 +668,9 @@ def install_rocm_zluda():
torch_command = os.environ.get('TORCH_COMMAND', '--upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm7.1')
else:
if rocm.version is None or float(rocm.version) >= 7.2: # assume the latest if version check fails
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.11.0+rocm7.2 torchvision==0.26.0+rocm7.2 --index-url https://download.pytorch.org/whl/rocm7.2')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.12.0+rocm7.2 torchvision==0.27.0+rocm7.2 --index-url https://download.pytorch.org/whl/rocm7.2')
elif rocm.version == "7.1":
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.11.0+rocm7.1 torchvision==0.26.0+rocm7.1 --index-url https://download.pytorch.org/whl/rocm7.1')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.12.0+rocm7.1 torchvision==0.27.0+rocm7.1 --index-url https://download.pytorch.org/whl/rocm7.1')
elif rocm.version == "7.0":
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.10.0+rocm7.0 torchvision==0.25.0+rocm7.0 --index-url https://download.pytorch.org/whl/rocm7.0')
elif rocm.version == "6.4":
@@ -708,7 +708,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_command = os.environ.get('TORCH_COMMAND', 'torch==2.11.0+xpu torchvision==0.26.0+xpu --index-url https://download.pytorch.org/whl/xpu')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.12.0+xpu torchvision==0.27.0+xpu --index-url https://download.pytorch.org/whl/xpu')
ts('ipex', t_start)
return torch_command
+3 -1
View File
@@ -67,7 +67,6 @@ def ipex_init(): # pylint: disable=too-many-statements
torch.cuda.stream = torch.xpu.stream
torch.cuda.Event = torch.xpu.Event
torch.cuda.Stream = torch.xpu.Stream
torch.cuda.Optional = torch.xpu.Optional
torch.cuda.streams = torch.xpu.streams
torch.cuda.Any = torch.xpu.Any
torch.cuda.default_generators = torch.xpu.default_generators
@@ -165,6 +164,9 @@ def ipex_init(): # pylint: disable=too-many-statements
torch.cuda._device = torch.xpu._device
torch.cuda._device_t = torch.xpu._device_t
if torch_version[0] < 2 or (torch_version[0] == 2 and torch_version[1] < 12):
torch.cuda.Optional = torch.xpu.Optional
# Memory:
if "linux" in sys.platform and "WSL2" in os.popen("uname -a").read():
torch.xpu.empty_cache = return_none