This is an example of TensorRT and TREx.
- TensorRT
- Build engine
- Profiling
- TREx
- Visualization
I checked on the following environment.
- reComputer J4012(Jetson Orin NX 16GB)
- JetPack 5.1.2
- TensorRT 8.5.2
- TREx 0.1.6
I created model/model_bn.onnx. This model was generated using the following steps.
https://github.com/NVIDIA-AI-IOT/jetson_dla_tutorial
Please build engine by TensorRT.
trtexec --verbose --profilingVerbosity=detailed --buildOnly --memPoolSize=workspace:8192MiB --onnx=model/model_bn.onnx --saveEngine=model_bn.onnx.engine --int8 --useDLACore=0 --allowGPUFallback > model_bn.onnx.engine.build.log
Please generate metadata of building.
python3 script/generate_build_metadata.py
Please profile by TensorRT.
trtexec --verbose --noDataTransfers --separateProfileRun --useSpinWait --profilingVerbosity=detailed --loadEngine=model_bn.onnx.engine --exportTimes=model_bn.onnx.engine.timing.json --exportProfile=model_bn.onnx.engine.profile.json --exportLayerInfo=model_bn.onnx.engine.graph.json --timingCacheFile=timing.cache > model_bn.onnx.engine.profile.log
Please generate metadata of profiling.
python3 script/generate_profiling_metadata.py
I provided an example notebook(trex_example.ipynb) for visualization.