# Environment setup 

Add path to `libprotobuf.so` and `libnvdla_compiler.so` in LD_LIBRARY_PATH



# Compilation Command 

Compilation script : `miniera-hpvm/src/compile_benchmark.sh`

Command:

```
python3 /home/hsharif3/Gitlab/hpvm_release_nvdla/hpvm/build/tools/hpvm/tools/hpvm-clang/main.py -t nvdla --conf-file data/tuner_confs.txt -DMODEL_PARAMS_DIR=${PATH_TO_MODELPARAMS} -fno-exceptions miniera-hpvm.cpp miniera-hpvm

```

*NOTE*: by default hpvm-clang is configured to read calibration inputs from a `calib.txt` file plaed in the current build directoy (see main.py.in in hpvm-clang). By default, INT8 mode is usedm for testing modify main.py in build directory to use FP16 mode (easily configurable)


# Running on EPOCHS chip 

The compilation creates an nvdla module named `hpvm-mod.nvdla` 

Connect to EPOCHS chip:

```
ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 5506 root@ espgate.cs.columbia.edu

```


Running on EPOCHS chip:

```

cd NV_NVDLA/

./nvdla_runtime  --loadable  hpvm-mod.nvdla --image  ${test_image}  --rawdump

```




# Frontend/Source changes required

* Weights must be FP16!

* Weights for FC layers need to be tranposed 

* Modify paths to readTrainedWeights to pass constant file path -- use MODEL_PARAMS_STR as part of string