Commit bfb1bd6b authored by Leona C's avatar Leona C Committed by Robert Kimball

Add doc for new backend api (#2425)

parent a275bfcf
.. backend-support/cpp-api.rst: .. backend-support/cpp-api.rst:
Runtime Backends Backend APIs
################ ############
.. figure:: ../graphics/backend-dgm.png * :ref:`backend-api`
:width: 650px * :ref:`executable-api`
* :ref:`tensor-api`
* :ref:`hosttensor-api`
* :ref:`plaidml-ng-api`
As of version ``0.15``, there is a new backend API to work with functions that
can be compiled as a runtime ``Executable``. Where previously ``Backend`` used a
``shared_ptr<Function>`` as the handle passed to the ``call`` method to execute
a compiled object, the addition of the ``shared_ptr<Executable>`` object has
more direct methods to actions such as ``validate``, ``call``, ``get_performance_data``, and so on. This new API permits any executable to be saved or loaded *into* or
*out of* storage and makes it easier to distinguish when a Function is compiled,
thus making the internals of the ``Backend`` and ``Executable`` easier to
implement.
How to use?
-----------
#. Create a ``Backend``; think of it as a compiler.
#. A ``Backend`` can then produce an ``Executable`` by calling ``compile``.
#. A single iteration of the executable is executed by calling the ``call``
method on the ``Executable`` object.
Various backends are accessible via nGraph core APIs
.. _backend-api:
Backend Backend
======= =======
.. figure:: ../graphics/backend-dgm.png
:width: 650px
Various backends are accessible via nGraph core APIs
.. doxygenclass:: ngraph::runtime::Backend .. doxygenclass:: ngraph::runtime::Backend
:project: ngraph :project: ngraph
:members: :members:
.. _executable-api:
Executable
==========
.. figure:: ../graphics/runtime-exec.png
:width: 650px
The ``compile`` function on an ``Executable`` has more direct methods to
actions such as ``validate``, ``call``, ``get_performance_data``, and so on.
.. doxygenclass:: ngraph::runtime::Executable
:project: ngraph
:members:
.. _tensor-api:
Tensor Tensor
====== ======
...@@ -26,6 +73,7 @@ Tensor ...@@ -26,6 +73,7 @@ Tensor
:members: :members:
.. _hosttensor-api:
HostTensor HostTensor
========== ==========
...@@ -35,6 +83,7 @@ HostTensor ...@@ -35,6 +83,7 @@ HostTensor
:members: :members:
.. _plaidml-ng-api:
PlaidML PlaidML
======= =======
......
.. backend-support/index.rst .. backend-support/index.rst
Transformer, CPU, GPU, PlaidML Transformers, PlaidML
############################### ###############################
...@@ -11,8 +11,6 @@ Transformer, CPU, GPU, PlaidML ...@@ -11,8 +11,6 @@ Transformer, CPU, GPU, PlaidML
* :ref:`gpu_backend` * :ref:`gpu_backend`
What is a backend? What is a backend?
------------------ ------------------
...@@ -25,13 +23,12 @@ current and future nGraph Backends are also available; see, for example, the ...@@ -25,13 +23,12 @@ current and future nGraph Backends are also available; see, for example, the
section on :ref:`plaidml_backend`. section on :ref:`plaidml_backend`.
.. _hybrid_transformer: .. _hybrid_transformer:
Hybrid Transformer Hybrid Transformer
================== ==================
Lorem ipsum Coming soon
.. _cpu_backend: .. _cpu_backend:
...@@ -39,7 +36,7 @@ Lorem ipsum ...@@ -39,7 +36,7 @@ Lorem ipsum
CPU Backend CPU Backend
=========== ===========
Lorem ipsum Coming soon
.. _gpu_backend: .. _gpu_backend:
...@@ -47,7 +44,7 @@ Lorem ipsum ...@@ -47,7 +44,7 @@ Lorem ipsum
GPU Backend GPU Backend
=========== ===========
Lorem ipsum Coming soon
.. _plaidml_backend: .. _plaidml_backend:
......
...@@ -73,11 +73,11 @@ author = 'Intel Corporation' ...@@ -73,11 +73,11 @@ author = 'Intel Corporation'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.13' version = '0.15'
# The Documentation full version, including alpha/beta/rc tags. Some features # The Documentation full version, including alpha/beta/rc tags. Some features
# available in the latest code will not necessarily be documented first # available in the latest code will not necessarily be documented first
release = '0.13-0' release = '0.15.0-rc0'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment