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.
- Generate NVDLA-specific JSON using TVM frontend compilation tool.
- Succesfully run LeNet network architecture (in Relay) on the NVDLA hardware simulator.
[TVM part]
- Install TVM from source using modified GitHub source code.
git clone --recursive https://github.com/shivmgg/tvm
- Follow instructions given here to complete the installation.
- Run one of example files in
examples
folder to generate an NVDLA-specific JSON file. - To generate a JSON for LeNet architecture using Relay, run
python3.6 examples/run_LeNet_Relay.py
[NVDLA part]
- Build NVDLA hardware simulator. Follow by NVDLA official document.
- Get and build the modified NVDLA compiler code
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/
- Generate a JSON for LeNet architecture using Relay, run
python3.6 examples/run_LeNet_Relay.py
- Use Json file as input and generate loadable file.
cd <path to sw>/sw/umd/out/apps/compiler/nvdla_compiler/
./nvdla_compiler --json_file <path_to_json_file>