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

Commit e696e3d

Browse files
Merge branch 'master' into sarkars/unify_pooling_translate_functions
2 parents 34e5f77 + aefc2c7 commit e696e3d

20 files changed

+576
-107
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ if (NOT USE_PRE_BUILT_NGRAPH)
239239
ExternalProject_Add(
240240
ext_ngraph
241241
GIT_REPOSITORY https://github.com/NervanaSystems/ngraph
242-
GIT_TAG v0.15.1-rc.2
242+
GIT_TAG v0.16.0-rc.0
243243
CMAKE_ARGS
244244
-DNGRAPH_DISTRIBUTED_ENABLE=${NGRAPH_DISTRIBUTED_ENABLE}
245245
-DNGRAPH_INSTALL_PREFIX=${NGRAPH_ARTIFACTS_DIR}

Diff for: README.md

+12-76
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ a variety of nGraph-enabled backends: CPU, GPU, and custom silicon like the
2727
virtualenv --system-site-packages -p /usr/bin/python2 your_virtualenv
2828
source your_virtualenv/bin/activate # bash, sh, ksh, or zsh
2929

30-
2. Install TensorFlow v1.12.0:
30+
2. Install TensorFlow v1.13.1:
3131

3232
pip install -U tensorflow
3333

@@ -41,10 +41,10 @@ a variety of nGraph-enabled backends: CPU, GPU, and custom silicon like the
4141

4242
This will produce something like this:
4343

44-
TensorFlow version: 1.12.0
45-
nGraph bridge version: b'0.11.0'
46-
nGraph version used for this build: b'0.14.0+56a54ca'
47-
TensorFlow version used for this build: v1.12.0-0-ga6d8ffae09
44+
TensorFlow version: 1.13.1
45+
nGraph bridge version: b'0.12.0-rc1'
46+
nGraph version used for this build: b'0.21.0-rc.0+b638705'
47+
TensorFlow version used for this build: v1.13.1-0-g6612da8951
4848

4949
Next you can try out the TensorFlow models by adding one line to your existing
5050
TensorFlow model scripts and running them the usual way:
@@ -63,11 +63,11 @@ bridge using the TensorFlow source tree as follows:
6363
The installation prerequisites are the same as described in the TensorFlow
6464
[prepare environment] for linux.
6565

66-
1. TensorFlow uses a build system called "bazel". These instructions were tested with [bazel version 0.16.0].
66+
1. TensorFlow uses a build system called "bazel". These instructions were tested with [bazel version 0.21.0].
6767

68-
wget https://github.com/bazelbuild/bazel/releases/download/0.16.0/bazel-0.16.0-installer-linux-x86_64.sh
69-
chmod +x bazel-0.16.0-installer-linux-x86_64.sh
70-
./bazel-0.16.0-installer-linux-x86_64.sh --user
68+
wget https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel-0.21.0-installer-linux-x86_64.sh
69+
chmod +x bazel-0.21.0-installer-linux-x86_64.sh
70+
./bazel-0.21.0-installer-linux-x86_64.sh --user
7171

7272
2. Add and source the ``bin`` path to your ``~/.bashrc`` file in order to be
7373
able to call bazel from the user's installation we set up:
@@ -84,7 +84,7 @@ The installation prerequisites are the same as described in the TensorFlow
8484

8585
git clone https://github.com/NervanaSystems/ngraph-tf.git
8686
cd ngraph-tf
87-
git checkout v0.11.0
87+
git checkout v0.12.0-rc1
8888

8989

9090
2. Next run the following Python script to build TensorFlow, nGraph and the bridge. Please use Python 3.5:
@@ -115,73 +115,9 @@ with nGraph backends.
115115

116116
Please add the following line to enable nGraph: `import ngraph_bridge`
117117

118-
## Option 3: Using the upstreamed version
119-
120-
nGraph is updated in the TensorFlow source tree using pull requests periodically.
121-
122-
In order to build that version of nGraph, follow the steps below, which involves building TensorFlow from source with certain settings.
123-
124-
1. Install bazel using the same instructions outlined in option 2, step 1 above.
125-
126-
2. Create a virtual environment using the instructions outlined in option 1, step 1 above.
127-
128-
3. Get tensorflow v1.12.0
129-
130-
git clone https://github.com/tensorflow/tensorflow.git
131-
cd tensorflow
132-
git checkout v1.12.0
133-
134-
Note: To get the latest version of nGraph, use the tip of `master` branch of TensorFlow. The exact version of `bazel` changes for a specific version of TensorFlow. Please consult the build instructions from TensorFlow web site for specific bazel requirements.
135-
136-
4. Now run `./configure` and choose `no` for the following when prompted to build TensorFlow.
137-
138-
XLA support:
139-
140-
Do you wish to build TensorFlow with XLA JIT support? [Y/n]: n
141-
No XLA JIT support will be enabled for TensorFlow.
142-
143-
CUDA support:
144-
145-
Do you wish to build TensorFlow with CUDA support? [y/N]: N
146-
No CUDA support will be enabled for TensorFlow.
147-
148-
:warning: Note that if you are running TensorFlow on a Skylake family processor then select
149-
`-march=broadwell` when prompted to specify the optimization flags:
150-
151-
Please specify optimization flags to use during compilation
152-
when bazel option "--config=opt" is specified
153-
[Default is -march=native]: -march=broadwell
154-
155-
This is due to an issue in TensorFlow tracked here:
156-
https://github.com/tensorflow/tensorflow/issues/17273
157-
158-
5. Prepare the pip package
159-
160-
bazel build --config=opt --config=ngraph //tensorflow/tools/pip_package:build_pip_package
161-
bazel-bin/tensorflow/tools/pip_package/build_pip_package ./
162-
163-
Note: The specific questions for the `configure` step and the build command mentioned above changes for different versions of TensorFlow.
164-
165-
6. Once the pip package is built, install using
166-
167-
pip install -U ./tensorflow-1.*whl
168-
169-
For this final option, there is **no need to separately build `ngraph-tf` or to
170-
use `pip` to install the nGraph module**. With this configuration, your TensorFlow model scripts will work without any changes, ie, you do not need to add `import ngraph_bridge`, like option 1 and 2.
171-
172-
Note: The version that is available in the upstreamed version of TensorFlow usually
173-
lags the features and bug fixes available in the `master` branch of this repository.
174-
175-
You can run a few of your own DL models to validate the end-to-end
176-
functionality. Also, you can use the `ngraph-tf/examples` directory and try to
177-
run the following model:
178-
179-
cd examples
180-
python3 keras_sample.py
181-
182118
## Using OS X
183119

184-
The build and installation instructions are idential for Ubuntu 16.04 and OS X. However, please
120+
The build and installation instructions are identical for Ubuntu 16.04 and OS X. However, please
185121
note that the Python setup is not always the same across various Mac OS versions. TensorFlow build
186122
instructions recommend using Homebrew and often people use Pyenv. There is also Anaconda/Miniconda
187123
which some users prefer. Ensure that you can build TenorFlow successfully on OS X with a suitable
@@ -223,7 +159,7 @@ See the full documentation here: <http://ngraph.nervanasys.com/docs/latest>
223159
[DSO]:http://csweb.cs.wfu.edu/~torgerse/Kokua/More_SGI/007-2360-010/sgi_html/ch03.html
224160
[Github issues]: https://github.com/NervanaSystems/ngraph-tf/issues
225161
[pull request]: https://github.com/NervanaSystems/ngraph-tf/pulls
226-
[bazel version 0.16.0]: https://github.com/bazelbuild/bazel/releases/tag/0.16.0
162+
[bazel version 0.21.0]: https://github.com/bazelbuild/bazel/releases/tag/0.21.0
227163
[prepare environment]: https://www.tensorflow.org/install/install_sources#prepare_environment_for_linux
228164
[diagnostics]:diagnostics/README.md
229165
[ops]:http://ngraph.nervanasys.com/docs/latest/ops/index.html

Diff for: build_ngtf.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def command_executor(cmd, verbose=False, msg=None, stdout=None):
4444
raise Exception("Error running command: " + cmd)
4545

4646

47-
def build_ngraph(src_location, cmake_flags, verbose):
47+
def build_ngraph(build_dir, src_location, cmake_flags, verbose):
4848
pwd = os.getcwd()
4949

5050
src_location = os.path.abspath(src_location)
@@ -53,15 +53,15 @@ def build_ngraph(src_location, cmake_flags, verbose):
5353
os.chdir(src_location)
5454

5555
# mkdir build directory
56-
path = 'build'
56+
path = build_dir
5757
try:
5858
os.makedirs(path)
5959
except OSError as exc: # Python >2.5
6060
if exc.errno == errno.EEXIST and os.path.isdir(path):
6161
pass
6262

6363
# Run cmake
64-
os.chdir('build')
64+
os.chdir(build_dir)
6565

6666
cmake_cmd = ["cmake"]
6767
cmake_cmd.extend(cmake_flags)
@@ -278,7 +278,7 @@ def install_tensorflow(venv_dir, artifacts_dir):
278278
return str(cxx_abi)
279279

280280

281-
def build_ngraph_tf(artifacts_location, ngtf_src_loc, venv_dir, cmake_flags,
281+
def build_ngraph_tf(build_dir, artifacts_location, ngtf_src_loc, venv_dir, cmake_flags,
282282
verbose):
283283
pwd = os.getcwd()
284284

@@ -296,15 +296,15 @@ def build_ngraph_tf(artifacts_location, ngtf_src_loc, venv_dir, cmake_flags,
296296
os.chdir(ngtf_src_loc)
297297

298298
# mkdir build directory
299-
path = 'build'
299+
path = build_dir
300300
try:
301301
os.makedirs(path)
302302
except OSError as exc: # Python >2.5
303303
if exc.errno == errno.EEXIST and os.path.isdir(path):
304304
pass
305305

306306
# Run cmake
307-
os.chdir('build')
307+
os.chdir(path)
308308
cmake_cmd = ["cmake"]
309309
cmake_cmd.extend(cmake_flags)
310310
cmake_cmd.extend([ngtf_src_loc])
@@ -408,8 +408,8 @@ def main():
408408
parser.add_argument(
409409
'--use_prebuilt_binaries',
410410
help=
411-
"Skip building nGraph and TensorFlow. Rather use \"build\" directory.\n"
412-
+ "The following directory structure is assumed:\n" + "build\n" +
411+
"Skip building nGraph and TensorFlow. Rather use \"build_cmake\" directory.\n"
412+
+ "The following directory structure is assumed:\n" + "build_cmake\n" +
413413
" |\n" + " -- artifacts\n" + " | |\n" +
414414
" | |-- bin (contains binaries from nGraph build)\n" +
415415
" | |-- include (contains include files from nGraph build)\n" +
@@ -440,11 +440,11 @@ def main():
440440
#-------------------------------
441441

442442
# Component versions
443-
ngraph_version = "v0.15.1-rc.2"
444-
tf_version = "v1.12.0"
443+
ngraph_version = "v0.16.0-rc.0"
444+
tf_version = "v1.13.1"
445445

446446
# Default directories
447-
build_dir = 'build'
447+
build_dir = 'build_cmake'
448448

449449
# Override the pre-built location is specified
450450
use_prebuilt_binaries = False
@@ -536,7 +536,7 @@ def main():
536536
else:
537537
ngraph_cmake_flags.extend(["-DNGRAPH_GPU_ENABLE=NO"])
538538

539-
build_ngraph("./ngraph", ngraph_cmake_flags, verbosity)
539+
build_ngraph(build_dir, "./ngraph", ngraph_cmake_flags, verbosity)
540540

541541
# Next build CMAKE options for the bridge
542542
tf_src_dir = os.path.abspath("tensorflow")
@@ -559,7 +559,7 @@ def main():
559559
ngraph_tf_cmake_flags.extend(["-DNGRAPH_DISTRIBUTED_ENABLE=FALSE"])
560560

561561
# Now build the bridge
562-
ng_tf_whl = build_ngraph_tf(artifacts_location, "../", venv_dir,
562+
ng_tf_whl = build_ngraph_tf(build_dir, artifacts_location, "../", venv_dir,
563563
ngraph_tf_cmake_flags, verbosity)
564564

565565
print("SUCCESSFULLY generated wheel: %s" % ng_tf_whl)

Diff for: python/setup.in.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_tag(self):
3939

4040
setup(
4141
name='ngraph_tensorflow_bridge',
42-
version='0.12.0-rc0',
42+
version='0.12.0rc1',
4343
description='Intel nGraph compiler and runtime for TensorFlow',
4444
long_description=long_description,
4545
long_description_content_type="text/markdown",

Diff for: src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ set(SRC
4646
ngraph_rewrite_pass.cc
4747
ngraph_tracked_variable.cc
4848
ngraph_utils.cc
49+
ngraph_timer.cc
4950
tf_graphcycles.cc
5051
tf_deadness_analysis.cc
5152
version.cc

0 commit comments

Comments
 (0)