-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use tachyon to speed up witness and proofgen #75 #102
Use tachyon to speed up witness and proofgen #75 #102
Conversation
Thank you for your PR!
I think the Dockerfile should specify main branch of tachyon, right? |
I changed the branch to main, and got the following error.
|
libs/tachyon.Dockerfile
Outdated
WORKDIR /tachyon | ||
RUN bazel --batch build --config linux //... |
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.
If you only need the prover_main binary, please build just that. Refer to the details in the Tachyon Circom README (assuming you're not using CUDA):
WORKDIR /tachyon | |
RUN bazel --batch build --config linux //... | |
WORKDIR /tachyon/vendors/circom | |
RUN CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index && bazel build --@kroma_network_tachyon//:has_openmp -c opt --config linux //:prover_main |
libs/tachyon.Dockerfile
Outdated
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
# Clone and build Tachyon | ||
RUN git clone https://github.com/kroma-network/tachyon /tachyon |
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.
Even with our best efforts, the main
branch doesn't always ensure build stability. To mitigate this, I recommend cloning the repository with a specific tag, such as v0.3.0
, and upgrade the version gradually.
RUN git clone https://github.com/kroma-network/tachyon /tachyon | |
RUN git clone --branch v0.3.0 https://github.com/kroma-network/tachyon /tachyon |
packages/prover/Dockerfile
Outdated
# NOTE(whoisgautxm): Should remove after this is merged to main branch | ||
RUN git fetch origin && git checkout main | ||
|
||
RUN echo build --config linux > .bazelrc.user && \ | ||
echo "build --action_env=CARGO=$HOME/.cargo/bin/cargo" >> .bazelrc.user && \ | ||
echo "build --@rules_rust//rust/toolchain/channel=nightly" >> .bazelrc.user | ||
RUN bazel build //... |
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.
WORKDIR /tachyon | |
# NOTE(whoisgautxm): Should remove after this is merged to main branch | |
RUN git fetch origin && git checkout main | |
RUN echo build --config linux > .bazelrc.user && \ | |
echo "build --action_env=CARGO=$HOME/.cargo/bin/cargo" >> .bazelrc.user && \ | |
echo "build --@rules_rust//rust/toolchain/channel=nightly" >> .bazelrc.user | |
RUN bazel build //... | |
WORKDIR /tachyon/vendors/circom | |
RUN CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index && bazel build --@kroma_network_tachyon//:has_openmp -c opt --config linux //:prover_main |
packages/prover/Dockerfile
Outdated
|
||
# Clone and build Tachyon | ||
RUN git clone https://github.com/kroma-network/tachyon /tachyon |
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.
RUN git clone https://github.com/kroma-network/tachyon /tachyon | |
RUN git clone --branch v0.3.0 https://github.com/kroma-network/tachyon /tachyon |
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.
@SoraSuegami I think perhaps you are missing this!
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.
@SoraSuegami I think perhaps you are missing this!
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.
Thank you very much!
I could build the docker image on modal!
Thank you for your additional comments!
|
@chokobole Is the following format correct for the output of the tachyon prover? |
If our parsing is wrong, are we confident that a new modal deployment will still be able to generate the correct format of proof? Was this end-to-end tested at all |
@chokobole
I am not sure why it is different from the expected format in the code. |
Sorry, I merged this PR because the modal sever pulls this repo from main branch when building a Dockerfile, and I expected that the prover worked once a docker image is built. |
@SoraSuegami Could you tell me how to run the tests? |
@chokobole
|
@chokobole the tests still seems to be slower than rapidsnark, maybe we can see some sort of acceleration by using gpu? |
@Bisht13 I think I can inspect this. Could you tell me your specs and how you tested the performance? |
Fixes #75
This PR integrates Tachyon to speed up the witness and proof generation process. The following changes were made:
Changed libs/rapidSnark.Dockerfile to libs/tachyon.Dockerfile
Changed the packages/prover/circom_proofgen.sh to accommodate proofgen by tachyon
Changes the packages/prover/Dockerfile to accommodate tachyon prover
Changes the packages/prover/core.py to accommodate tachyon prover
The benchmark results of circom circuits are in this github repo: https://github.com/whoisgautxm/circom-benchmark, which show ~30% speedup due to nmap/mmap usage primarily.