Skip to content

Commit

Permalink
Adding tests (#180)
Browse files Browse the repository at this point in the history
* Update main.yml

- adding emp tests

* merging mlinf branch for updated testing

* adding first test lenet_mnist llama & helper files modified

* added hinet test llama

* chexpert added

* lenet ct added to workflow

* lenet ct added to workflow

* onnxbridge workflow dependency added

* Update onnx_bridge.yml

* Update onnx_bridge.yml

* Update onnx_bridge.yml

* update in utils

* Update onnx_bridge.yml

* requirement version changed

* requirement version changed

* requirement version changed

* Update onnx_bridge.yml

* Update onnx_bridge.yml

* Update onnx_bridge.yml

* python ->python3

* sytorch dependency added to workflow

* updated workflow

* updated workflow

* updated workflow

* cmake install in workflow

* Update requirements.txt

* onnxbridge docker image in onnxbridge workflow

* added tests for hinet and lenet -> ct & secure

* updated names in workflow

* Update onnx_bridge.yml

* updated ezpc tests script

* updated ezpc tests script

* main workflow updated

* main workflow updated

* main workflow updated

* main workflow updated

* main workflow updated

* main workflow updated

* ci testing fixed for ABY

* sleep added in aby tests

* modifying aby tests

* added tests with batch sizes in lenet and hinet

* github actions updated for batch size onnxbridge & tf tests discontinued & main->athos

* unet2d bug fix

* Onnxbridge wrapper- onnxbridge-secfloat issues fixed (#183)

* Work in progress. Fixing ONNXBridge files

* Added wrapper functions and removed autos

* Added edits to Secflot source

* Added BatchNorm and AvgPool implementation. Fixed func_calls.py

* Checked cleartext library is working

* Added missing link_secfloat_cleartext.cpp

* Added concat metaprogramming

* corrected compile_secfloat script

* Fixed error in filter shape

* cifar now working -> relu fixed

---------

Co-authored-by: Anwesh Bhattacharya <[email protected]>

* secfloat tests added for lenet and hinet

* added dependency

* added dependency

* removing hinet test from actions, because of out of memory error

* removing hinet test from actions, because of out of memory error

* maxpool padding added

* removing unwanted changes

* paading not implemented in secfloat maxpool as of now

---------

Co-authored-by: Anwesh Bhattacharya <[email protected]>
  • Loading branch information
drunkenlegend and anuwu authored Jul 27, 2023
1 parent 8b07f73 commit 01285e9
Show file tree
Hide file tree
Showing 32 changed files with 2,425 additions and 19,954 deletions.
112 changes: 45 additions & 67 deletions .github/workflows/main.yml → .github/workflows/athos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Testing
name: Athos CI Testing

# Controls when the workflow will run
on:
Expand All @@ -12,8 +12,8 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
ABY-and-EMP:

ABY:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
Expand All @@ -31,8 +31,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Setup and Test EMP

- name: Setup and Test ABY
env:
HOME: /root
OPAM_SWITCH_PREFIX: /root/.opam/4.10.0
Expand All @@ -41,31 +41,55 @@ jobs:
MANPATH: :/root/.opam/4.10.0/man
PATH: /root/.opam/4.10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
run: |
pwd
cd EzPC/EzPC/
make
wget https://raw.githubusercontent.com/emp-toolkit/emp-readme/master/scripts/install.py
python install.py --deps --tool --ot --sh2pc
rm -rf install.py
cd ../../
- name: Setup and Test ABY
env:
HOME: /root
if: always()
run: |
cd EzPC/EzPC/
git clone --recursive https://github.com/encryptogroup/ABY.git
cd ABY/
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=./install -DABY_BUILD_EXE=On ..
cmake --build . --target install --parallel
cd ../..
cd EzPC/EzPC/
eval $(opam config env)
make
chmod +x runtests.sh
make runtest
cd ../..
shell: bash
EMP:
runs-on: ubuntu-latest
container:
image: drunkenlegend/ezpcsetup:latest
steps:

- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Setup and Test EMP
env:
HOME: /root
OPAM_SWITCH_PREFIX: /root/.opam/4.10.0
CAML_LD_LIBRARY_PATH: /root/.opam/4.10.0/lib/stublibs:/root/.opam/4.10.0/lib/ocaml/stublibs:/root/.opam/4.10.0/lib/ocaml
OCAML_TOPLEVEL_PATH: /root/.opam/4.10.0/lib/toplevel
MANPATH: :/root/.opam/4.10.0/man
PATH: /root/.opam/4.10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
run: |
pwd
cd EzPC/EzPC/
make
wget https://raw.githubusercontent.com/emp-toolkit/emp-readme/master/scripts/install.py
python install.py --deps --tool --ot --sh2pc
rm -rf install.py
eval $(opam config env)
chmod +x runemptests.sh
./runemptests.sh
cd ../../
ONNX-CPP:
# The type of runner that the job will run on
Expand Down Expand Up @@ -146,8 +170,7 @@ jobs:
cd Athos/tests/onnx/unittests
pytest --backend 2PC_OT
shell: bash



FSS:
# The type of runner that the job will run on
runs-on: ubuntu-latest
Expand Down Expand Up @@ -197,50 +220,5 @@ jobs:
cd FSS/tests
./runall.sh



TF-SCI-OT:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: drunkenlegend/ezpcsetup:latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y

- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Setup SCI
run: |
cd SCI
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=./install ../
cmake --build . --target install --parallel
cd ../..
- name: Test Athos TF-SCI-OT
if: always()
env:
HOME: /root
OPAM_SWITCH_PREFIX: /root/.opam/4.10.0
CAML_LD_LIBRARY_PATH: /root/.opam/4.10.0/lib/stublibs:/root/.opam/4.10.0/lib/ocaml/stublibs:/root/.opam/4.10.0/lib/ocaml
OCAML_TOPLEVEL_PATH: /root/.opam/4.10.0/lib/toplevel
MANPATH: :/root/.opam/4.10.0/man
PATH: /root/.opam/4.10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
run: |
cd EzPC/EzPC/
make
cd ../..
cd Athos/tests/tf/unittests
pytest --backend 2PC_OT
shell: bash

227 changes: 227 additions & 0 deletions .github/workflows/onnx_bridge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
name: OnnxBridge CI Testing

# Controls when the workflow will run
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

LLAMA:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: drunkenlegend/onnxbridge:latest
options: --user root

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: |
apt-get update -y
- name: LLAMA
if: always()
run: |
cd OnnxBridge/tests/
pytest --backend LLAMA -v -k 'lenet and not batch'
pytest --backend LLAMA -v -k 'hinet and not batch'
shell: bash

LLAMA-batch:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: drunkenlegend/onnxbridge:latest
options: --user root

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: |
apt-get update -y
- name: LLAMA Batch
if: always()
run: |
cd OnnxBridge/tests/
pytest --backend LLAMA -v -k 'lenet and batch' --batch_size 2
pytest --backend LLAMA -v -k 'hinet and batch' --batch_size 5
shell: bash

LLAMA-ct:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: drunkenlegend/onnxbridge:latest
options: --user root

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: |
apt-get update -y
- name: LLAMA Cleartext
if: always()
run: |
cd OnnxBridge/tests/
pytest --backend CLEARTEXT_LLAMA -v -k 'lenet and not batch'
pytest --backend CLEARTEXT_LLAMA -v -k 'hinet and not batch'
pytest --backend CLEARTEXT_LLAMA -v -k 'chexpert and not batch'
shell: bash

LLAMA-ct-batch:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: drunkenlegend/onnxbridge:latest
options: --user root

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: |
apt-get update -y
- name: LLAMA Cleartext Batch
if: always()
run: |
cd OnnxBridge/tests/
pytest --backend CLEARTEXT_LLAMA -v -k 'lenet and batch' --batch_size 2
pytest --backend CLEARTEXT_LLAMA -v -k 'hinet and batch' --batch_size 5
shell: bash

Secfloat:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: drunkenlegend/onnxbridge:latest
options: --user root

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: |
apt-get update -y
apt install libgmp-dev libmpfr-dev -y
- name: Build Secfloat
run: |
cd SCI
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=./install ..
cmake --build . --target install --parallel
cd ../..
shell: bash

- name: Secfloat
if: always()
run: |
cd OnnxBridge/tests/
pytest --backend SECFLOAT -v -k "lenet and not batch"
shell: bash

Secfloat-ct:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: drunkenlegend/onnxbridge:latest
options: --user root

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Update Git
run: |
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: |
apt-get update -y
apt install libgmp-dev libmpfr-dev -y
- name: Build Secfloat
run: |
cd SCI
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=./install ..
cmake --build . --target install --parallel
cd ../..
shell: bash

- name: Secfloat Cleartext
if: always()
run: |
cd OnnxBridge/tests/
pytest --backend SECFLOAT_CLEARTEXT -v -k "lenet and not batch"
pytest --backend SECFLOAT_CLEARTEXT -v -k "hinet and not batch"
shell: bash

2 changes: 1 addition & 1 deletion EzPC/EzPC/compile_aby.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash
ABY_CPP_FILE=$1
EZPC_SRC_PATH=$(dirname $0)

Expand Down
1 change: 1 addition & 0 deletions EzPC/EzPC/runemptests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@ if [[ "${checks}" == "Failed" ]]
then
exit 1
fi
exit 0
Loading

0 comments on commit 01285e9

Please sign in to comment.