New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Correctness of CrypTen #304
Comments
There some functionality to validate correctness of function outputs in CrypTen, but it is pretty barebones. In particular, it is not yet integrated into the autograd. Having said that, you can probably use it to check the output of functions you think are suspect. It is important to keep in mind that CrypTen uses fixed-point number encodings (with 16 bits by default) and that several function are evaluated by Newton-Raphson / Taylor / etc. approximations so some deviations from plaintext are expected. In particular, deviations can accumulate in very deep networks (for instance, we know deep Transformers are tricky because our |
To avoid the influence of complex networks(Transformers .etc), I trained a simple NN to verify the correctness of model structure
However, the loss I got with crypten is different from loss in plaintext. I offer an example as following: |
The zip file provided is missing the file |
Firstly, you must run |
Just ran this with the outputs from Is this what you expect? |
Hmm, could you try updating your crypten version. I am running on our newest version (0.4.0) and I'm seeing correct results using CrypTen. |
To avoid the version problem, I have tried the latest version. I used |
For reference, I changed some of the logs to show plaintext and crypten loss. This is my output (note this requires python3):
This was run in a new conda environment with the following dependencies (most are not required, but this is my environment after installing from requirements.txt):
|
I know why we run the results differently. In the readme, I have noted the running method, you should open three terminals and respectively run :
Because I want to construct the three-party MPC. |
This should be fixed with the landing of #313. Closing this issue. Please re-open if there are still issues with this. |
I have trained my own model in plaintext. Now I intend to inference the model by
CrypTen
. After many preliminary preparations, I find the result is different from the plaintext, so I think that some building blocks ofCrypTen
have problems.How can i debug it? Hope you can give me some suggestions.
The text was updated successfully, but these errors were encountered: