mc2-project / delphi

A Cryptographic Inference Service for Neural Networks
Apache License 2.0
124 stars 28 forks source link

Question about Delphi Implementation #42

Closed alarst13 closed 1 year ago

alarst13 commented 1 year ago

Hi. In the paper, it is said that data is encrypted offline, and the encrypted data is sent to the cloud for inference purposes. On the other end, the service provider's model (the weights) is encrypted, and the inference is done through this encrypted model using the encrypted data. Can you help me identify at what steps, in your GitHub repo, these encryptions are taken care of? And one other question. I ran Delphi step by step, following your instructions. However, I was able to do everything through one terminal. Is this supposed to be this way, or I'm doing it wrong? Please correct me if I'm mistaken. Delphi is supposed to be a two-party scheme; however, I assume you implement it this way for academic purposes and merely to test the feasibility of your scheme? I apologize if my assumptions don't make any sense. I'm new to this domain.

ryanleh commented 1 year ago

Can you help me identify at what steps, in your GitHub repo, these encryptions are taken care of?

What exactly are you trying to do? I can give a more succinct answer if I know what you're trying to figure out.

I ran Delphi step by step, following your instructions. However, I was able to do everything through one terminal. Is this supposed to be this way, or I'm doing it wrong?

Many of the experiments in the repo simply run the client and server in separate threads to emulate two separate parties.

alarst13 commented 1 year ago

What exactly are you trying to do? I can give a more succinct answer if I know what you're trying to figure out.

I intend to run Delphi on a different neural network architecture, once with and once without its planner and compare the results. Assuming that I don't wanna use the planner (in other words, I don't wanna go through the NAS), I want to know how to encrypt the weights of my new pre-trained model using Delphi's protocol. Many of the experiments in the repo simply run the client and server in separate threads to emulate two separate parties.

Gotcha, many thanks!

ryanleh commented 1 year ago

I want to know how to encrypt the weights of my new pre-trained model using Delphi's protocol.

You shouldn't need to do any of this yourself -- you just need to give Delphi a description of the network. Here is an example of us defining a network architecture.

Also, just as a sidenote the weights of the network are never encrypted, just the user's query.

alarst13 commented 1 year ago

You shouldn't need to do any of this yourself -- you just need to give Delphi a description of the network. Here is an example of us defining a network architecture.

Word. One more question, how long did it take you to run the neural architecture search? Once, I kept it running for one day and a half and it was still running. Do you think I'm doing something wrong here?

ryanleh commented 1 year ago

Much of it depends on how computationally-intensive the network architecture you're doing NAS over is. It's been awhile but if I recall, for the ResNet32 model it took a few hours to run on a machine with something like 10 GPUs.

If things are taking too long for you, you can reduce the search space of the NAS algorithm by modifying the specification passed to Ray (e.g. for ResNet you would change this here)

alarst13 commented 1 year ago

I am SUPER THANKFUL!