Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Prepare release v0.14.0 (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
postrational committed Feb 27, 2019
1 parent 9984a0d commit 67bfc99
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
55 changes: 40 additions & 15 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ You can verify whether you have version `>=2.6.1` installed using the command:
$ protoc --version
libprotoc 3.4.0


#### nGraph

The other requirement is of course nGraph and nGraph's Python bindings.
Expand All @@ -33,25 +32,36 @@ You can follow these instructions to build an nGraph Python wheel containing bot
Prepare System:

# apt update
# apt install python3 python3-pip python3-dev
# apt install build-essential cmake curl clang-3.9 git zlib1g zlib1g-dev libtinfo-dev
# apt install python3 python3-pip python3-dev python-virtualenv
# apt install build-essential cmake curl clang-3.9 git zlib1g zlib1g-dev libtinfo-dev unzip autoconf automake libtool

Clone nGraph's `v0.10.0` tag, build and install it into `$HOME/ngraph_dist`:
Clone nGraph's `v0.14.0` tag, build and install it into `$HOME/ngraph_dist`:

$ git clone -b 'v0.10.0' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph.git
$ cd # Change directory to where you would like to clone nGraph sources
$ git clone -b 'v0.14.0' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph.git
$ mkdir ngraph/build
$ cd ngraph/build
$ cmake ../ -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DCMAKE_INSTALL_PREFIX=$HOME/ngraph_dist -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE
$ cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/ngraph_dist -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE -DNGRAPH_USE_PREBUILT_LLVM=TRUE
$ make
$ make install

Prepare a Python virtual environment for nGraph (recommended):

$ mkdir -p ~/.virtualenvs && cd ~/.virtualenvs
$ virtualenv -p $(which python3) nGraph
$ source nGraph/bin/activate
(nGraph) $

Build Python package (Binary wheel) for nGraph:

$ cd ngraph/python
$ git clone --recursive -b allow-nonconstructible-holders https://github.com/jagerman/pybind11.git
$ export PYBIND_HEADERS_PATH=$PWD/pybind11
$ export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist
$ python3 setup.py bdist_wheel
(nGraph) $ cd # Change directory to where you have cloned nGraph sources
(nGraph) $ cd ngraph/python
(nGraph) $ git clone --recursive https://github.com/jagerman/pybind11.git
(nGraph) $ export PYBIND_HEADERS_PATH=$PWD/pybind11
(nGraph) $ export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist
(nGraph) $ export NGRAPH_ONNX_IMPORT_ENABLE=TRUE
(nGraph) $ pip install numpy
(nGraph) $ python setup.py bdist_wheel

For additional information how to build nGraph Python bindings see:

Expand All @@ -61,7 +71,7 @@ Once the Python binary wheel file (`ngraph-*.whl`) is prepared you can install i

For example:

(your_venv) $ pip install -U dist/ngraph-0.10.0-cp35-cp35m-linux_x86_64.whl
(nGraph) $ pip install -U dist/ngraph_core-0.0.0.dev0-cp35-cp35m-linux_x86_64.whl

You can check that nGraph is properly installed in your Python shell:

Expand All @@ -71,12 +81,27 @@ You can check that nGraph is properly installed in your Python shell:
<Abs: 'Abs_1' ([2, 3])>
```

If you don't see any errors, nGraph should be installed correctly.
Additionally check that nGraph and nGraph's Python wheel were both build with the `NGRAPH_ONNX_IMPORT_ENABLE` option:

```python
from ngraph.impl import onnx_import
```

If you don't see any errors, nGraph should be installed correctly.

### Installing ngraph-onnx

You can install ngraph-onnx using pip:
You can install ngraph-onnx using the following commands. Clone `ngraph-onnx` sources to the same directory where you cloned `ngraph` sources.

(nGraph) $ cd # Change directory to where you have cloned nGraph sources
(nGraph) $ git clone -b 'v0.14.0' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph-onnx.git
(nGraph) $ cd ngraph-onnx
(nGraph) $ pip install -r requirements.txt
(nGraph) $ pip install -r requirements_test.txt
(nGraph) $ pip install -e .

(your_venv) $ pip install git+https://github.com/NervanaSystems/ngraph-onnx/@v0.10.0
#### Running tests

(nGraph) $ pytest tests/ --backend=CPU -v
(nGraph) $ pytest tests_core/ --backend=CPU -v
(nGraph) $ NGRAPH_BACKEND=CPU TOX_INSTALL_NGRAPH_FROM=../ngraph/python tox
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SOURCES_ROOT = path.abspath(path.dirname(__file__))

setup(name='ngraph-onnx',
version='0.10.0',
version='0.14.0',
description='nGraph Backend for ONNX',
long_description=open(path.join(SOURCES_ROOT, 'README.md')).read(),
long_description_content_type='text/markdown',
Expand Down
11 changes: 11 additions & 0 deletions tests_core/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
# import all test cases at global scope to make them visible to python.unittest
backend_test = onnx.backend.test.BackendTest(NgraphBackend, __name__)

# Fixed in nGraph after 0.14.0
backend_test.exclude('test_acosh')
backend_test.exclude('test_acosh_example')
backend_test.exclude('test_asinh')
backend_test.exclude('test_asinh_example')
backend_test.exclude('test_atanh')
backend_test.exclude('test_atanh_example')
backend_test.exclude('test_sign')
backend_test.exclude('test_where_example')
backend_test.exclude('test_sign_model')

# MaxPool Indices -> NGRAPH-3131
backend_test.exclude('test_maxpool_with_argmax')

Expand Down

0 comments on commit 67bfc99

Please sign in to comment.