DSP Integration Information
Steps
Environment Preparation
Besides basic Environment Preparation, Using DSP requires the integration of dsp_sdk. Dsp_sdk includes heterogeneous programming interfaces using DSP and interface implementations encapsulated into static libraries (named libhthread_host.a). Set the dsp_sdk directory as the environment variable ${dsp_sdk_path}, and the build script will use this environment variable to find dsp_sdk; In addition, a cross compilation tool is required. The installation command is as follows:
sudo apt-get update && apt-get install -y --no-install-recommends \
g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
Build
Under the Linux operating system, one can easily build MindSpore Lite Package integrating DSP interfaces and libraries using build.sh under the root directory of MindSpore Source Code. The command is as follows. It will build MindSpore Lite's package under the output directory under the MindSpore source code root directory, which contains the libmindspore-lite dynamic library, and the test tool Benchmark.
export MSLITE_REGISTRY_DEVICE=ft78
export DSP_SDK_PATH=${your path}/dsp_sdk
export MSLITE_ENABLE_TESTCASES=ON
export MSLITE_ENABLE_TOOLS=ON
bash build.sh -I arm32 -j8
Where ${your path}/dsp_sdk is the path of dsp_sdk. MSLITE_REGISTRY_DEVICE has two options: ft78 and ft04, which correspond to different DSP chips respectively.
For more information about compilation, see Linux Environment Compilation.
Integration
Integration instructions
When developers need to integrate the use of DSP features, it is important to note:
Configure the DSP backend. For more information about using Runtime to perform inference, see Using Runtime to Perform Inference (C++).
Using Benchmark testing DSP inference
Users can test DSP inference using MindSpore Lite's Benchmark tool. Copy the benchmark tool to the
ft78orft04device, An example of using the benchmark tool on a device is as follows:Test performance
./benchmark --device=DSP --modelFile=./models/test_benchmark.ms --timeProfiling=true
For more information about the use of Benchmark, see Benchmark Use.
For environment variable settings, copy libmindspore-lite.so to the /usr/lib directory of ft78 or ft04.
Supported Chips
The DSP chip supports ft04 and ft78.
Supported Operators
For supported DSP operators, see Lite Operator List.