Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs
BSD 2-Clause "Simplified" License
1.67k stars 315 forks source link

Does NNPACK fall back to non-accelerated code when "Could not initialize NNPACK! Reason: Unsupported hardware." occurs? #208

Closed KoenT-SS closed 2 years ago

KoenT-SS commented 2 years ago

Hi,

first: context: I inherited a project using Python3 and PyTorch 1.11.0, and I was running this on Ubuntu 20.04 on an (old) desktop machine. When I run the code, I'm seeing this message pop up (it doesn't say if it's an error or a warning): [W NNPACK.cpp:51] Could not initialize NNPACK! Reason: Unsupported hardware. I checked /proc/cpuinfo and the machine doesn't support AVX2 (it's an Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz), so that could be the reason for this message. The code does appear to continue to run though, and I also get a nice confusion matrix of the classification task it's running at the end, which appears reasonable compared to previously reported results with that code.

So, my question is: What happens when NNPACK detects there is no AVX2 support (I presume) on the machine it's running on? Does it fall back to non-accelerated code in that case (so, still running correctly, but slower)?

Thanks for your feedback!

Koen

Maratyszcza commented 2 years ago

NNPACK doesn't have a fall-back for unsupported machines. Higher-level frameworks integrating NNPACK may have one.