Question about running a trained ONNX model
If I have an exported serialized ONNX model, will hardware acceleration such as AVX-512 only take place if the original ngraph distribution was compiled on a machine with AVX-512 CPU extensions?
Or in other words, if I test on a non-AVX-512 system and then bundle the entire package up and run it on a different system with AVX-512 extensions will inference be AVX-512 hardware accelerated?
Apologies in advance if this is the wrong forum for this question.
For the most part, you will get AVX-512 hardware acceleration through MKLDNN kernels. There are a few kernels (e.g, Eigen-based operator implementations) that are compiled during ngraph build process which will not use the target system's ISA.
Is there any way to specify the target architecture during the build process for this?
Not currently but I have a PR that'll let you do this via CMake. When this is merged, you'll be able to change it like so:
cmake -DNGRAPH_TARGET_ARCH=skylake-avx512 ...
Awesome, thank you.
I also added this cmake option to the documentation to go in with this PR.