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
Yixing Lao edited this page Sep 14, 2018
·
24 revisions
TLDR, if the setup has already been done, here's the command to run
# Without TF
$ cd /home/yixing/repo/he-transformer/build
$ ./test/unit-test --gtest_filter="HE_HEAAN.ab"
# With TF
$ source ~/repo/venvs/he3/bin/activate # activate python env with tf and ngraph installed
$ cd ~/repo/ngraph-tf/examples/
$ LD_LIBRARY_PATH=$HOME/repo/venvs/he3/lib/python3.5/site-packages/ngraph \
NGRAPH_TF_BACKEND=HE_SEAL \
python axpy.py
$ deactivate
- Create build directory
cd /home/yixing/repo/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"
virtualenv /home/yixing/repo/venvs/he3 -p python3
source ~/repo/venvs/he3/bin/activate
pip install tensorflow
Note: must be done inside the virtualenv
cd ~/repo/ngraph-tf
mkdir build
cd build
cmake ..
make -j
make install
pip install python/dist/ngraph-0.5.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 /home/yixing/repo/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/yixing/repo/ngraph-tf/build/ngraph/ngraph_dist/include \
-DPREBUILD_NGRAPH_LIB_DIR=/home/yixing/repo/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=/home/yixing/repo/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
Note: must be done inside the virtualenv
# source activate virtualenv first
source ~/repo/venvs/he3/bin/activate
cd /home/yixing/repo/ngraph-tf/examples
# run on ngraph-CPU
python axpy.py
# run on SEAL
LD_LIBRARY_PATH=$HOME/repo/venvs/he3/lib/python3.5/site-packages/ngraph NGRAPH_TF_BACKEND=HE_SEAL NGRAPH_ENABLE_SERIALIZE=1 python axpy.py
# run on HEAAN
LD_LIBRARY_PATH=$HOME/repo/venvs/he3/lib/python3.5/site-packages/ngraph NGRAPH_TF_BACKEND=HE_HEAAN NGRAPH_ENABLE_SERIALIZE=1 python axpy.py