Skip to content

DL Model compile Support for x86 target

Compare
Choose a tag to compare
@chenghuaWang chenghuaWang released this 27 Feb 14:14
· 36 commits to master since this release

The nncv compiler now support DL Model compilation for x86 target.

Currently, nncv supports a very simple lowering pipeline. It basicly uses tiling and vectorization on linalg.ops. And this vectorization method currently only supports CPUs with the AVX2 feature.

If you want to compile a DL model to cpu target(without parallel). You can use commands below to generate a object file:

nncv-c -warp-c-interface -target HostWoParallel res18.mlir -o optimizedRes18.mlir
mlir-translate -mlir-to-llvmir optimizedRes18.mlir -o res18.ll
llc -filetype=object res18.ll -o libres18.o

If you want to enable multi-threads on cpu target, use HostWParallel option instead:

nncv-c -warp-c-interface -target HostWParallel res18.mlir -o optimizedRes18.mlir