GithubHelp home page GithubHelp logo

Comments (4)

fionser avatar fionser commented on August 17, 2024
  • cheetah_mul is not for matmul
  • to perform share*private matmul, just turn on this in your config.json file

from spu.

YefanWu avatar YefanWu commented on August 17, 2024

@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.

fionser avatar fionser commented on August 17, 2024

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.

YefanWu avatar YefanWu commented on August 17, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.