This repository contains the implementation of Apollo and Artemis, our CP-SNARK constructions from our paper. The underlying zkML implementation is based on the zkML paper/repo.
Rust
This repository requires several artifacts related to the model definitions used in the evaluation.
The model definitions (msgpack files) are stored in examples/models
(360MB) in an S3 bucket,
and can be downloaded using the following command:
aws s3 sync s3://pps-artemis-artifacts/models examples/models
The setup parameters for the polynomial commitments, params_ipa
(15GB), params_kzg
(64GB), take up a significant amount of time
for the larger models to generate (although less than the time of generating the proof).
To optimize this, it might be useful to generate the setup parameters once and store them for later use.
The script looks for the setup parameters in the params_ipa
and params_kzg
directories in the root code directory.
In case the setup parameters do not exist in the expected locations, they will be automatically generated when running the benchmarking script.
To run with model
for polynomial commitment type (pc_type
) and CP-SNARK type cp_snark
do the following:
model takes values in ['mnist', 'resnet', 'dlrm', 'mobilenet', 'vgg', 'gpt2', 'diffusion']
polynomial commitment takes values in ['kzg', 'ipa']
CP-SNARK takes values in ['nocom', 'poly', 'cp_link', 'pos', 'cp_link_plus']
rustup override set nightly
cargo build --release
./src/bin/test.zsh ‘model_name’ ‘pc_type’ ‘cp_snark’ ‘num_runs’ 1 .
The evaluation is built using DoE-Suite, which allows straightforward reproducibility of results by defining experiments in a configuration file (suite) and executing them on a set of machines. We provide the necessary DoE-Suite commands to reproduce all results. However, it is also possible to obtain the individual commands used to invoke the framework and run them manually. For details on running the suites, please refer to the DoE-Suite documentation.
Our artifact contains the following suites:
Available Suites
Suite | Models | Est. Duration |
---|---|---|
model-small | mnist, resnet18, dlrm | TODO |
model-mobilenet | MobileNet | TODO |
model-vgg | VGG | TODO |
model-diffusion | Diffusion | TODO |
model-gpt2 | GPT-2 | TODO |
TODO: Add CPLink models and poly_ipa?