Commit 90ca4d87 authored by Leona C's avatar Leona C Committed by Scott Cyphers

Update README to fix broken TF link (#3192)

* Update ngtf bridge doc for generic versioning

* Many improvements, including previous group-based edits

- New section for docs on extra-experimental project-based features
- Team-based edits from PR 2994 added
- Reorganize GSG sections to be cleaner for getting started
- Fix link style warning generated by broadcast.hpp

* Update README with correct ngraph-bridge link on tf repo

* Fix comment so warning not generated on broadcasting op

* Add latest doc changes to ReleaseNotes

* Fix wording suggestion on PR review

* Update HE Transformer experimental backend
parent fde81260
......@@ -14,8 +14,7 @@ workloads on CPU for inference, please refer to the links below.
| Framework (Version) | Installation guide | Notes
|----------------------------|----------------------------------------|-----------------------------------
| TensorFlow* 1.13.1 | [Pip install](https://github.com/NervanaSystems/ngraph-tf#option-1-use-a-pre-built-ngraph-tensorflow-bridge) or [Build from source](https://github.com/NervanaSystems/ngraph-tf#option-2-build-ngraph-bridge-from-source) | 20 [Validated workloads]
| MXNet* 1.3 | [Pip install](https://github.com/NervanaSystems/ngraph-mxnet#Installation) or [Build from source](https://github.com/NervanaSystems/ngraph-mxnet#building-with-ngraph-support)| 18 [Validated workloads]
| TensorFlow* | [Pip install](https://github.com/tensorflow/ngraph-bridge#use-pre-built-packages) or [Build from source](https://github.com/tensorflow/ngraph-bridge#build-ngraph-from-source) | 20 [Validated workloads]
| ONNX 1.4 | [Pip install](https://github.com/NervanaSystems/ngraph-onnx#installation) | 17 [Validated workloads]
......
......@@ -73,7 +73,6 @@ See :ref:`ngraph_plaidml_backend` section on how to build the
nGraph-PlaidML.
Other integration paths
=======================
......
......@@ -17,17 +17,6 @@ as a backend to ONNX with the add-on package `nGraph ONNX`_.
support.
Installation
------------
To prepare your environment to use nGraph and ONNX, install the Python packages
for nGraph, ONNX and NumPy:
::
$ pip install ngraph-core onnx numpy
Importing an ONNX model
-----------------------
......
......@@ -10,8 +10,7 @@ workloads:
* :ref:`tensorflow_valid`
* :ref:`mxnet_valid`
* :ref:`onnx_valid`
* :doc:`../../project/extras/testing_latency.rst`
.. _tensorflow_valid:
......
......@@ -35,11 +35,11 @@ nGraph Compiler stack
For information about the releases, see the :doc:`../project/release-notes`.
The nGraph Library and Compiler stack are provided under the `Apache 2.0 license`_
(found in the LICENSE file in the project's `GitHub repo`_). It may also import
or reference packages, scripts, and other files that use licensing.
(found in the LICENSE file in the project's `repo`_). It may also import or reference
packages, scripts, and other files that use licensing.
.. _Apache 2.0 license: https://github.com/NervanaSystems/ngraph/blob/master/LICENSE
.. _GitHub repo: https://github.com/NervanaSystems/ngraph
.. _repo: https://github.com/NervanaSystems/ngraph
.. toctree::
......@@ -94,7 +94,7 @@ or reference packages, scripts, and other files that use licensing.
project/contribution-guide.rst
project/doc-contributor-README.rst
project/index.rst
project/extras.rst
project/extras/index.rst
glossary.rst
.. only:: html
......
.. project/extras.rst
#######
Extras
#######
* :ref:`homomorphic_encryption`
* :ref:`distributed_training`
This section contains extra tools and tips for working with up-and-coming
features of the nGraph Compiler stack.
.. _homomorphic_encryption:
Homomorphic Encryption (HE)
===========================
* **Encryption with Intel® HE transformer for nGraph™**
* The `Intel HE_transformer`_ enables deep encryption with nGraph Backends.
* `Blog post`_ with `examples`_
.. note:: Some implementations using TensorFlow* may also work with the
`nGraph Bridge repo`_ if older versions of ``ngraph-tf`` are not
available.
.. _distributed_training:
.. project/extras/distributed_training.rst:
Distributed training with nGraph
================================
......@@ -43,7 +11,7 @@ Distributed training with nGraph
How? (Generic frameworks)
-------------------------
See also: :doc:`../core/constructing-graphs/distribute-train`
See also: :doc:`../../core/constructing-graphs/distribute-train`
To synchronize gradients across all workers, the essential operation for data
parallel training, due to its simplicity and scalability over parameter servers,
......@@ -58,7 +26,7 @@ find it worthwhile to experiment with different modes or variations of
distributed training. Deployments using nGraph Library with supported backends
can be configured to train with data parallelism and will soon work with model
parallelism. Distributing workloads is increasingly important, as more data and
bigger models mean the ability to :doc:`../core/constructing-graphs/distribute-train`
bigger models mean the ability to :doc:`../../core/constructing-graphs/distribute-train`
work with larger and larger datasets, or to work with models having many layers
that aren't designed to fit to a single device.
......@@ -72,11 +40,4 @@ mini-batch training, one could train ResNet-50 with Imagenet-1k data to the
*Top 5* classifier in minutes using thousands of CPU nodes. See
`arxiv.org/abs/1709.05011`_.
.. _nGraph Bridge repo: https://github.com/tensorflow/ngraph-bridge
.. _Intel HE_transformer: https://github.com/NervanaSystems/he-transformer
.. _Blog post: https://www.intel.ai/he-transformer-for-ngraph-enabling-deep-learning-on-encrypted-data/
.. _examples: https://github.com/NervanaSystems/he-transformer#examples
.. _arxiv.org/abs/1709.05011: https://arxiv.org/format/1709.05011
.. _based on the synchronous: https://arxiv.org/format/1602.06709
.. _arxiv.org/abs/1709.05011: https://arxiv.org/format/1709.05011
\ No newline at end of file
.. project/extras/homomorphic_encryption.rst:
Homomorphic Encryption (HE)
===========================
* **Encryption with Intel® HE transformer for nGraph™**
* The `Intel HE_transformer`_ is an experimental nGraph backend
which enables deep learning on encrypted data using homomorphic
encryption.
* `Blog post`_ with `examples`_
.. note:: Some implementations using TensorFlow* may also work with the
`nGraph Bridge repo`_ if older versions of ``ngraph-tf`` are not
available.
.. _Intel HE_transformer: https://github.com/NervanaSystems/he-transformer
.. _Blog post: https://www.intel.ai/he-transformer-for-ngraph-enabling-deep-learning-on-encrypted-data/
.. _examples: https://github.com/NervanaSystems/he-transformer#examples
.. _nGraph Bridge repo: https://github.com/tensorflow/ngraph-bridge
.. project/extras/index.rst
#######
Extras
#######
This section contains extra tools and tips for working with
previously-tested, or up-and-coming features of the nGraph
Compiler stack.
.. toctree::
:maxdepth: 1
homomorphic_encryption.rst
distributed_training.rst
testing_latency.rst
.. project/extras/testing_latency.rst:
Testing latency
===============
Many open-source DL frameworks provide a layer where experts in data science
can make use of optimizations contributed by machine learning engineers. Having
a common API benefits both: it simplifies deployment and makes it easier for ML
engineers working on advanced deep learning hardware to bring highly-optimized
performance to a wide range of models, especially in inference.
One DL framework with advancing efforts on graph optimizations is Apache
MXNet\*, where `Intel has contributed efforts showing`_ how to work with our
nGraph Compiler stack as an `experimental backend`_. Our approach provides
**more opportunities** to start working with different kinds of graph
optimizations **than would be available to the MXNet framework alone**, for
reasons outlined in our `introduction`_ documentation. Note that the
MXNet bridge requires trained models only; it does not support distributed
training.
.. figure:: ../../graphics/ngraph-mxnet-models.png
:width: 533px
:alt: Up to 45X faster
Up to 45X faster compilation with nGraph backend
Tutorial: Testing inference latency of ResNet-50-V2 with MXNet
--------------------------------------------------------------
This tutorial supports compiling MXNet with nGraph's CPU backend.
Begin by cloning MXNet from GitHub:
.. code-block:: console
git clone --recursive https://github.com/apache/incubator-mxnet
To compile run:
.. code-block:: console
cd incubator-mxnet
make -j USE_NGRAPH=1
MXNet's build system will automatically download, configure, and build the
nGraph library, then link it into ``libmxnet.so``. Once this is complete, we
recommend building a python3 virtual environment for testing, and then
install MXNet to the virtual environment:
.. code-block:: console
python3 -m venv .venv
. .venv/bin/activate
cd python
pip install -e .
cd ../
Now we're ready to use nGraph to run any model on a CPU backend. Building MXNet
with nGraph automatically enabled nGraph on your model scripts, and you
shouldn't need to do anything special. If you run into trouble, you can disable
nGraph by setting
.. code-block:: console
MXNET_SUBGRAPH_BACKEND=
If you do see trouble, please report it and we'll address it as soon as possible.
Running ResNet-50-V2 Inference
------------------------------
To show a working example, we'll demonstrate how MXNet may be used to run
ResNet-50 Inference. For ease, we'll consider the standard MXNet ResNet-50-V2
model from the `gluon model zoo`_, and we'll test with ``batch_size=1``.
Note that the nGraph-MXNet bridge supports static graphs only (dynamic graphs
are in the works); so for this example, we begin by converting the gluon model
into a static graph. Also note that any model with a saved checkpoint can be
considered a "static graph" in nGraph. For this example, we'll presume that the
model is pre-trained.
.. literalinclude:: ../../../../examples/subgraph_snippets/mxnet-gluon-example.py
:language: python
:lines: 17-32
To load the model into nGraph, we simply bind the symbol into an Executor.
.. literalinclude:: ../../../../examples/subgraph_snippets/mxnet-gluon-example.py
:language: python
:lines: 34-35
At binding, the MXNet Subgraph API finds nGraph, determines how to partition
the graph, and in the case of Resnet, sends the entire graph to nGraph for
compilation. This produces a single call to an `NNVM`_ ``NGraphSubgraphOp`` embedded
with the compiled model. At this point, we can test the model's performance.
.. literalinclude:: ../../../../examples/subgraph_snippets/mxnet-gluon-example.py
:language: python
:lines: 40-48
.. _experimental backend: https://github.com/apache/incubator-mxnet/pull/12502
.. _Intel has contributed efforts showing: https://cwiki.apache.org/confluence/display/MXNET/MXNet+nGraph+integration+using+subgraph+backend+interface
.. _introduction: http://ngraph.nervanasys.com/docs/latest/project/introduction.html
.. _gluon model zoo: https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/gluon/model_zoo/vision/resnet.py#L499
.. _subgraph acceleration API: https://cwiki.apache.org/confluence/display/MXNET/Unified+integration+with+external+backend+libraries
.. _NNVM: https://github.com/dmlc/nnvm
.. _nGraph-MXNet: https://github.com/NervanaSystems/ngraph-mxnet/blob/master/README.md
\ No newline at end of file
This diff is collapsed.
......@@ -16,25 +16,14 @@ We are pleased to announce the release of version |version|-doc.
Core updates for |version|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ PlaidML support
+ More ONNX ops
+ Elementwise divide defaults to Python semantics
+ GenerateMask seed optional
+ Graph visualization improvements
+ **Known Issues**
- When using TensorFlow\* v1.14.0 with ```ngraph-bridge`` v0.16.0rc0 and CPU
backend, we saw notable to severe decreases in throughput in many models.
+ Better PlaidML support
Latest doc updates
~~~~~~~~~~~~~~~~~~
+ Document new debug tool
+ Note deprecation of MXNet's ``ngraph-mxnet`` PyPI
+ Note default change to `svg` files for graphs and visualization
+ Add more prominent tips for contributors who find the doc-contributor-README
+ Add instructions how to build ``NGRAPH_PLAIDML`` backend.
.. important:: Pre-releases (``-rc-0.*``) have newer features, and are less stable.
......@@ -43,6 +32,27 @@ Latest doc updates
Changelog on Previous Releases
==============================
0.23
----
+ PlaidML support
+ More ONNX ops
+ Elementwise divide defaults to Python semantics
+ GenerateMask seed optional
+ Document new debug tool
+ Graph visualization improvements
+ Note deprecation of MXNet's ``ngraph-mxnet`` PyPI
+ Note default change to `svg` files for graphs and visualization
+ Add more prominent tips for contributors who find the doc-contributor-README
+ Better GSG / Install Guide structure.
+ Added group edits and new illustrations from PR 2994 to `introduction.rst`.
+ Ensure ngraph-bridge link in README goes to right place.
+ Make project `extras` their own subdirectory with index to help organize them.
+ **Known Issues**
- When using TensorFlow\* v1.14.0 with ```ngraph-bridge`` v0.16.0rc0 and CPU
backend, we saw notable to severe decreases in throughput in many models.
0.22
----
......
......@@ -67,7 +67,7 @@ namespace ngraph
/// \brief Broadcast shape of two nodes to make them compatible for a matrix multiplication.
///
/// \note This function is reflecting broadcasting behaviour of NumPy's `matmul` operation
/// \link https://docs.scipy.org/doc/numpy/reference/generated/numpy.matmul.html
/// (https://docs.scipy.org/doc/numpy/reference/generated/numpy.matmul.html)
/// This mean that only \"stack of matrices\" axes are bidirectionally broadcasted.
/// The last two dimension are left untouched.
///
......
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