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

Commit 5027294

Browse files
authored
Update installation documentation (#262)
1 parent 7182685 commit 5027294

File tree

2 files changed

+95
-70
lines changed

2 files changed

+95
-70
lines changed

BUILDING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Building nGraph and nGraph-ONNX
2+
3+
### Prerequisites
4+
5+
Python 3.4 or higher is required.
6+
7+
#### Protocol Buffers
8+
9+
You will need Protocol Buffers `v.2.6.1` or higher installed on your system to use ONNX.
10+
11+
On Ubuntu, for example you can install protobuf using:
12+
13+
# apt install protobuf-compiler libprotobuf-dev
14+
15+
And on Mac OS you can install protobuf using Homebrew:
16+
17+
$ brew install protobuf
18+
19+
20+
You can verify whether you have version `>=2.6.1` installed using the command:
21+
22+
$ protoc --version
23+
libprotoc 3.4.0
24+
25+
26+
#### nGraph
27+
28+
The other requirement is of course nGraph and nGraph's Python bindings.
29+
You can follow these instructions to build an nGraph Python wheel containing both.
30+
31+
##### nGraph build process on Ubuntu 16.04
32+
33+
Prepare System:
34+
35+
# 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
38+
39+
Clone nGraph's `v0.10.0-rc.5` tag, build and install it into `$HOME/ngraph_dist`:
40+
41+
$ git clone -b 'v0.10.0-rc.5' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph.git
42+
$ mkdir ngraph/build
43+
$ cd ngraph/build
44+
$ cmake ../ -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DCMAKE_INSTALL_PREFIX=$HOME/ngraph_dist
45+
$ make
46+
$ make install
47+
48+
Build Python package (Binary wheel) for nGraph:
49+
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
55+
56+
For additional information how to build nGraph Python bindings see:
57+
58+
https://github.com/NervanaSystems/ngraph/blob/master/python/README.md
59+
60+
Once the Python binary wheel file (`ngraph-*.whl`) is prepared you can install it using pip.
61+
62+
For example:
63+
64+
(your_venv) $ pip install -U dist/ngraph-0.10.0-cp35-cp35m-linux_x86_64.whl
65+
66+
You can check that nGraph is properly installed in your Python shell:
67+
68+
```python
69+
>>> import ngraph as ng
70+
>>> ng.abs([[1, 2, 3], [4, 5, 6]])
71+
<Abs: 'Abs_1' ([2, 3])>
72+
```
73+
74+
If you don't see any errors, nGraph should be installed correctly.
75+
76+
77+
### Installing ngraph-onnx
78+
79+
You can install ngraph-onnx using pip:
80+
81+
(your_venv) $ pip install git+https://github.com/NervanaSystems/ngraph-onnx/@v0.10.0-rc.5
82+

README.md

Lines changed: 13 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -6,86 +6,29 @@ This repository contains tools to run [ONNX](http://onnx.ai/) models using the [
66

77
## Installation
88

9-
### Prerequisites
10-
11-
Python 3.4 or higher is required.
12-
13-
#### Protocol Buffers
14-
15-
You will need Protocol Buffers `v.2.6.1` or higher installed on your system to use ONNX.
16-
17-
On Ubuntu, for example you can install protobuf using:
18-
19-
# apt install protobuf-compiler libprotobuf-dev
20-
21-
And on Mac OS you can install protobuf using Homebrew:
22-
23-
$ brew install protobuf
9+
nGraph and nGraph-ONNX are available as binary wheels you can install from PyPI.
2410

11+
nGraph binary wheels are currently tested on Ubuntu 16.04, if you're using a different system, you may want to [build](BUILDING.md) nGraph-ONNX from sources.
2512

26-
You can verify whether you have version `>=2.6.1` installed using the command:
27-
28-
$ protoc --version
29-
libprotoc 3.4.0
30-
31-
32-
#### nGraph
33-
34-
The other requirement is of course nGraph and nGraph's Python bindings.
35-
You can follow these instructions to build an nGraph Python wheel containing both.
36-
37-
##### nGraph build process on Ubuntu 16.04
13+
### Prerequisites
3814

39-
Prepare System:
15+
Python 3.4 or higher is required.
4016

4117
# apt update
42-
# apt install python3 python3-pip python3-dev
43-
# apt install build-essential cmake curl clang-3.9 git zlib1g zlib1g-dev libtinfo-dev
44-
45-
Clone nGraph's `v0.10.0-rc.5` tag, build and install it into `$HOME/ngraph_dist`:
46-
47-
$ git clone -b 'v0.10.0-rc.5' --single-branch --depth 1 https://github.com/NervanaSystems/ngraph.git
48-
$ mkdir ngraph/build
49-
$ cd ngraph/build
50-
$ cmake ../ -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DCMAKE_INSTALL_PREFIX=$HOME/ngraph_dist
51-
$ make
52-
$ make install
53-
54-
Build Python package (Binary wheel) for nGraph:
55-
56-
$ cd ngraph/python
57-
$ git clone --recursive -b allow-nonconstructible-holders https://github.com/jagerman/pybind11.git
58-
$ export PYBIND_HEADERS_PATH=$PWD/pybind11
59-
$ export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist
60-
$ python3 setup.py bdist_wheel
61-
62-
For additional information how to build nGraph Python bindings see:
63-
64-
https://github.com/NervanaSystems/ngraph/blob/master/python/README.md
65-
66-
Once the Python binary wheel file (`ngraph-*.whl`) is prepared you can install it using pip.
67-
68-
For example:
69-
70-
(your_venv) $ pip install -U dist/ngraph-0.10.0-cp35-cp35m-linux_x86_64.whl
71-
72-
You can check that nGraph is properly installed in your Python shell:
73-
74-
```python
75-
>>> import ngraph as ng
76-
>>> ng.abs([[1, 2, 3], [4, 5, 6]])
77-
<Abs: 'Abs_1' ([2, 3])>
78-
```
79-
80-
If you don't see any errors, nGraph should be installed correctly.
18+
# apt install python3 python-virtualenv
8119

20+
### Using a virtualenv (optional)
8221

83-
### Installing ngraph-onnx
22+
You may wish to use a virutualenv for your installation.
8423

85-
You can install ngraph-onnx using pip:
24+
$ virtualenv -p $(which python3) venv
25+
$ source venv/bin/activate
26+
(venv) $
8627

87-
(your_venv) $ pip install git+https://github.com/NervanaSystems/ngraph-onnx/@v0.10.0-rc.5
28+
### Installing
8829

30+
(venv) $ pip install ngraph-core
31+
(venv) $ pip install ngraph-onnx
8932

9033
## Usage example
9134

0 commit comments

Comments
 (0)