This simulator studies various scheduling algorithms given differential privacy budget constraint. It includes round-robin, first-come-first-serve, DPF algorithms. For more background about this problem, please refer to our PrivateKube paper.
In addition to differential privacy, the simulator also considers other computational resources, such as CPU and memory.
Install conda, create and activate an isolated python environment "ae".
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
eval "$($HOME/miniconda/bin/conda shell.bash hook)"
conda init
conda create -n ae -c conda-forge pypy3.6 pip python=3.6 seaborn notebook -y
conda activate ae
clone the osdi21_artifact branch from this repo. Install a package called dpsched via
git clone https://github.com/taoluo/privacy-budget-scheduling.git@osdi21_artifact
cd privacy-budget-scheduling
pip install -r ./requirements.txt
pip install .[plot]
pytest
./examples/minimal_example.py gives a quick start. There are two key concepts in the simulation program:
- The simulation model: This implements how different components in the systems behave and interact with each other. One can import it via
from dpsched import Top
- The configuration dictionary: a dictionary that specifies many aspects of simulation behavior. for configuration details, please refer to the comments in minimal_example.py
Basically, there are two steps in ./examples/minimal_example.py.
- Preparing the config dictionary
- Calling
simulate(config, Top)
, whereconfig
is the config dict andTop
is the simulation model.
To run the minimal example.
cd ./examples
python ./minimal_example.py
or, replace CPython with PyPy for better performance:
cd ./examples
pypy ./minimal_example.py
The simulation program saves experiment results in a workspace specified by config dictionary. By default, it is saved under "./examples/exp_result/some_work_space_name"
dpsched.analysis
contains modules for collecting experiment result from workspace directory and plotting various figures.
./examples/microbenchmark_figures_single_block.ipynb gives examples on how to use dpsched.analysis
module with detailed comments.
./examples/microbench_single_block.py contains the script to reproduce single static block workload experiment with various DP scheduling policies, for both epsilon-delta DP composition and Renyi DP composition. The major difference between microbench_single_block.py and minimal_example.py is minimal_example.py only runs single simulation while microbench_single_block.py runs multiple simulations in parallel.
./examples/microbench_multi_block.py is the dynamic multiple block counterpart of microbench_single_block.py
One can run them by (caveat: they may take hours to finish especially for multiple block script)
cd ./examples
pypy ./microbench_single_block.py
pypy ./microbench_multi_block.py
Similar to minimal_example.py, the experiment results are saved under "./examples/exp_result/some_work_space_name"
./examples/microbenchmark_figures_single_block.ipynb and ./examples/microbenchmark_figures_multiple_block.ipynb show how to reproduce microbenchmark figures. Note that these two notebook download existing microbenchmark results and plot them directly. Therefore, we don't need to rerun microbenchmark experiments. I recommend viewing these notebooks directly via (nbviwer)[https://nbviewer.jupyter.org/]
(explain high level idea on how to implement "Top")