pytorch / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
https://pytorch.org
Other
84.03k stars 22.65k forks source link

quantized.linear fails with aarch64 linux packages of torch. #83504

Closed u99127 closed 2 years ago

u99127 commented 2 years ago

🐛 Describe the bug

$>cat test.py import torch linear = torch.nn.quantized.Linear(5, 2, dtype=torch.qint8) print(linear)

$>python test.py Traceback (most recent call last): File "test.py", line 2, in linear = torch.nn.quantized.Linear(5, 2, dtype=torch.qint8) File "/home/ramana/venv-torch/lib/python3.8/site-packages/torch/nn/quantized/modules/linear.py", line 144, in init self._packed_params = LinearPackedParams(dtype) File "/home/ramana/venv-torch/lib/python3.8/site-packages/torch/nn/quantized/modules/linear.py", line 22, in init self.set_weight_bias(wq, None) File "/home/ramana/venv-torch/lib/python3.8/site-packages/torch/nn/quantized/modules/linear.py", line 27, in set_weight_bias self._packed_params = torch.ops.quantized.linear_prepack(weight, bias) File "/home/ramana/venv-torch/lib/python3.8/site-packages/torch/_ops.py", line 143, in call return self._op(*args, **kwargs or {}) RuntimeError: Didn't find engine for operation quantized::linear_prepack NoQEngine

Versions

Collecting environment information... PyTorch version: 1.12.1 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (aarch64) GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Clang version: 14.0.6-++20220622053131+f28c006a5895-1~exp1~20220622173215.157 CMake version: version 3.16.3 Libc version: glibc-2.31

Python version: 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0] (64-bit runtime) Python platform: Linux-5.4.0-66-generic-aarch64-with-glibc2.29 Is CUDA available: False CUDA runtime version: No CUDA 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

Versions of relevant libraries: [pip3] numpy==1.23.2 [pip3] torch==1.12.1 [pip3] torchvision==0.13.1 [conda] Could not collect

cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo

jerryzh168 commented 2 years ago

quantization is only supported on certain hardwares, please take a look at https://pytorch.org/docs/stable/quantization.html#backend-hardware-support

jerryzh168 commented 2 years ago

closing for now, please feel free to reopen if there are further questions