nGraph - Intel's graph compiler and runtime for Neural Networks
Project description
nGraph Neural Network compiler
nGraph is Intel's open-source graph compiler and runtime for Neural Network models. Frameworks using nGraph to execute workloads have shown up to 45X performance boost compared to native implementations.
nGraph can be used directly thought it's Python API or C++ API. Alternatively it can be used through one of its frontends, e.g. TensorFlow, MXNet and ONNX.
Installation
nGraph is available as binary wheels you can install from PyPI. nGraph binary wheels are currently tested on Ubuntu 16.04 and require a CPU with AVX-512 instructions, if you're using a different system, you may want to build nGraph 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 simple (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
Hashes for ngraph_core-0.15.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd79122949e0e6ce86bcda0d9da82ce0c9e2087bbe26aac35662180e6d1b05b |
|
MD5 | 3627a5132036f1d9d86157326443f55c |
|
BLAKE2b-256 | 41fec9d6ab9106afcc8dfffd8406b0878341c02eb4683bc25f065d110cad354b |
Hashes for ngraph_core-0.15.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8670f13c5d5762decc21e751a6f8b9d72191ea7c194ca71499f19164367fa0d9 |
|
MD5 | aa36bd6d347d31325a97007b1c39cc75 |
|
BLAKE2b-256 | 83e9365d186f809312491e4ddb731fd920e99d5999690cdeef1a6d15a8423081 |
Hashes for ngraph_core-0.15.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2721b3801bdf7efa85f5b63bcb7ce72a3f7ba8c7311e26f5e69b9158877aaa9f |
|
MD5 | 4f71251217b56d3ddc0392797efb9044 |
|
BLAKE2b-256 | 35d6d5c935acd316376bfd4ab54acda3bfe2dcd1db17acd3917d9d3e93ca5586 |
Hashes for ngraph_core-0.15.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | deb4a50e08501ceb53c4c99edf04a79f0e740d3351c59de82e9026a77eded4f5 |
|
MD5 | 0bca27b7cdb2613aa62a30d3aa192744 |
|
BLAKE2b-256 | 9cf8e75782124dfcc5a7bb5c7c3dbc4e880886bef50360f3a73de75cf8cf31df |