snakers4 / silero-models

Silero Models: pre-trained speech-to-text, text-to-speech and text-enhancement models made embarrassingly simple
Other
5k stars 315 forks source link

Bug report - [v4 tts fails on debian 12] #260

Closed j217 closed 1 year ago

j217 commented 1 year ago

🐛 Bug

V4 TTS fails on vanilla Debian 12.

To Reproduce

Steps to reproduce the behavior:

  1. install Debian 12 in VM
  2. apt-get install python3-torch
  3. run example code of standalone TTS

$ python3 tts-v4 100.0% Traceback (most recent call last): File "/home/j217/tts-v4", line 13, in model = torch.package.PackageImporter(local_file).load_pickle("tts_models", "model") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/torch/package/package_importer.py", line 271, in load_pickle result = unpickler.load() ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/pickle.py", line 1213, in load dispatchkey[0] File "/usr/lib/python3.11/pickle.py", line 1254, in load_binpersid self.append(self.persistent_load(pid)) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/torch/package/package_importer.py", line 249, in persistent_load loaded_reduces[reduce_id] = func(self, *args) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/torch/jit/_script.py", line 372, in unpackage_script_module cpp_module = torch._C._import_ir_module_from_package( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Unknown builtin op: aten::scaled_dot_product_attention. Here are some suggestions: aten::_scaled_dot_product_attention

The original call is: File ".data/ts_code/code/torch/torch/nn/functional.py", line 489 _114 = [bsz, num_heads, src_len0, head_dim] v8 = torch.view(v6, _114) attn_output5 = torch.scaled_dot_product_attention(q3, k8, v8, attn_mask16, dropout_p0, is_causal)


    _115 = torch.permute(attn_output5, [2, 0, 1, 3])
    _116 = torch.contiguous(_115)
'multi_head_attention_forward' is being compiled since it was called from 'MultiheadAttention.forward'
Serialized   File ".data/ts_code/code/__torch__/torch/nn/modules/activation.py", line 44
    _6 = "The fast path was not hit because {}"
    _7 = "MultiheadAttention does not support NestedTensor outside of its fast path. "
    _8 = __torch__.torch.nn.functional.multi_head_attention_forward
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
    _9 = uninitialized(Tuple[Tensor, Tensor])
    _10 = uninitialized(Optional[Tensor])

j217@delero:~$ 

## Expected behavior
Creation of sample WAV file

## Environment
$ python3 collect_env.py
Collecting environment information...
PyTorch version: 1.13.0a0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 12 (bookworm) (x86_64)
GCC version: (Debian 12.2.0-14) 12.2.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.36

Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] (64-bit runtime)
Python platform: Linux-6.1.0-13-amd64-x86_64-with-glibc2.36
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      40 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             1
On-line CPU(s) list:                0
Vendor ID:                          GenuineIntel
Model name:                         Common KVM processor
CPU family:                         15
Model:                              6
Thread(s) per core:                 1
Core(s) per socket:                 1
Socket(s):                          1
Stepping:                           1
BogoMIPS:                           5387.01
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti
Hypervisor vendor:                  KVM
Virtualization type:                full
L1d cache:                          32 KiB (1 instance)
L1i cache:                          32 KiB (1 instance)
L2 cache:                           4 MiB (1 instance)
L3 cache:                           16 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Mitigation: VMX unsupported
Vulnerability L1tf:                 Mitigation; PTE Inversion
Vulnerability Mds:                  Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Unknown: No mitigations
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] numpy==1.24.2
[pip3] torch==1.13.0a0+gitunknown
[conda] Could not collect

## Additional context
V2 TTS example runs OK.
pip install of torch 1.10 fails:
$ pip  install --break-system-packages -q torch==1.10
ERROR: Could not find a version that satisfies the requirement torch==1.10 (from versions: 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1)
ERROR: No matching distribution found for torch==1.10
j217 commented 1 year ago

Fixed the issue with pip install --break-system-packages -q torch==2.1.1 Please make correction to your example code!

snakers4 commented 1 year ago

Looks like some distros have some outdated packages as the final version. Since we went for a minimal setup (i.e. just torch.hub.load instead of heavier packaging).

In any case, the docs explicitly say which PyTorch to use:

https://github.com/snakers4/silero-models#dependencies-1