Compiler behavior

Models #

Compilation by Actdk #

The command actdk compile generates model.h, model.py and libmodel.so.

libmodel.so is a shared library including a deep learning model implementation converted from the nnoir file format. model.h and model.py are interfaces to this library.

model.h #

ActDK uses the name of the trained model in nnoir files as a function name. This function is an ordinary C function independent of any other deep learning framework.

If more than one nnoir file exist in model directory, the command generates a function for each model. The conversion fails if there are multiple models with the same name in the model directory.

The input size is the same as that of the original computational graph, but its type is an 1-dimensional float array.

Limitations #

libmodel.so, generated by actdk compile, is a stub library and has the following limitations:

  • No guarantee on the results with multithreaded execution.
  • No Raspberry Pi GPU acceleration.

After uploading the built image, Actcast rebuilds libmodel.so, and replaces the stub with one that utilizes the GPU on Raspberry Pi. The new libmodel.so does exclusive control thus it guarantees the results of multithreaded execution.

model.py #

model.py provides an interface to libmodel.so. The input and output of the entry point are numpy arrays, and their shape is the same as the original model.

Compilation on Actcast build server #

Actcast rebuilds an uploaded image and replaces the libmodel.so with a new and higher-speed version.


Back to Actcast SDK Reference Manual