Comments (4)
- cheetah_mul is not for matmul
- to perform share*private matmul, just turn on this in your config.json file
from spu.
@fionser
thanks for the quick reply. There are some additional questions left.
How can I designate each matrix in the secure matmul functionality to be secret shared or private? For example, could you tell me how the bool variance you mentioned to designate which matrix should be private?
Besides that, I am also curious about the functionality of the protocols implemented in cheetah_mul.cc?
Also, may I ask it that is the following lambda function makes sense for the spu compiler? This is an attempt to designate matrix W to be private, but run it with the spu and just return an awkward result.
def run_on_cpu(X):#X is matrix (k, d)
d=....#We set the value of d and n here for debug
n=....
W = create_random_binary_matrix(d, n)
return jnp.matmul(X, W)
from spu.
When experimental_enable_colocated_optimization=True
is setting the config file.
Then the input variables will be kept as private first. For example,
client_input = ppd.device("P1")(lambda x: x)(X)
server_input = ppd.device("P2")(lambda x: x)(W)
The X
matrix is a private of party 1, and W
is a private from the party 2.
Then if doing the matmul jnp.matmul(X, W)
. For sure, we cannot compute the result X*W
in a form of private, but in shared. That means, private X
matmul private W
gives a shared result X*W
However, doing boolean * boolean in Cheetah might not be a good practice. Basically, the homomorphic encryption we used in Cheetah will introduce 1-bit error at the end of the computation, which should be fine for the fixed-point computation, but not for the Boolean * Boolean operation.
from spu.
@fionser Thanks for the detailed explanation and supervision. I found no other questions left.
I created binary matrices X
, W
for easier debugging due to the ground truth value of XW
can be small.
I didn't realize that the code snippet will execute boolean multiplication instead of what over FM64.
I will check it and I sincerely appreciate your help.
from spu.
Related Issues (20)
- [Bug]: Dear teachers, when i try to use spu on torch, i found a problem HOT 7
- [Question]: overflow and underflow HOT 3
- [Feature]: Can we profiling the round complexity of each primitives? HOT 1
- [Bug]: 安装时报除0错误 HOT 3
- 执行beaver服务器时,出现问题 HOT 5
- LLaMAConfig缺少 HOT 3
- [Question]: protocol for secure bit-wise comparison in Cheetah HOT 7
- [Bug]: squirrel experiment HOT 1
- [Question]: how are signed integers represented as fixed point binary values in SPU? HOT 3
- [Bug]: when i use spu, it errors as follows "keyboardInterrrupt", but i did not use ctrl+c to end it HOT 5
- [Bug]: when i install secretflow using " pip install -U secretflow", it report errors as follows
- [Bug]: hello, could you please tell me some advice on the code location of "Ditto: Quantization-aware Secure Inference of Transformers upon MPC" HOT 16
- [Bug]: root/.cache/bazel/_bazel_root/5fb069ff7e8788e0e7d803c89624f2bc/execroot/spulib/bazel-out/k8-fastbuild/bin/spu/tests/jnp_dynamic_ring_test.runfiles/spulib/spu/tests/jnp_dynamic_ring_test.py", line 15, in <module> import jax ModuleNotFoundError: No module named 'jax' HOT 2
- [Bug]: When i use the following code and change the FlaxGPT2Block to float16" ", it output "I enjoy walking with my cute dog cement Facility Users LankaPHOTOS henceitial periodsGener observations HOT 2
- [Bug]: ERROR: Build failed. Not running target HOT 2
- [Bug]: dear teachers, i wanna to test the time proportion of softmax、gelu in gpt2, could you please give me some advice
- [Bug]: dear teachers, how to test the runtime using secretflow in lan and wan environment, could you please give me some advice on setting the lan and wan HOT 4
- [Bug]: flax_gpt2 produces wrong results when using semi2k with a custom MatMulAA operator HOT 3
- [Bug][Critical] Mistaking the source/dst copy in the PackedB2A implementation HOT 1
- [Bug]: types do not equal HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spu.