Skip to content

Commit 728f914

Browse files
axiotiskQuentin Berthet
authored andcommitted
Documentation draft
1 parent c5cabc4 commit 728f914

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/advanced/accelerator.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,50 @@ The ``predict`` method will send the input data to the PL and return the output
7575
7676
nn = NeuralNetworkOverlay('hls4ml_nn.bit', X_test.shape, y_test.shape)
7777
y_hw, latency, throughput = nn.predict(X_test, profile=True)
78+
79+
========================
80+
VitisAccelerator Backend
81+
========================
82+
83+
The ``VitsAccelerator`` backned makes use of the vitis kernel flow to and streamlines the generation of an hls4ml project targeting PCIe accelerators.
84+
Vitis accelerator backend supports the following boards:
85+
86+
* `Alveo u50 <https://www.xilinx.com/products/boards-and-kits/alveo/u50.html>`_
87+
* `Alveo u55c <https://www.xilinx.com/products/boards-and-kits/alveo/u55c.html>`_
88+
* `Alveo u250 <https://www.xilinx.com/products/boards-and-kits/alveo/u250.html>`_
89+
* `Versal vck5000 <https://www.xilinx.com/products/boards-and-kits/vck5000.html>`_
90+
91+
The backend also generates an `OpenCL` host code that uploads and runs the kernel on the accelerator card.
92+
93+
Example
94+
=======
95+
96+
The following example is a modified version of `hsl4ml example 7 <https://github.com/fastmachinelearning/hls4ml-tutorial/blob/master/part7_deployment.ipynb>`_.
97+
98+
.. code-block:: Python
99+
100+
import hls4ml
101+
hls_model = hls4ml.converters.convert_from_keras_model(
102+
model,
103+
hls_config=config,
104+
output_dir='model_3/hls4ml_prj_vitis_accel',
105+
backend='VitisAccelerator',
106+
board='alveo-u55c',
107+
num_kernel=4,
108+
num_thread=8,
109+
batchsize=8192
110+
)
111+
hls_model.compile()
112+
hls_model.build()
113+
114+
By default the build method generates all the necessary files to run the kernel on the accelerator board. As this can be a long process, there are three build options that target the generation of specific parts of the project:
115+
116+
* `host`: Compiles the host application
117+
* `hls`: Produces only the kernel's object file
118+
* `xclbin`: Produces only the kernel's .xclbin file
119+
120+
The generated host code application and the xclbin file can be executed as such:
121+
122+
.. code-block:: Bash
123+
124+
./host <myproject>.xclbin

0 commit comments

Comments
 (0)