-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: Didn't find engine for operation quantized::linear_prepack NoQEngine on Apple Silicion PyTorch 2.2.2 #123507
Comments
fbgemm was always too x86 oriented, not sure what's the thing with qnnpack though:
|
Sorry about the error in the code, even if I change it to: qconfig = get_default_qconfig('qnnpack') . The issue persists. Furthermore, qnnpack is there:
|
Hi @RazeBerry How about adding the following before torch.backends.quantized.engine = 'qnnpack' |
@RazeBerry is @Xia-Weiwen suggested, specifying quantized engine should fix your problem, though I agree that qnnpack backend (as the only one available on ARM platform) should have been selected by default |
That works! Thank you so much !! It is a bit confusing it has to be intentionally specified at all considering QNN is the only one available on ARM. It would be great if the package can be modified so one doesn't need that line. I am using many packages with pytorch as dependencies and I almost always have problem quantization due to the fact that line is not specified in those packages. |
@Xia-Weiwen @malfet Just one last question, I was wondering if this is were to be expected running it on ARM architecture, have seen Whisper throwing the similar type of error due to non-implementation? Thank you very much
|
@RazeBerry You are using eager mode quantization in your script. In this mode, you need to insert |
馃悰 Describe the bug
When attempting to convert a standard torch.nn.Linear layer to its quantized counterpart using nnq.Linear.from_float(linear), an AssertionError is thrown if the qconfig is not explicitly set for the input module. I have tried to find the solution to this problem everywhere and no one has solved it yet it seems! Furthermore, the problem is concentrated within the Apple Silicon users too.
Versions
PyTorch version: 2.2.2
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 14.2.1 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: version 3.28.3
Libc version: N/A
Python version: 3.11.0 (main, Feb 1 2024, 23:57:54) [Clang 15.0.0 (clang-1500.1.0.2.5)] (64-bit runtime)
Python platform: macOS-14.2.1-arm64-arm-64bit
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:
Apple M2 Pro
Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] onnxruntime==1.17.0
[pip3] optree==0.11.0
[pip3] pytorch-lightning==2.2.1
[pip3] pytorch-metric-learning==2.4.1
[pip3] torch==2.2.2
[pip3] torch-audiomentations==0.11.1
[pip3] torch-pitch-shift==1.2.4
[pip3] torchaudio==2.2.2
[pip3] torchmetrics==1.3.1
[pip3] torchvision==0.17.2
[conda] numpy 1.26.4 py311h7125741_0 conda-forge
[conda] pytorch 2.2.1 py3.11_0 pytorch
[conda] torchvision 0.17.1 py311_cpu pytorch
cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel @malfet @snadampal
The text was updated successfully, but these errors were encountered: