Our project consists of a server component to which clients (the GPUs) connect to. The server needs to have docker installed and the clients need to have apptainer installed.
In the following, we assume that you want to run the experiments on an A40 and an A100. We assume clients to be able to connect to the server via the hostname "server-hostname". You need to set up the project on the server and for the clients on all respective computers.
- On the server: Run
make docker-build-serverto build the docker container for the server (the container is nameddiffmath-server) - On the clients: Run
make apptainer-build-clientto build the apptainer container for the clients (the container will be saved atapptainer/gpu.sif). Set this up on both the A40 and the A100. - Download the ImageNet dataset and set it up in
data/imagenet. The directory structure needs to containdata/imagenet/train_setanddata/imagenet/val_seton both the server and the client. - Download the torch models (e.g., using
src/models.py- you need torch to run this script). The paths to the models can be set in./start_server.sh.
On the server run:
[server] $ ./start_server.sh a40 a100On the clients run:
[a40-client] $ ./start_client server-hostname a40[a100-client] $ ./start_client server-hostname a100The outputs will be saved on the server in output/backdoor. To see results for the data types float16 or bfloat16, change the value of --model_dtype float32 before starting the server. You do not need to change anything when starting the clients. The clients will receive the correct experiment configuration from the server upon start.
Before starting the experiment, change the variable --n_poison_samples 1 in ./start_server to the desired value.
Before starting the experiment, add more than two clients (e.g., A40, A100, H100) by adding another --backends <backend_name> to ./start_serverand then set --do_one_vs_all true.
Before starting the experiment, set the variables --permute_after_gradient and --flip_bits_after_gradient to control whether these steps are included in the evaluation. Note that permute_after_gradient can only be used on ViT.