ngraph icon indicating copy to clipboard operation
ngraph copied to clipboard

Question about running a trained ONNX model

Open MedLexAI opened this issue 8 years ago • 5 comments

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.

MedLexAI avatar Apr 12 '18 00:04 MedLexAI

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.

jbobba avatar Apr 12 '18 01:04 jbobba

Is there any way to specify the target architecture during the build process for this?

MedLexAI avatar Apr 13 '18 16:04 MedLexAI

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 ...

jmenon avatar Apr 13 '18 20:04 jmenon

Awesome, thank you.

MedLexAI avatar Apr 15 '18 18:04 MedLexAI

I also added this cmake option to the documentation to go in with this PR.

indie avatar Apr 16 '18 12:04 indie