nGraph - Intel's graph compiler and runtime for Neural Networks
Project description
nGraph Compiler stack
nGraph is an open-source graph compiler for Artificial Neural Networks (ANNs). The nGraph Compiler stack provides an inherently efficient graph-based compilation infrastructure designed to be compatible with the many upcoming processors, like the Intel Nervana™ Neural Network Processor (Intel® Nervana™ NNP), while also unlocking a massive performance boost on any existing hardware targets in your neural network: both GPUs and CPUs. Using its flexible infrastructure, you will find it becomes much easier to create Deep Learning (DL) models that can adhere to the "write once, run anywhere" mantra that enables your AI solutions to easily go from concept to production to scale.
Frameworks using nGraph to execute workloads have shown up to 45X performance boost compared to native implementations.
Using the Python API
nGraph can be used directly with the Python API described here, or with the C++ API described in the core documentation. Alternatively, its performance benefits can be realized through frontends such as TensorFlow, PaddlePaddle and ONNX. You can also create your own custom framework to integrate directly with the nGraph Ops for highly-targeted graph execution.
Installation
nGraph is available as binary wheels you can install from PyPI. nGraph binary wheels are currently tested on Ubuntu 16.04. To build and test on other systems, you may want to try building from sources.
Installing nGraph Python API from PyPI is easy:
pip install ngraph-core
Usage example
Using nGraph's Python API to construct a computation graph and execute a
computation is simple. The following example shows how to create a minimal
(A + B) * C
computation graph and calculate a result using 3 numpy arrays
as input.
import numpy as np
import ngraph as ng
A = ng.parameter(shape=[2, 2], name='A', dtype=np.float32)
B = ng.parameter(shape=[2, 2], name='B', dtype=np.float32)
C = ng.parameter(shape=[2, 2], name='C', dtype=np.float32)
# >>> print(A)
# <Parameter: 'A' ([2, 2], float)>
model = (A + B) * C
# >>> print(model)
# <Multiply: 'Multiply_14' ([2, 2])>
runtime = ng.runtime(backend_name='CPU')
# >>> print(runtime)
# <Runtime: Backend='CPU'>
computation = runtime.computation(model, A, B, C)
# >>> print(computation)
# <Computation: Multiply_14(A, B, C)>
value_a = np.array([[1, 2], [3, 4]], dtype=np.float32)
value_b = np.array([[5, 6], [7, 8]], dtype=np.float32)
value_c = np.array([[9, 10], [11, 12]], dtype=np.float32)
result = computation(value_a, value_b, value_c)
# >>> print(result)
# [[ 54. 80.]
# [110. 144.]]
print('Result = ', result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file ngraph_core-0.26.0-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 93.2 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94cbeed3b25f9eb3838d6981cfda322e70417eb7bfe748ac848b72af02a48e5e |
|
MD5 | face257c90078779562398f18a6ee4e4 |
|
BLAKE2b-256 | dee696756d4a41b5ce578488fd37d1715546eb526a8701a6e5e99b3e3ab1a235 |
File details
Details for the file ngraph_core-0.26.0-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 47.0 MB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49593b351b1a783c18121073abf351e4d0f1a937ec6a52f6aceb552af3681b81 |
|
MD5 | 7567e5dc32738067d780101b0952fa97 |
|
BLAKE2b-256 | 6b5fe8ed10b1ea66384a8ca9df4c5e3b1c50379a622919d8faa037c9ac9d4931 |
File details
Details for the file ngraph_core-0.26.0-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 93.0 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bcc3de3e60b9f20d9652a3b0e99a6d6c180337dbc65d8863bb2bb26c2e22029 |
|
MD5 | 803681af0fd616fd50f0e82b9fb4beae |
|
BLAKE2b-256 | 03f92d61e69e0a7e26fb136eee52806c1d8b753d0900193cda1d6bc86b38267f |
File details
Details for the file ngraph_core-0.26.0-cp36-cp36m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp36-cp36m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 47.0 MB
- Tags: CPython 3.6m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ce6685da03272c4c704659949d6be634a59e92c693ee6b4ff110f2dd0d28d0 |
|
MD5 | 2091a2a9be0f0a0a495d2ae54815edc9 |
|
BLAKE2b-256 | 99a55720b07a4496e67c2168ee4b87eb1ca16817545dd03304644f3bc2e539f9 |
File details
Details for the file ngraph_core-0.26.0-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 93.0 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12c75ec8e66c27d1e86f97930f8dc42a1cfc467dc0dda9b305673086d8383f51 |
|
MD5 | 0aa4b9e0b42651252ffadc9c7e451212 |
|
BLAKE2b-256 | f43418c772339995e751b24e2165e0d4c47563c41cd26d097be6919297ef6f23 |
File details
Details for the file ngraph_core-0.26.0-cp35-cp35m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp35-cp35m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 47.0 MB
- Tags: CPython 3.5m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787294afb512b1019009d17c0acf560e29cfddcacd73a551106cf2cf476769f0 |
|
MD5 | 71420a10676defa801c30d1037a5d5d1 |
|
BLAKE2b-256 | 39d832892992d745949b17fb66ac96e9c63985207584a967c7ddfe0b1ee0eeb0 |
File details
Details for the file ngraph_core-0.26.0-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 92.8 MB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84c3bc78e6ac710206662855b282e73f23d2feec1af672308752f6bacbf7446 |
|
MD5 | a87ed4a56f28692a3c10a93fa91c2cbb |
|
BLAKE2b-256 | f77e357f8166fa8ea5d3fbce6f77493bc66dcf0f4436a8b2dc0708b6a464bd4b |
File details
Details for the file ngraph_core-0.26.0-cp27-cp27m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ngraph_core-0.26.0-cp27-cp27m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 47.0 MB
- Tags: CPython 2.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e5dd8eb4bc62c8aab3ff45619afb044c6f13ef6b698348cd80dcaf2bbe1316e |
|
MD5 | 54f0196df7e907d3d1d081c9fedc4a95 |
|
BLAKE2b-256 | 012a80f7b6a8669fa94ef81e4d2cb1c9d92638c35030d2eaf2193e2a385a1b63 |