Skip to content

torch.linalg.eigvals with XPU #566

@martinwang2002

Description

@martinwang2002

Describe the issue

Sample code

import torch
import intel_extension_for_pytorch as ipex

matrix = torch.randn(3, 3).to("xpu")
print(matrix.device)
print(torch.linalg.eigvals(matrix).device)

will produce the following error

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, xpu:0 and cpu! (when checking argument for argument real in method wrapper_XPU_out_complex_out)

Pytorch linalg documents

When inputs are on a CUDA device, this function synchronizes that device with the CPU.

I believe the synchronisation is not implemented for this function in XPU.

Environment

PyTorch version: 2.1.0a0+cxx11.abi
PyTorch CXX11 ABI: Yes
IPEX version: 2.1.10+xpu
IPEX commit: a12f9f650
Build type: Release

OS: Rocky Linux release 8.9 (Green Obsidian) (x86_64)
GCC version: (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)
Clang version: N/A
IGC version: 2024.0.0 (2024.0.0.20231017)
CMake version: version 3.17.0
Libc version: glibc-2.28

Python version: 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-4.18.0-477.43.1.el8_8.x86_64-x86_64-with-glibc2.28
Is XPU available: True
DPCPP runtime version: 2024.0
MKL version: 2024.0
GPU models and configuration:
[0] _DeviceProperties(name='Intel(R) Data Center GPU Max 1550', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=1, total_memory=131072MB, max_compute_units=1024, gpu_eu_count=1024)
Intel OpenCL ICD version: 23.22.26516.34-682.el8_8
Level Zero version: 1.3.26516.34-682.el8_8

Versions of relevant libraries:
[pip3] intel-extension-for-pytorch==2.1.10+xpu
[pip3] numpy==1.26.4
[pip3] torch==2.1.0a0+cxx11.abi
[pip3] torch-fidelity==0.3.0
[pip3] torchaudio==2.1.0a0+cxx11.abi
[pip3] torchmetrics==1.3.2
[pip3] torchvision==0.16.0a0+cxx11.abi

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingXPU/GPUXPU/GPU specific issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions