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 15, 2018
·
24 revisions
TLDR, if the setup has already been done, here's the command to run
# Without TF
$ cd ~/repo/he-transformer/build
$ ./test/unit-test --gtest_filter="HE_HEAAN.ab"
# With TF
# activate python env with tf and ngraph installed
$ source ~/repo/venvs/he3/bin/activate
$ cd ~/repo/ngraph-tf/examples/
$ NGRAPH_TF_BACKEND=HE_SEAL python axpy.py
$ deactivate
- Create build directory
cd ~/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 ~/repo/venvs/he3 -p python3
source ~/repo/venvs/he3/bin/activate
pip install tensorflow
- Create build directory
cd ~/repo/he-transformer/
mkdir build
cd build
- Build
he-transformer
withngraph-tf
Note: must be done inside the virtualenv
cmake .. -DHE_TF=ON (-DPREBUILD_NGRAPH_LIB_DIR=~/repo/venvs/he3/lib/python3.5/site-packages/ngraph)
- Installs libhe_backend.so into the python site-packages make -j make install
### 2.4 Run TF python model
Note: must be done inside the virtualenv
```bash
# 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
NGRAPH_TF_BACKEND=HE_SEAL NGRAPH_ENABLE_SERIALIZE=1 python axpy.py
# run on HEAAN
NGRAPH_TF_BACKEND=HE_HEAAN NGRAPH_ENABLE_SERIALIZE=1 python axpy.py