Giter Club home page Giter Club logo

cyclone's Introduction

cyclone-msm

Assuming the FPGA image is loaded with make reset.

Note that this image agfi-09bec09a9e2b4d332 has a fix to enable reading out points without DRAM, compared to the image agfi-0d25a1d127f1b497f of the ZPrize submission.

Quickstart

# install the demo binaries
RUSTFLAGS='-C target-feature=+avx2' cargo install --features demo --git https://github.com/jumpcrypto/cyclone cyclone-msm

# load the FPGA image
sudo fpga-load-local-image -S 0 -I agfi-09bec09a9e2b4d332

# configure the demo (SIZE can be up to 26)
SIZE=16 LOCATION=/tmp/example-points-$SIZE
CYCLONE=$(command -v cyclone-msm)

# make some points
$CYCLONE $SIZE $LOCATION points

# load the points
sudo $CYCLONE $SIZE $LOCATION load

# run a random MSM on these points
sudo $CYCLONE --preloaded $SIZE $LOCATION msm

Development

Default SIZE=16.

  • make points SIZE=<SIZE> generates files size<SIZE>.beta and size<SIZE>.points.
  • make column SIZE=<SIZE> calculates a column MSM using these points.
  • make msm SIZE=<SIZE> calculates a full 16 column MSM using these points.

You can also skip loading points in the column and msm targes:

  • make load SIZE=<SIZE> generates files size<SIZE>.beta and size<SIZE>.points.
  • make column-pre SIZE=<SIZE> calculates a column MSM using these points.
  • make msm-pre SIZE=<SIZE> calculates a full 16 column MSM using these points.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

cyclone's People

Contributors

nickray avatar

Stargazers

Suhas Kudlur Viswanath avatar sanrenfeng avatar cliff.li avatar Ege avatar Madhav Goyal avatar ygot avatar Harvey Specter avatar Rajesh avatar Ratan Kaliani avatar haihuijiang avatar Ameya Deshmukh avatar Cheng JIANG avatar  avatar Sandalots avatar Lucas Kohorst avatar zerosnacks avatar fuyutarow avatar Kevin Jue avatar Shuhei Hiya avatar  avatar Georgios Konstantopoulos avatar eth_sign avatar Rajiv Patel-O'Connor avatar Justin Schuldt avatar

Watchers

 avatar Alex Davies avatar Emanuele Cesena avatar  avatar

cyclone's Issues

Mixed Add Scheduler Question

Hello -- I wasn't sure where to ask this question. It is quite likely a very silly one! I'll really appreciate clarification and help on this!

I was looking at the design in this article: https://eprint.iacr.org/2022/1396.pdf

Curious why the delay scheduler is used. Can't we send a new addition to pipeline as soon as we have two operands (either points or the aggregation) corresponding to the same bucket ready?

At time $t$, we pull up a reduced scaler $a_t$ and a point $P_t$. Assuming no collision so far, this is simply fed to the MixedAdd pipeline to compute $S_t \leftarrow S_t + P_t$. However in the meantime, say at $t+1$ when the point $P_{t+1}$ is pulled and if it collides, if I understand correctly, this is going to have to wait till the aggregation $S_t$ is ready. Moreover, if at $t+2$ if we collide again, this point will need to wait till $S_{t+1}$ is ready.

However, at $t+2$ we already have two operands for the bucket ready (even though the aggregation $S_t$ is still in pipeline. So we can still feed $P_{t+1}$ and $P_{t+2}$ to the adder to get $S'_{t+1,t+2} \leftarrow P_{t+1}+P_{t+2}$. Ultimately, when both $S_t$ and $S'_{t+1,t+2}$ are ready, these can be fed to the pipeline again $S_{t+2} \leftarrow S_t + S'_{t+1,t+2}$. This can be extended to support larger number of collisions as well, the idea being as long as we have two operands ready, we can always dispatch them for the MixedAdd.

Overall the delay in computation reduces from $3T$ to $2T+2$.

In this approach we are doing the same number of operations. This will need additional resources though, a few FIFOs, likely one per bucket (?).

I'd like to know whether there is some mathematical reason to not do it this way, or if the resource requirements become to large to handle.

Thanks in advance for reading through it!

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.