-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/sigma-2'
- Loading branch information
Showing
49 changed files
with
1,589 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
|
||
|
||
# Orca: FSS-based Secure Training and Inference with GPUs | ||
|
||
Implementation of protocols from the paper [Orca](https://eprint.iacr.org/2023/206). | ||
|
||
**Warning**: This is an academic proof-of-concept prototype and has not received careful code review. This implementation is NOT ready for production use. | ||
|
||
## Build | ||
|
||
This project requires NVIDIA GPUs, and assumes that GPU drivers and the [NVIDIA CUDA Toolkit](https://docs.nvidia.com/cuda/) are already installed. The following has been tested on Ubuntu 20.04 with CUDA 11.7, CMake 3.27.2 and g++-9. | ||
|
||
Please note that Sytorch requires CMake version >= 3.17 and the build will fail if this depency is not met. | ||
|
||
The code uses CUTLASS version 2.11 by default, so if you change the CUDA version, please make sure that the CUTLASS version being built is compatible with the new CUDA version. To change the version of CUTLASS being built, add `git checkout <branch>;` after line 31 (`cd ext/cutlass;`) of setup.sh. | ||
|
||
The last line of `setup.sh` tries to install `matplotlib`, which is needed for generating Figures 5a and 5b. In our experience, the installation fails if the versions of Python and `pip` do not match. In case the installation fails, please install `matplotlib` manually before running `run_experiment.py`. | ||
|
||
1. Export environment variables | ||
|
||
``` | ||
export CUDA_VERSION=11.7 | ||
export GPU_ARCH=86 | ||
``` | ||
|
||
2. Set up the environment | ||
|
||
``` | ||
sh setup.sh | ||
``` | ||
|
||
3. Make Orca | ||
|
||
``` | ||
make orca | ||
``` | ||
|
||
## Run Orca | ||
|
||
1. Each party runs two processes: a dealer and an evaluator. The configuration needs to define the GPU on which the dealer will run, and the directory in which it will store FSS keys. This is done in `config.json` as: | ||
|
||
```javascript | ||
"dealer" : | ||
{ "gpu": <The ID of the GPU to use>, | ||
"key_dir": <The directory in which the dealer will store keys> | ||
} | ||
``` | ||
|
||
FSS keys tend to be quite large so please make sure that the key directory has at least 500GB of free space. Please also ensure that it is writeable. | ||
|
||
Similarly, the configuration also needs to define the GPU on which the evaluator will run, and the IP address of its peer, i.e., the address of the remote party the evaluator will communicate with for secure training or inference. This is done in `config.json` as: | ||
|
||
```javascript | ||
"evaluator" : | ||
{ "gpu": <The ID of the GPU to use>, | ||
"peer": <The address of the remote peer> | ||
} | ||
``` | ||
|
||
You can run Orca to generate Figures 5a and 5b, as well as Tables 3, 4, 6, 7, 8 and 9. Table 5 can be generated by throttling the network bandwidth (with `tc`, for example) and regenerating Table 4. The script reports numbers for Tables 4, 6, 7 and 9 as the average of 10 iterations. | ||
|
||
Figure 5b and Table 3 run end-to-end training and so can take a couple of days to finish. | ||
|
||
Evaluation runs through `experiments/orca/run_experiment.py`. Here are the relevant options: | ||
|
||
``` | ||
usage: run_experiment.py [-h] [--figure FIGURE] [--table TABLE] --party 0/1 | ||
optional arguments: | ||
--figure FIGURE Figure # to run. | ||
--table TABLE Table # to run. | ||
--all true Run all the experiments. | ||
``` | ||
|
||
Results are stored in the `output/P<party-number>/Table<table-number>` or `output/P<party-number>/Fig<figure-number>` folders. | ||
|
||
Log files (which might help with debugging) are stored in the corresponding experiment folders, i.e., in `output/P<party-number>/Table<table-number>/logs` and `output/P<party-number>/Fig<figure-number>/logs`. | ||
|
||
## Citation | ||
|
||
You can cite the paper using the following BibTeX entry: | ||
|
||
``` | ||
@INPROCEEDINGS {, | ||
author = {N. Jawalkar and K. Gupta and A. Basu and N. Chandran and D. Gupta and R. Sharma}, | ||
booktitle = {2024 IEEE Symposium on Security and Privacy (SP)}, | ||
title = {Orca: FSS-based Secure Training and Inference with GPUs}, | ||
year = {2024} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.