-
Notifications
You must be signed in to change notification settings - Fork 103
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
Optimizations for Shamir-based Protocol #880
base: main
Are you sure you want to change the base?
Conversation
# Pull Request ## What problem does this PR solve? Issue Number: Fixed # ## Possible side effects? - Performance: - Backward compatibility:
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
@@ -623,12 +625,10 @@ Value xor_pp(SPUContext* ctx, const Value& x, const Value& y) { | |||
Value lshift_s(SPUContext* ctx, const Value& x, const Sizes& bits) { | |||
SPU_TRACE_MPC_DISP(ctx, x, bits); | |||
TRY_DISPATCH(ctx, x, bits); | |||
if (IsA(x)) { | |||
if (IsA(x) && ctx->hasKernel("lshift_a")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
若是ArithShare,但有没有lshift_a
,也走lshift_b
吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
若是ArithShare,但有没有
lshift_a
,也走lshift_b
吗?
是的
@@ -25,6 +25,7 @@ namespace spu::mpc::test { | |||
namespace { | |||
|
|||
Shape kShape = {20, 30}; | |||
// Shape kShape = {3}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean pls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete this file
@@ -623,12 +625,10 @@ Value xor_pp(SPUContext* ctx, const Value& x, const Value& y) { | |||
Value lshift_s(SPUContext* ctx, const Value& x, const Sizes& bits) { | |||
SPU_TRACE_MPC_DISP(ctx, x, bits); | |||
TRY_DISPATCH(ctx, x, bits); | |||
if (IsA(x)) { | |||
if (IsA(x) && ctx->hasKernel("lshift_a")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
若是ArithShare,但有没有
lshift_a
,也走lshift_b
吗?
是的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete this file
public: | ||
static constexpr const char* kBindName() {return "rand_a"; } | ||
|
||
Kind kind() const override { return Kind::Dynamic; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the communication complexity
@@ -0,0 +1,16 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件不需要进主线吧?
|
||
ce::CExpr comm() const override { return ce::Const(0); } | ||
|
||
NdArrayRef proc(KernelEvalContext* ctx, const NdArrayRef& in) const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NotA::proc 的实现在哪呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove class NotA
if not need.
_prefix_prod[i] = mul_mod(_prefix_prod[i - 1], _x[i]); | ||
} | ||
|
||
ring2k_t pprod_inverse = mul_inv(_prefix_prod[numel - 1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused-variable
|
||
ce::CExpr comm() const override { return ce::Const(0); } | ||
|
||
NdArrayRef proc(KernelEvalContext* ctx, const NdArrayRef& in) const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove class NotA
if not need.
Pull Request
What problem does this PR solve?
主要修改&优化:
libspu/mpc/utils/gfmp_ops.cc
libspu/mpc/shamir/arithmetic.cc
libspu/mpc/shamir/boolean.cc
libspu/mpc/shamir/conversion.cc
Issue Number: Fixed #
Possible side effects?
Performance:
Backward compatibility: