This repository was archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Home
fboemer edited this page Oct 26, 2018
·
24 revisions
TLDR, if the setup has already been done, here's the command to run
# Without TF
$ cd ~/repos/he-transformer/build
$ ./test/unit-test --gtest_filter="HE_HEAAN.ab"
# With TF
# activate python env with tf and ngraph installed
$ source ~/repos/venvs/he3/bin/activate
$ cd ~/repos/ngraph-tf/examples/
$ NGRAPH_TF_BACKEND=HE_SEAL python axpy.py
$ deactivate
- Create build directory
cd ~/repos/he-transformer/
mkdir build
cd build
- To build without
ngraph-tf
, we can build nGraph automatically
cmake ..
make -j
- Run C++ Native example: in
build
./test/unit-test --gtest_filter="HE_SEAL.ab"
./test/unit-test --gtest_filter="HE_HEAAN.ab"
mkdir -p ~/venvs
virtualenv ~/venvs/he3 -p python3
source ~/venvs/he3/bin/activate
pip install tensorflow
Note: must be done inside the virtual env
- Create build directory
cd ~/repos
git clone https://github.com/NervanaSystems/ngraph-tf.git
cd ~/repos/ngraph-tf/
git checkout v0.7.0-rc0
mkdir build
cd build
cmake ..
- Build and install
make -j
make install
pip install python/dist/ngraph-0.7.0-py2.py3-none-linux_x86_64.whl
# Try importing -- this shouldn't crash
python -c "import ngraph"
Note: must be done inside the virtualenv
cd ~/repos/he-transformer
# Clean up
rm -rf build
mkdir build
cd build
# Config, change the corresponding folder location below
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DPREBUILD_NGRAPH_INCLUDE_DIR=$HOME/repos/ngraph-tf/build/ngraph/ngraph_dist/include \
-DPREBUILD_NGRAPH_LIB_DIR=$HOME/venvs/he3/lib/python3.5/site-packages/ngraph
# Or let python tell us the site-package
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DPREBUILD_NGRAPH_INCLUDE_DIR=~/repos/ngraph-tf/build/ngraph/ngraph_dist/include \
-DPREBUILD_NGRAPH_LIB_DIR=`python -c "import sys; print(sys.path[-1])"`/ngraph
# Installs libhe_backend.so into the python site-packages
make -j
make install
# If you run into errors relating to `abi:cxx11`, try adding `-D_GLIBCXX_USE_CXX11_ABI=0` or `-D_GLIBCXX_USE_CXX11_ABI=1` to the cmake command
Note: must be done inside the virtualenv
# source activate virtualenv first
source ~/repos/venvs/he3/bin/activate
cd ~/repos/ngraph-tf/examples
# run on ngraph-CPU
python axpy.py
# run on SEAL:BFV
NGRAPH_TF_BACKEND=HE:SEAL:BFV NGRAPH_ENABLE_SERIALIZE=1 python axpy.py
# run on SEAL:CKKS
NGRAPH_TF_BACKEND=HE:SEAL:CKKS NGRAPH_ENABLE_SERIALIZE=1 python axpy.py