ONE - On-device Neural Engine
|
This document is based on the system where Ubuntu Desktop Linux 20.04 LTS is installed with default settings, and can be applied in other environments without much difference. For reference, the development of our project started in the Ubuntu Desktop Linux 16.04 LTS environment.
If you are going to build this project, the following modules must be installed on your system:
In the Ubuntu, you can easily install it with the following command.
If your linux system does not have the basic development configuration, you will need to install more packages. A list of all packages needed to configure the development environment can be found in https://github.com/Samsung/ONE/blob/master/infra/docker/focal/Dockerfile.
Here is a summary of it for runtime and related tools
In a typical linux development environment, including Ubuntu, you can build the runtime with a simple command like this:
For easy build process, we provides Makefile.template
makefile.
To release build the runtime, add the environment variable BUILD_TYPE=release
to the build command as follows.
Or you can simply do something like this:
The build method described here is a native build
in which the build environment and execution environment are same. So, this command creates a runtime binary targeting the current build architecture, probably x86_64, as the execution environment. You can find the build output in the ./Product folder as follows:
Here, let's recall that the main target of our project is the arm architecture. If you have a development environment running Linux for arm on a device made of an arm CPU, such as Odroid-XU4, you will get a runtime binary that can be run on the arm architecture with the same command above. This is the simplest way to get a binary for an arm device. However, in most cases, native builds on arm devices are too impractical as they require too long. Therefore, we will create an executable binary of an architecture other than x86_64 through a cross build
. For cross-build method for each architecture, please refer to the corresponding document in the following section, How to cross-build runtime for different architecture.
The simple way to check whether the build was successful is to perform inference of the NN model using the runtime. The model to be used for the test can be obtained as follows.
The result of running the inception_v3 model using runtime is as follows. Please consider that this is a test that simply checks execution latency without considering the accuracy of the model.
If you use tflite_run
instead of onert_run
, the model will be executed using Tensorflow lite, the basic framework for verification. From the previous build result, you can see that it is the path to the directory where tflite_run
and onert_run
are located.
If you come here without any problems, you have all of the basic environments for runtime development.
(Will be written)
If your development system is not a linux environment like Ubuntu, but you can use docker on your system, you can build a runtime using a pre-configured docker image. Of course, you can also build a runtime using a docker image in a ubuntu environment, without setting up a complicated development environment. For more information, please refer to the following document.
Please refer to the following document for the build method for architecture other than x86_64, which is the basic development environment.