Official code for NVDLA software sw. Official document sw doc.
First, TVM performs frontend compilation to translate frontend languages such as Caffe to intermediate representation using the existing Relay compiler. Then, TVM’s Bring Your Own Codegen (BYOC) framework infrastructure is used to convert the Relay IR into a json file containing the neural network information. Then, the modified and rebuilt NVDLA compiler accepts the json file as input and outputs a loadable file. Finally, the loadable file and test image are fed to the NVDLA runtime for model inference.
For more information, refer to the complete project report in the folder.
[TVM part]
git clone --recursive https://github.com/shivmgg/tvm
examples
folder to generate an NVDLA-specific JSON file. python3.6 examples/run_LeNet_Relay.py
[NVDLA part]
cd {sw-repo-root}/umd
export TOP={sw-repo-root}/umd
make compiler
The compiler is in ./out/apps/compiler/nvdla_compiler
, copy libnvdla_compiler.so to the same folder to use the compiler:
cp <path to sw>/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so <path to sw>/sw/umd/out/apps/compiler/nvdla_compiler/
python3.6 examples/run_LeNet_Relay.py
cd <path to sw>/sw/umd/out/apps/compiler/nvdla_compiler/
./nvdla_compiler --json_file <path_to_json_file>