Hardware Synthesis Compiler for Deep Neural Network. It converts MLIR code from onnx-mlir to C++ code that can be synthesized to RTL with Vitis HLS
- onnx-mlir (it might not only work for other commits than https://github.com/onnx/onnx-mlir/commit/76397990d4ef99a088f86e3615af9ca438d01fe0)
- Vitis HLS
- numpy
Train your network with machine learning libraries, and export the result as ONNX.
python tutorial/mnist/mnist.py
Run onnx-mlir to emit MLIR representation of the network.
path/to/onnx-mlir --EmitMLIR tutorial/mnist/mnist.onnx
Run compiler.py to convert the MLIR code to C++ code synthesizable with Vitis HLS.
python compiler.py tutorial/mnist/mnist.onnx.mlir > tutorial/mnist/graph.cpp
Finally, run synthesis on Vitis HLS. This blog might be useful. (Written in Japanese)
Currently, the compiler only supports networks with
- softmax
- relu
- fully-connected
layers. It does not support batch-processing either, so you need to set single element as the input data for the network when you export ONNX network.