Skip to content

WuDan0399/Integrate-NVDLA-and-TVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integrate-NVDLA-and-TVM (no longer maintained)

Official code for NVDLA software sw. Official document sw doc.

Designed Workflow

alt text

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.

Current Progress:

  1. Generate NVDLA-specific JSON using TVM frontend compilation tool.
  2. Succesfully run LeNet network architecture (in Relay) on the NVDLA hardware simulator.

How to use

[TVM part]

  1. Install TVM from source using modified GitHub source code.
git clone --recursive https://github.com/shivmgg/tvm
  1. Follow instructions given here to complete the installation.
  2. Run one of example files in examples folder to generate an NVDLA-specific JSON file.
  3. To generate a JSON for LeNet architecture using Relay, run
python3.6 examples/run_LeNet_Relay.py

[NVDLA part]

  1. Build NVDLA hardware simulator. Follow by NVDLA official document.
  2. 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/

How to Run the Whole Process for Model Inference

  1. Generate a JSON for LeNet architecture using Relay, run
python3.6 examples/run_LeNet_Relay.py
  1. 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>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published