-
Notifications
You must be signed in to change notification settings - Fork 57
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
Using SIMD and Multithreading #52
Comments
No multithreading unless you manually do it. Just make everything independent and it should be fine. You can concurrently execute multiple asyncMul. Do
For simd, the library internally does simd operations of the matrices. So matrix matrix multiplication will be simd. The multiplication protocol is also super simple so if you want something more custom that's also possible with a bit of code. |
For binary stuff you need to make a betacircuit of the computation you want to do and then evaluate that using the binaryEvaluator. See the unit tests. |
thanks for the swift reply. I assume by concurrently with I just want to evaluate multiple AND gates in parallel, similiar to the multiplication example. Is there a simple few-liner with a similiar API to mult? |
so here is an exmaple https://github.com/ladnir/aby3/blob/master/aby3_tests/Sh3BinaryEvaluatorTests.cpp#L243 you define a binary circuit (
so this means that Here are more examples of how to build circuits https://github.com/ladnir/cryptoTools/blob/master/tests_cryptoTools/Circuit_Tests.cpp.
|
Thanks, integrating multithreading was straightforward and evaluating arithmetic functions with it. It seems there is only int64 and not int32 for secret values? Unfortunately I didn't manage to get custom boolean circuits to run and the examples are a little bit too complex for me. How would I define for instance 1000 64-bit vectors A,B,C to perform C[i] = A[i] & B[i] with SIMD using the code snippet you mentioned? |
Does ABY have SIMD or Multithreading support? If so, how can I evaluate multiple inependent multiplications like in this example more efficiently? Also, what's the API for AND gates instead of Multiplication gates?
si64 prod = sharedVec[0];
task = runtime.noDependencies();
for (u64 i = 1; i < sharedVec.size(); ++i)
task = eval.asyncMul(task, prod, sharedVec[i], prod);
The text was updated successfully, but these errors were encountered: