Skip to content

Commit

Permalink
Update Sphinx Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 25, 2024
1 parent 29ceab0 commit f2e1e68
Show file tree
Hide file tree
Showing 65 changed files with 4,307 additions and 204 deletions.
35 changes: 35 additions & 0 deletions _sources/advanced/oneapi.rst.txt
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``.
8 changes: 8 additions & 0 deletions _sources/autodoc/hls4ml.backends.catapult.passes.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ hls4ml.backends.catapult.passes package
Submodules
----------

hls4ml.backends.catapult.passes.bn\_quant module
------------------------------------------------

.. automodule:: hls4ml.backends.catapult.passes.bn_quant
:members:
:undoc-members:
:show-inheritance:

hls4ml.backends.catapult.passes.broadcast\_stream module
--------------------------------------------------------

Expand Down
8 changes: 0 additions & 8 deletions _sources/autodoc/hls4ml.backends.fpga.passes.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ hls4ml.backends.fpga.passes package
Submodules
----------

hls4ml.backends.fpga.passes.bn\_quant module
--------------------------------------------

.. automodule:: hls4ml.backends.fpga.passes.bn_quant
:members:
:undoc-members:
:show-inheritance:

hls4ml.backends.fpga.passes.bram\_weights module
------------------------------------------------

Expand Down
125 changes: 125 additions & 0 deletions _sources/autodoc/hls4ml.backends.oneapi.passes.rst.txt
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:
45 changes: 45 additions & 0 deletions _sources/autodoc/hls4ml.backends.oneapi.rst.txt
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:
8 changes: 8 additions & 0 deletions _sources/autodoc/hls4ml.backends.quartus.passes.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ hls4ml.backends.quartus.passes package
Submodules
----------

hls4ml.backends.quartus.passes.bn\_quant module
-----------------------------------------------

.. automodule:: hls4ml.backends.quartus.passes.bn_quant
:members:
:undoc-members:
:show-inheritance:

hls4ml.backends.quartus.passes.convolution\_templates module
------------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions _sources/autodoc/hls4ml.backends.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Subpackages

hls4ml.backends.catapult
hls4ml.backends.fpga
hls4ml.backends.oneapi
hls4ml.backends.quartus
hls4ml.backends.symbolic
hls4ml.backends.vitis
Expand Down
8 changes: 8 additions & 0 deletions _sources/autodoc/hls4ml.backends.vivado.passes.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ hls4ml.backends.vivado.passes package
Submodules
----------

hls4ml.backends.vivado.passes.bn\_quant module
----------------------------------------------

.. automodule:: hls4ml.backends.vivado.passes.bn_quant
:members:
:undoc-members:
:show-inheritance:

hls4ml.backends.vivado.passes.broadcast\_stream module
------------------------------------------------------

Expand Down
8 changes: 8 additions & 0 deletions _sources/autodoc/hls4ml.writer.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ hls4ml.writer.catapult\_writer module
:undoc-members:
:show-inheritance:

hls4ml.writer.oneapi\_writer module
-----------------------------------

.. automodule:: hls4ml.writer.oneapi_writer
:members:
:undoc-members:
:show-inheritance:

hls4ml.writer.quartus\_writer module
------------------------------------

Expand Down
1 change: 1 addition & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

advanced/fifo_depth
advanced/extension
advanced/oneapi
advanced/accelerator
advanced/model_optimization

Expand Down
5 changes: 3 additions & 2 deletions advanced/accelerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Hardware-aware Optimization API" href="model_optimization.html" />
<link rel="prev" title="Extension API" href="extension.html" />
<link rel="prev" title="oneAPI Backend" href="oneapi.html" />
</head>

<body class="wy-body-for-nav">
Expand Down Expand Up @@ -66,6 +66,7 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="fifo_depth.html">FIFO Buffer Depth Optimization</a></li>
<li class="toctree-l1"><a class="reference internal" href="extension.html">Extension API</a></li>
<li class="toctree-l1"><a class="reference internal" href="oneapi.html">oneAPI Backend</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">VivadoAccelerator Backend</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#neural-network-overlay">Neural Network Overlay</a></li>
<li class="toctree-l2"><a class="reference internal" href="#example">Example</a></li>
Expand Down Expand Up @@ -171,7 +172,7 @@ <h2>Example<a class="headerlink" href="#example" title="Link to this heading">
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="extension.html" class="btn btn-neutral float-left" title="Extension API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="oneapi.html" class="btn btn-neutral float-left" title="oneAPI Backend" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="model_optimization.html" class="btn btn-neutral float-right" title="Hardware-aware Optimization API" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

Expand Down
5 changes: 3 additions & 2 deletions advanced/extension.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="VivadoAccelerator Backend" href="accelerator.html" />
<link rel="next" title="oneAPI Backend" href="oneapi.html" />
<link rel="prev" title="FIFO Buffer Depth Optimization" href="fifo_depth.html" />
</head>

Expand Down Expand Up @@ -69,6 +69,7 @@
<li class="toctree-l2"><a class="reference internal" href="#complete-example">Complete example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="oneapi.html">oneAPI Backend</a></li>
<li class="toctree-l1"><a class="reference internal" href="accelerator.html">VivadoAccelerator Backend</a></li>
<li class="toctree-l1"><a class="reference internal" href="model_optimization.html">Hardware-aware Optimization API</a></li>
</ul>
Expand Down Expand Up @@ -287,7 +288,7 @@ <h2>Complete example<a class="headerlink" href="#complete-example" title="Link t
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="fifo_depth.html" class="btn btn-neutral float-left" title="FIFO Buffer Depth Optimization" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="accelerator.html" class="btn btn-neutral float-right" title="VivadoAccelerator Backend" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="oneapi.html" class="btn btn-neutral float-right" title="oneAPI Backend" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

<hr/>
Expand Down
1 change: 1 addition & 0 deletions advanced/fifo_depth.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">FIFO Buffer Depth Optimization</a></li>
<li class="toctree-l1"><a class="reference internal" href="extension.html">Extension API</a></li>
<li class="toctree-l1"><a class="reference internal" href="oneapi.html">oneAPI Backend</a></li>
<li class="toctree-l1"><a class="reference internal" href="accelerator.html">VivadoAccelerator Backend</a></li>
<li class="toctree-l1"><a class="reference internal" href="model_optimization.html">Hardware-aware Optimization API</a></li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions advanced/model_optimization.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="fifo_depth.html">FIFO Buffer Depth Optimization</a></li>
<li class="toctree-l1"><a class="reference internal" href="extension.html">Extension API</a></li>
<li class="toctree-l1"><a class="reference internal" href="oneapi.html">oneAPI Backend</a></li>
<li class="toctree-l1"><a class="reference internal" href="accelerator.html">VivadoAccelerator Backend</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Hardware-aware Optimization API</a></li>
</ul>
Expand Down
Loading

0 comments on commit f2e1e68

Please sign in to comment.