Skip to content

Commit a49c189

Browse files
committed
Documentation draft
1 parent 86f75b5 commit a49c189

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/advanced/accelerator.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,48 @@ 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 ``vitis accelerator`` 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+
* `alveo u55c <https://www.xilinx.com/products/boards-and-kits/alveo/u55c.html>`
86+
* `alveo-u50 <https://www.xilinx.com/products/boards-and-kits/alveo/u50.html>`
87+
* `alveo u250 <https://www.xilinx.com/products/boards-and-kits/alveo/u250.html>`
88+
* `versal vck5000 <https://www.xilinx.com/products/boards-and-kits/vck5000.html>`
89+
The backend generates an OpenCL host code that uploads and runs the kernel on the accelerator card.
90+
91+
Example
92+
=======
93+
94+
The following example is a modified version of `hsl4ml example 7 <https://github.com/fastmachinelearning/hls4ml-tutorial/blob/master/part7_deployment.ipynb>`.
95+
96+
.. code-block:: Python
97+
98+
import hls4ml
99+
hls_model = hls4ml.converters.convert_from_keras_model(
100+
model,
101+
hls_config=config,
102+
output_dir='model_3/hls4ml_prj_vitis_accel',
103+
backend='VitisAccelerator',
104+
board='alveo-u55c',
105+
num_kernel=4,
106+
num_thread=8,
107+
batchsize=8192
108+
)
109+
hls_model.compile()
110+
hls_model.build()
111+
112+
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:
113+
* `host` produces only the host code application
114+
* `hls` produces only the kernel object file `.xo`
115+
* `xclbin` produces only the kernel `.xclbin` file
116+
117+
118+
The generated host code application and the xclbin file can be executed as such:
119+
120+
.. code-block:: bash
121+
122+
./host <myproject>.xclbin

0 commit comments

Comments
 (0)