intel / intel-extension-for-pytorch

A Python package for extending the official PyTorch that can easily obtain performance on Intel platform
Apache License 2.0
1.46k stars 224 forks source link

RuntimeError: FFT_INVALID_DESCRIPTOR while using ChatTTS #644

Open 771991673 opened 1 month ago

771991673 commented 1 month ago

Describe the bug

I got this runtime error while infering speech with xpu. without the device param works fine with cpu or nvidia gpu on Colab. Please Feel Free to check my notebook.

chat = Chat() chat.load_models(compile=False, device="xpu")

Pytorch Version:

!pip install torch==2.1.0.post2 torchvision==0.16.0.post2 torchaudio==2.1.0.post2 intel-extension-for-pytorch==2.1.30+xpu oneccl_bind_pt==2.1.300+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/

https://colab.research.google.com/#fileId=https%3A//storage.googleapis.com/kaggle-colab-exported-notebooks/chattts-346a79ee-0e6d-454a-b946-5bc9068944b4.ipynb%3FX-Goog-Algorithm%3DGOOG4-RSA-SHA256%26X-Goog-Credential%3Dgcp-kaggle-com%2540kaggle-161607.iam.gserviceaccount.com/20240602/auto/storage/goog4_request%26X-Goog-Date%3D20240602T012040Z%26X-Goog-Expires%3D259200%26X-Goog-SignedHeaders%3Dhost%26X-Goog-Signature%3D4e7cdb3f472724de47ce88fccbe902433241daf6531adfdf13974c4f61eda17d0f028750cdcbeb42f610912327d3f03b5c8ee6778484734f6e4e1babba0e49784b3ac025b527efea0804f431428b825ec3265b9c8de27e6ef12f567dc36c959995b8b99d53c1e0391b0c1edf6b63e1c936a5568be88c50d83e6287c9f9301756c4095e0d74c10511d79f1540a6a05618c2782083d3baeb252db6ed9bb924ec343561b8a513d3c24db0b0790e97bf77ce1fe38ac731f99101450add542e692bb641c70e3ea408294b85112df852a379ecd8d943f34edfde8f1ef9e7705e85f7dc1f63211ae6a9bbcb584e085af32108d7624331432ddd1097c9e9111a162c3f94

File ~/ChatTTS/venv/lib/python3.10/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, *kwargs) 1522 # If we don't have any hooks, we want to skip the rest of the logic in 1523 # this function, and just call forward. 1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks 1525 or _global_backward_pre_hooks or _global_backward_hooks 1526 or _global_forward_hooks or _global_forward_pre_hooks): -> 1527 return forward_call(args, **kwargs) 1529 try: 1530 result = None

File ~/ChatTTS/venv/lib/python3.10/site-packages/vocos/spectral_ops.py:46, in ISTFT.forward(self, spec) 34 """ 35 Compute the Inverse Short Time Fourier Transform (ISTFT) of a complex spectrogram. 36 (...) 42 Tensor: Reconstructed time-domain signal of shape (B, L), where L is the length of the output signal. 43 """ 44 if self.padding == "center": 45 # Fallback to pytorch native implementation ---> 46 return torch.istft(spec, self.n_fft, self.hop_length, self.win_length, self.window, center=True) 47 elif self.padding == "same": 48 pad = (self.win_length - self.hop_length) // 2

RuntimeError: FFT_INVALID_DESCRIPTOR

Versions

Collecting environment information... PyTorch version: 2.1.0.post2+cxx11.abi PyTorch CXX11 ABI: Yes IPEX version: 2.1.30+xpu IPEX commit: 474a6b3cb Build type: Release

OS: Ubuntu 22.04.4 LTS (x86_64) GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Clang version: N/A IGC version: 2024.1.2 (2024.1.2.20240508) CMake version: N/A Libc version: glibc-2.35

Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime) Python platform: Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 Is XPU available: True DPCPP runtime version: 2024.1 MKL version: 2024.1 GPU models and configuration: [0] _DeviceProperties(name='Intel(R) Graphics [0x56a0]', platform_name='Intel(R) Level-Zero', dev_type='gpu', driver_version='1.3.28202', has_fp64=0, total_memory=15930MB, max_compute_units=512, gpu_eu_count=512) Intel OpenCL ICD version: 23.52.28202.52-821~22.04 Level Zero version: 1.3.28202.52-821~22.04

CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 12 On-line CPU(s) list: 0-11 Vendor ID: AuthenticAMD Model name: AMD Ryzen 5 5600 6-Core Processor CPU family: 25 Model: 33 Thread(s) per core: 2 Core(s) per socket: 6 Socket(s): 1 Stepping: 2 BogoMIPS: 6986.91 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid Virtualization: AMD-V Hypervisor vendor: Microsoft Virtualization type: full L1d cache: 192 KiB (6 instances) L1i cache: 192 KiB (6 instances) L2 cache: 3 MiB (6 instances) L3 cache: 32 MiB (1 instance) Vulnerability Gather data sampling: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Mitigation; safe RET, no microcode Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected

Versions of relevant libraries: [pip3] intel-extension-for-pytorch==2.1.30+xpu [pip3] numpy==1.26.4 [pip3] torch==2.1.0.post2+cxx11.abi [pip3] torchaudio==2.1.0.post2+cxx11.abi [pip3] torchvision==0.16.0.post2+cxx11.abi [pip3] vector-quantize-pytorch==1.14.24 [conda] N/A

nazneenn commented 1 month ago

Hello, thanks for reporting this issue. I will look into this issue and get back to you.

771991673 commented 1 month ago

Hello, thanks for reporting this issue. I will look into this issue and get back to you.

Thank you so much nazneenn :))

nazneenn commented 1 month ago

I can reproduce the issue. checking internally. will get back to you. Thanks

nazneenn commented 1 week ago

Hi @771991673 , This is a know issue and it has been fixed. Kindly check using the provided commit ID. https://github.com/intel/intel-extension-for-pytorch/commit/613db648ce201353e4c487bbf60a40ea3fa7b080

NineMeowICT commented 1 week ago

Hi @771991673 , This is a know issue and it has been fixed. Kindly check using the provided commit ID. 613db64

Thanks! When will the next XPU version be released?

771991673 commented 6 days ago

Hi @771991673 , This is a know issue and it has been fixed. Kindly check using the provided commit ID. 613db64

Thank you so much nazneenn. But I am wondering how to install this version ipex.

nazneenn commented 6 days ago

Thank you so much nazneenn. But I am wondering how to install this version ipex.

Hi @771991673 , you can git clone the repo for the specific commit id and then build ipex from source using bash compile_bundle.sh <DPCPPROOT> <MKLROOT> <CCLROOT> <MPIROOT> [AOT] For more information please go through https://intel.github.io/intel-extension-for-pytorch/index.html#installation?platform=gpu&version=v2.1.30%2bxpu&os=linux%2fwsl2&package=source

NineMeowICT commented 1 day ago

Hi @771991673 , you can git clone the repo for the specific commit id and then build ipex from source using bash compile_bundle.sh <DPCPPROOT> <MKLROOT> <CCLROOT> <MPIROOT> [AOT] For more information please go through https://intel.github.io/intel-extension-for-pytorch/index.html#installation?platform=gpu&version=v2.1.30%2bxpu&os=linux%2fwsl2&package=source

Segmentation fault raised after xpu-main ipex installation: full_log.log

I had tried to build packages twice. I checkouted and built 2.1.30+xpu successfully the first time and then xpu-main, and the virtual env used were different. OS: Linux Mint 21.3 oneAPI DPC++ version: 2024.01

Sanity Test: python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch.version); print(ipex.version); [print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];"

2.3.0+cxx11.abi 2.3.110+gitb05d045 [0]: _XpuDeviceProperties(name='Intel(R) Arc(TM) A770 Graphics', platform_name='Intel(R) Level-Zero', type='gpu', driver_version='1.3.29138', total_memory=15473MB, max_compute_units=512, gpu_eu_count=512, gpu_subslice_count=32, max_work_group_size=1024, max_num_sub_groups=128, sub_group_sizes=[8 16 32], has_fp16=1, has_fp64=0, has_atomic64=1)