-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29ceab0
commit f2e1e68
Showing
65 changed files
with
4,307 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
============== | ||
oneAPI Backend | ||
============== | ||
|
||
The ``oneAPI`` backend of hls4ml is designed for deploying NNs on Intel/Altera FPGAs. It will eventually | ||
replace the ``Quartus`` backend, which should really have been called the Intel HLS backend. (The actual Quartus | ||
program continues to be used with IP produced by the ``oneAPI`` backend.) | ||
This section discusses details of the ``oneAPI`` backend. | ||
|
||
The ``oneAPI`` code uses SYCL kernels to implement the logic that is deployed on FPGAs. It naturally leads to the | ||
accelerator style of programming. In the IP Component flow, which is currently the only flow supported, the | ||
kernel becomes the IP, and the "host code" becomes the testbench. An accelerator flow, with easier deployment on | ||
PCIe accelerator boards, is planned to be added in the future. | ||
|
||
The produced work areas use cmake to build the projects in a style based | ||
`oneAPI-samples <https://github.com/oneapi-src/oneAPI-samples/tree/main/DirectProgramming/C%2B%2BSYCL_FPGA>`_. | ||
The standard ``fpga_emu``, ``report``, ``fpga_sim``, and ``fpga`` are supported. Additionally, ``make lib`` | ||
produces the library used for calling the ``predict`` function from hls4ml. The ``compile`` and ``build`` commands | ||
in hls4ml interact with the cmake system, so one does not need to manually use the build system, but it there | ||
if desired. | ||
|
||
The ``oneAPI`` backend, like the ``Quartus`` backend, only implements the ``Resource`` strategy for the layers. There | ||
is no ``Latency`` implementation of any of the layers. | ||
|
||
Note: currently tracing and external weights (i.e. setting BramFactor) are not supported. | ||
|
||
io_parallel and io_stream | ||
========================= | ||
|
||
As mentioned in the :ref:`I/O Types` section, ``io_parallel`` is for small models, while ``io_stream`` is for | ||
larger models. In ``oneAPI``, there is an additional difference: ``io_stream`` implements each layer on its | ||
own ``task_sequence``. Thus, the layers run in parallel, with pipes connecting the inputs and outputs. This | ||
is similar in style to the `dataflow` implementation on Vitis, but more explicit. On the other hand, ``io_parallel`` | ||
always uses a single task, relying on pipelining within the task for good performance. In contrast, the Vitis | ||
backend sometimes uses dataflow with ``io_parallel``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
hls4ml.backends.oneapi.passes package | ||
===================================== | ||
|
||
Submodules | ||
---------- | ||
|
||
hls4ml.backends.oneapi.passes.bn\_quant module | ||
---------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.bn_quant | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.clone\_templates module | ||
----------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.clone_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.convolution\_templates module | ||
----------------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.convolution_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.convolution\_winograd module | ||
---------------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.convolution_winograd | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.core\_templates module | ||
---------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.core_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.embedding\_templates module | ||
--------------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.embedding_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.merge\_templates module | ||
----------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.merge_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.pointwise module | ||
---------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.pointwise | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.pooling\_templates module | ||
------------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.pooling_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.quantization\_templates module | ||
------------------------------------------------------------ | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.quantization_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.recurrent\_templates module | ||
--------------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.recurrent_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.reshaping\_templates module | ||
--------------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.reshaping_templates | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.resource\_strategy module | ||
------------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.resource_strategy | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.passes.transform\_types module | ||
----------------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes.transform_types | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.passes | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
hls4ml.backends.oneapi package | ||
============================== | ||
|
||
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
hls4ml.backends.oneapi.passes | ||
|
||
Submodules | ||
---------- | ||
|
||
hls4ml.backends.oneapi.oneapi\_backend module | ||
--------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.oneapi_backend | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.oneapi\_template module | ||
---------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.oneapi_template | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
hls4ml.backends.oneapi.oneapi\_types module | ||
------------------------------------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi.oneapi_types | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: hls4ml.backends.oneapi | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.