@@ -22,7 +22,6 @@ You can verify whether you have version `>=2.6.1` installed using the command:
22
22
$ protoc --version
23
23
libprotoc 3.4.0
24
24
25
-
26
25
#### nGraph
27
26
28
27
The other requirement is of course nGraph and nGraph's Python bindings.
@@ -33,25 +32,36 @@ You can follow these instructions to build an nGraph Python wheel containing bot
33
32
Prepare System:
34
33
35
34
# apt update
36
- # apt install python3 python3-pip python3-dev
37
- # apt install build-essential cmake curl clang-3.9 git zlib1g zlib1g-dev libtinfo-dev
35
+ # apt install python3 python3-pip python3-dev python-virtualenv
36
+ # apt install build-essential cmake curl clang-3.9 git zlib1g zlib1g-dev libtinfo-dev unzip autoconf automake libtool
38
37
39
- Clone nGraph's ` v0.10 .0 ` tag, build and install it into ` $HOME/ngraph_dist ` :
38
+ Clone nGraph's ` v0.14 .0 ` tag, build and install it into ` $HOME/ngraph_dist ` :
40
39
41
- $ git clone -b 'v0.10.0' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph.git
40
+ $ cd # Change directory to where you would like to clone nGraph sources
41
+ $ git clone -b 'v0.14.0' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph.git
42
42
$ mkdir ngraph/build
43
43
$ cd ngraph/build
44
- $ cmake ../ -DNGRAPH_USE_PREBUILT_LLVM=TRUE - DCMAKE_INSTALL_PREFIX=$HOME/ngraph_dist -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE
44
+ $ cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/ngraph_dist -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE -DNGRAPH_USE_PREBUILT_LLVM=TRUE
45
45
$ make
46
46
$ make install
47
47
48
+ Prepare a Python virtual environment for nGraph (recommended):
49
+
50
+ $ mkdir -p ~/.virtualenvs && cd ~/.virtualenvs
51
+ $ virtualenv -p $(which python3) nGraph
52
+ $ source nGraph/bin/activate
53
+ (nGraph) $
54
+
48
55
Build Python package (Binary wheel) for nGraph:
49
56
50
- $ cd ngraph/python
51
- $ git clone --recursive -b allow-nonconstructible-holders https://github.com/jagerman/pybind11.git
52
- $ export PYBIND_HEADERS_PATH=$PWD/pybind11
53
- $ export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist
54
- $ python3 setup.py bdist_wheel
57
+ (nGraph) $ cd # Change directory to where you have cloned nGraph sources
58
+ (nGraph) $ cd ngraph/python
59
+ (nGraph) $ git clone --recursive https://github.com/jagerman/pybind11.git
60
+ (nGraph) $ export PYBIND_HEADERS_PATH=$PWD/pybind11
61
+ (nGraph) $ export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist
62
+ (nGraph) $ export NGRAPH_ONNX_IMPORT_ENABLE=TRUE
63
+ (nGraph) $ pip install numpy
64
+ (nGraph) $ python setup.py bdist_wheel
55
65
56
66
For additional information how to build nGraph Python bindings see:
57
67
@@ -61,7 +71,7 @@ Once the Python binary wheel file (`ngraph-*.whl`) is prepared you can install i
61
71
62
72
For example:
63
73
64
- (your_venv ) $ pip install -U dist/ngraph -0.10.0 -cp35-cp35m-linux_x86_64.whl
74
+ (nGraph ) $ pip install -U dist/ngraph_core -0.0.0.dev0 -cp35-cp35m-linux_x86_64.whl
65
75
66
76
You can check that nGraph is properly installed in your Python shell:
67
77
@@ -71,12 +81,27 @@ You can check that nGraph is properly installed in your Python shell:
71
81
< Abs: ' Abs_1' ([2 , 3 ])>
72
82
```
73
83
74
- If you don't see any errors, nGraph should be installed correctly.
84
+ Additionally check that nGraph and nGraph's Python wheel were both build with the ` NGRAPH_ONNX_IMPORT_ENABLE ` option:
75
85
86
+ ``` python
87
+ from ngraph.impl import onnx_import
88
+ ```
89
+
90
+ If you don't see any errors, nGraph should be installed correctly.
76
91
77
92
### Installing ngraph-onnx
78
93
79
- You can install ngraph-onnx using pip:
94
+ You can install ngraph-onnx using the following commands. Clone ` ngraph-onnx ` sources to the same directory where you cloned ` ngraph ` sources.
95
+
96
+ (nGraph) $ cd # Change directory to where you have cloned nGraph sources
97
+ (nGraph) $ git clone -b 'v0.14.0' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph-onnx.git
98
+ (nGraph) $ cd ngraph-onnx
99
+ (nGraph) $ pip install -r requirements.txt
100
+ (nGraph) $ pip install -r requirements_test.txt
101
+ (nGraph) $ pip install -e .
80
102
81
- (your_venv) $ pip install git+https://github.com/NervanaSystems/ngraph-onnx/@v0.10.0
103
+ #### Running tests
82
104
105
+ (nGraph) $ pytest tests/ --backend=CPU -v
106
+ (nGraph) $ pytest tests_core/ --backend=CPU -v
107
+ (nGraph) $ NGRAPH_BACKEND=CPU TOX_INSTALL_NGRAPH_FROM=../ngraph/python tox
0 commit comments