Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory increase of 500MB when calling torch._C.init_xpu() #732

Open
piDack opened this issue Nov 13, 2024 · 1 comment
Open

Memory increase of 500MB when calling torch._C.init_xpu() #732

piDack opened this issue Nov 13, 2024 · 1 comment
Assignees

Comments

@piDack
Copy link

piDack commented Nov 13, 2024

Describe the bug

I am experiencing an issue with the IPEX (Intel Extension for PyTorch) integration. Whenever I execute the torch._C.init_xpu() function, I notice a consistent increase in memory usage of approximately 500MB. This behavior is reproducible and seems to occur every time the function is called.

Environment:

OS: Windows 11
PyTorch version: 2.13.1
Hardware: Utlra 5 288V
Steps to reproduce:

Install PyTorch and IPEX following the official instructions.
Run the following Python code:

import torch
torch._C.init_xpu()

Monitor the memory usage before and after the function call.
Expected behavior: The memory usage should remain stable or increase only minimally when calling torch._C.init_xpu().

Actual behavior: The memory usage increases by approximately 500MB.

Additional context: I have tried various memory profiling tools to track this issue and it consistently points to the torch._C.init_xpu() call as the source of the memory increase.

Is there a known issue related to this? Are there any workarounds or best practices to prevent such a significant memory allocation when initializing XPU with IPEX?

Thank you for your assistance.

Versions

Collecting environment information...
=====================================
PyTorch version:   2.3.1+cxx11.abi
PyTorch CXX11 ABI: No
IPEX version:      2.3.110+xpu
IPEX commit:       95c945927
Build type:        Release

OS:                Microsoft Windows 11 专业版 (10.0.26100 64 位)
GCC version:       N/A
Clang version:     N/A
IGC version:       N/A
CMake version:     N/A
Libc version:      N/A

Python version:    3.11.10 | packaged by Anaconda, Inc. | (main, Oct  3 2024, 07:22:26) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform:   Windows-10-10.0.26100-SP0
Is XPU available:  True
DPCPP runtime:     N/A
MKL version:       N/A

GPU models and configuration onboard:
* Intel(R) Arc(TM) 140V GPU (16GB)

GPU models and configuration detected:
* [0] _XpuDeviceProperties(name='Intel(R) Arc(TM) 140V GPU (16GB)', platform_name='Intel(R) Level-Zero', type='gpu', driver_version='1.3.30513', total_memory=16824MB, max_compute_units=64, gpu_eu_count=64, gpu_subslice_count=8, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1)

Driver version:
* 32.0.101.6042 (20240927000000.******+***)

CPU:
Description: Intel64 Family 6 Model 189 Stepping 1
Manufacturer: GenuineIntel
Name: Intel(R) Core(TM) Ultra 9 288V
NumberOfCores: 8
NumberOfEnabledCore: 8
NumberOfLogicalProcessors: 8
ThreadCount: 8

Versions of relevant libraries:
[conda] dpcpp-cpp-rt              2024.2.1                 pypi_0    pypi
[conda] intel-cmplr-lib-rt        2024.2.1                 pypi_0    pypi
[conda] intel-cmplr-lib-ur        2024.2.1                 pypi_0    pypi
[conda] intel-cmplr-lic-rt        2024.2.1                 pypi_0    pypi
[conda] intel-extension-for-pytorch 2.3.110+xpu              pypi_0    pypi
[conda] intel-opencl-rt           2024.2.1                 pypi_0    pypi
[conda] intel-openmp              2024.2.1                 pypi_0    pypi
[conda] intel-sycl-rt             2024.2.1                 pypi_0    pypi
[conda] libuv                     1.48.0               h827c3e9_0
[conda] mkl                       2024.2.1                 pypi_0    pypi
[conda] mkl-dpcpp                 2024.2.1                 pypi_0    pypi
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] onemkl-sycl-blas          2024.2.1                 pypi_0    pypi
[conda] onemkl-sycl-datafitting   2024.2.1                 pypi_0    pypi
[conda] onemkl-sycl-dft           2024.2.1                 pypi_0    pypi
[conda] onemkl-sycl-lapack        2024.2.1                 pypi_0    pypi
[conda] onemkl-sycl-rng           2024.2.1                 pypi_0    pypi
[conda] onemkl-sycl-sparse        2024.2.1                 pypi_0    pypi
[conda] onemkl-sycl-stats         2024.2.1                 pypi_0    pypi
[conda] onemkl-sycl-vm            2024.2.1                 pypi_0    pypi
[conda] torch                     2.3.1+cxx11.abi          pypi_0    pypi
[conda] torchvision               0.18.1+cxx11.abi          pypi_0    pypi
[conda] transformers              4.37.0                   pypi_0    pypi
@devpramod devpramod self-assigned this Nov 26, 2024
@devpramod
Copy link
Contributor

Hi @piDack We are looking into this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants