Skip to content
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

[Feature]: 在SPU中新增协议 #922

Open
c-doubley opened this issue Nov 25, 2024 · 4 comments
Open

[Feature]: 在SPU中新增协议 #922

c-doubley opened this issue Nov 25, 2024 · 4 comments

Comments

@c-doubley
Copy link

Feature Request Type

Build/Install

Have you searched existing issues?

Yes

Is your feature request related to a problem?

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe features you want to add to SPU

A clear and concise description of what you want to happen.

Describe features you want to add to SPU

在SPU中添加新协议的时候有一个API测试,包含了算术算子,布尔算子以及算术和布尔的转化,但是我现在想新增一个协议,这个协议只包含算术运算的算子,如果这样做的话,在上层调用的时候是不是会容易报错,我想知道哪些操作可能会导致报错。
比如在上层进行一个简单神经网络训练,在什么情况下可能会调用到底层布尔算子,这是可以避免的吗,比如仅使用算术算子来完成一个模型训练,这是可以人为在上层控制的吗,还是一定会有某些计算会涉及到布尔的算子呢

@deadlywing
Copy link
Contributor

简单来说,只能支持加减;乘法也得看你是不是实现了trunc;至于其他数学函数,如exp,log等,也是完全跑不了

@c-doubley
Copy link
Author

参考spdz2k,把下面的算术算子都实现了
ctx->prot()
->regKernel<spdz2k::P2A, spdz2k::A2P, spdz2k::A2V, spdz2k::V2A,
spdz2k::NotA, spdz2k::AddAP, spdz2k::AddAA, spdz2k::MulAP,
spdz2k::MulAA, spdz2k::MatMulAP, spdz2k::MatMulAA,
spdz2k::LShiftA, spdz2k::TruncA, spdz2k::RandA>();
加减和乘法应该都没问题,像exp,log这种也不能用多项式近似来解决吗

@deadlywing
Copy link
Contributor

几乎所有数学函数都强依赖a2b,因为要做range reduction

@c-doubley
Copy link
Author

好的,感谢您的解答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants