Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ if (NOT USE_PRE_BUILT_NGRAPH)
ExternalProject_Add(
ext_ngraph
GIT_REPOSITORY https://github.com/NervanaSystems/ngraph
GIT_TAG v0.25.1-rc.3
GIT_TAG v0.25.1-rc.7
CMAKE_ARGS
-DNGRAPH_DISTRIBUTED_ENABLE=${NGRAPH_DISTRIBUTED_ENABLE}
-DNGRAPH_INSTALL_PREFIX=${NGRAPH_ARTIFACTS_DIR}
Expand Down
19 changes: 4 additions & 15 deletions bazel/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ tf_workspace(path_prefix = "", tf_repo_name = "org_tensorflow")
http_archive(
name = "ngraph",
build_file = "//:bazel/ngraph.BUILD",
sha256 = "b33f0be032ff59044987ff796b636c1b222579705ac29632bba59b6031b0d58c",
strip_prefix = "ngraph-0.25.1-rc.3",
sha256 = "345f0566c3ae4a968daea116c26ce9a90a94305148d6b8b56b6309448432492e",
strip_prefix = "ngraph-0.25.1-rc.7",
urls = [
"https://mirror.bazel.build/github.com/NervanaSystems/ngraph/archive/v0.25.1-rc.3.tar.gz",
"https://github.com/NervanaSystems/ngraph/archive/v0.25.1-rc.3.tar.gz"
"https://mirror.bazel.build/github.com/NervanaSystems/ngraph/archive/v0.25.1-rc.7.tar.gz",
"https://github.com/NervanaSystems/ngraph/archive/v0.25.1-rc.7.tar.gz"
],
)

Expand All @@ -74,17 +74,6 @@ http_archive(
],
)

http_archive(
name = "tbb",
build_file = "//:bazel/tbb.BUILD",
sha256 = "c3245012296f09f1418b78a8c2f17df5188b3bd0db620f7fd5fabe363320805a",
strip_prefix = "tbb-2019_U1",
urls = [
"http://mirror.tensorflow.org/github.com/01org/tbb/archive/2019_U1.zip",
"https://github.com/01org/tbb/archive/2019_U1.zip",
],
)

http_archive(
name = "eigen",
build_file = "//:bazel/eigen.BUILD",
Expand Down
56 changes: 56 additions & 0 deletions bazel/docker/Dockerfile.clang-8.ubuntu18.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

# ==============================================================================
# Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Docker file to setup build envrionment for nGraph-TensorFlow

FROM ubuntu:18.04
RUN apt-get update && apt-get install -y \
vim \
python \
python-pip \
python3-pip \
git \
unzip zip wget \
sudo \
zlib1g zlib1g-dev bash-completion \
build-essential cmake \
clang-format-3.9

RUN pip install -U virtualenv==16.0.0

#install latest cmake
ADD https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.sh /cmake-3.7.2-Linux-x86_64.sh
RUN mkdir /opt/cmake
RUN sh /cmake-3.7.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
RUN ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
RUN cmake --version

#Install Bazel
ADD https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh ./bazel-0.24.1-installer-linux-x86_64.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update this wiki: https://github.com/tensorflow/ngraph-bridge/wiki/Update-TF-version-in-ngraph-bridge

when TF version is upgraded, bazel version will upgrade, and we need to upgrade this (and maybe other) docker file from 0.24.1 to next bazel version

RUN bash bazel-0.24.1-installer-linux-x86_64.sh
RUN bazel

#install gcc-4.8 and register both 7 and 4.8 with alternatives
#RUN apt-get update && apt-get install -y gcc-4.8 g++-4.8
#RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 && \
#update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7

# Install Clang
RUN apt-get install -y clang-8 libc++-dev libc++abi-dev

# Set the environment variables CC and CXX to point to clang-8
ENV CC clang-8
ENV CXX clang++-8
22 changes: 22 additions & 0 deletions bazel/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# How to use this Dockerfile (Dockerfile.clang-8.ubuntu18.04)
1. Create a dir where you want to build eg: docker_demo/build
2. Download ngraph-bridge repo : git clone https://github.com/tensorflow/ngraph-bridge.git
3. Build docker
docker build -t <ngtf_build> -f Dockerfile.clang-8.ubuntu18.04 .
or
If users want to build behind corporate proxy, they can always build it this way:
docker build \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
--build-arg NO_PROXY=${NO_PROXY} \
--build-arg http_proxy=${http_proxy} \
--build-arg https_proxy=${https_proxy} \
--build-arg no_proxy=${no_proxy} \
-f Dockerfile.clang-8.ubuntu18.04 .
4. docker run -it -v ${PWD}:/<workspace> -w /<workspace> <ngtf_build>
5. Create a virtual env : virtualenv -p python3 <venv3>
6. Activate the virtual env : source venv3/bin/activate
7. pip install future
8. cd ngraph-bridge
9. ./configure_bazel.sh
10. BAZEL_LINKOPTS=-lc++ BAZEL_CXXOPTS=-stdlib=libc++ bazel build :hello_tf
8 changes: 3 additions & 5 deletions bazel/ngraph.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ cc_library(
"-fstack-protector-all",
'-D SHARED_LIB_PREFIX=\\"lib\\"',
'-D SHARED_LIB_SUFFIX=\\".so\\"',
'-D NGRAPH_VERSION=\\"v0.25.1-rc.3\\"',
'-D NGRAPH_VERSION=\\"v0.25.1-rc.7\\"',
"-D NGRAPH_DEX_ONLY",
'-D PROJECT_ROOT_DIR=\\"\\"',
'-D NGRAPH_STATIC_LIB_ENABLE'
Expand Down Expand Up @@ -117,7 +117,7 @@ cc_library(
"-fstack-protector-all",
'-D SHARED_LIB_PREFIX=\\"lib\\"',
'-D SHARED_LIB_SUFFIX=\\".so\\"',
'-D NGRAPH_VERSION=\\"v0.25.1-rc.3\\"',
'-D NGRAPH_VERSION=\\"v0.25.1-rc.7\\"',
"-D NGRAPH_DEX_ONLY",
'-D PROJECT_ROOT_DIR=\\"\\"',
] + CXX_ABI,
Expand Down Expand Up @@ -255,7 +255,6 @@ cc_library(
deps = [
":ngraph_headers",
":ngraph_core",
"@tbb",
"@eigen",
"@mkl_dnn",
],
Expand All @@ -269,9 +268,8 @@ cc_library(
"-fstack-protector-all",
'-D SHARED_LIB_PREFIX=\\"lib\\"',
'-D SHARED_LIB_SUFFIX=\\".so\\"',
'-D NGRAPH_VERSION=\\"0.25.1-rc.2\\"',
'-D NGRAPH_VERSION=\\"0.25.1-rc.7\\"',
"-D NGRAPH_DEX_ONLY",
"-D NGRAPH_TBB_ENABLE",
'-D PROJECT_ROOT_DIR=\\"\\"',
'-D NGRAPH_CPU_STATIC_LIB_ENABLE'
] + CXX_ABI,
Expand Down
75 changes: 0 additions & 75 deletions bazel/tbb.BUILD

This file was deleted.

4 changes: 2 additions & 2 deletions build_ngtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def main():
'''

# Component versions
ngraph_version = "v0.25.1-rc.3"
ngraph_version = "v0.25.1-rc.7"
tf_version = "v1.14.0"

# Command line parser options
Expand Down Expand Up @@ -361,7 +361,7 @@ def main():
"-DNGRAPH_USE_CXX_ABI=" + cxx_abi, "-DNGRAPH_DEX_ONLY=TRUE",
"-DNGRAPH_DEBUG_ENABLE=NO", "-DNGRAPH_UNIT_TEST_ENABLE=NO",
"-DNGRAPH_TARGET_ARCH=" + target_arch,
"-DNGRAPH_TUNE_ARCH=" + target_arch
"-DNGRAPH_TUNE_ARCH=" + target_arch, "-DNGRAPH_TBB_ENABLE=FALSE"
]

if arguments.use_ngraph_staticlibs:
Expand Down