This guide introduces Driver Compiler for Intel® Neural Processing Unit (NPU) devices. Driver Compiler is a set of C++ libraries providing a common API that allows the User Mode Driver to access compiler functions through vcl* interface methods. The action here is essentially compiling the IR format to the blob format.
To learn more about Driver Compiler, please see intel_npu/README.md in OpenVINO Project.
The main components for Driver Compiler are :
- CHANGES.txt contains the Driver Compiler history of changes.
- docs - documents that describe building and testing the Driver Compiler.
- loader - contains cmakefile to build and pack the elf from thirdparty used for some testing purposes.
- vpux_compiler_l0 - contains source files of Driver Compiler.
- test - contains test tools.
The main entrypoint for Driver Compiler is vclCompilerCreate
. The basic work flow is as follow:
...
vclCompilerCreate
...
vclCompilerGetProperties
...
/* If you want to query the supported layers of a network, please call following three lines. */
...
vclQueryNetworkCreate
...
/* vclQueryNetwork should be called twice, first time to retrieve data size, second time to get data. */
vclQueryNetwork
...
vclQueryNetworkDestroy
...
/* Fill buffer/weights with data read from command line arguments. Will set result blob size. */
...
vclExecutableCreate
...
vclExecutableGetSeriablizableBlob
...
blobSize > 0
blob = (uint8_t*)malloc(blobSize)
vclExecutableGetSeriablizableBlob
...
/* If log handle is created with vclCompilerCreate, can call vclLogHandleGetString to get last error message.*/
...
vclLogHandleGetString
...
logSize > 0
log = (char*)malloc(logSize)
vclLogHandleGetString
...
vclExecutableDestroy
vclCompilerDestroy
...
Driver Compiler provides npu_driver_compiler, compilerTest, profilingTest and loaderTest to compile network and test. To build Driver Compiler related targets locally, refer to