-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prover): add GPU feature for compressor (#1838)
## What ❔ Integrate GPU proof compressors into monorepo. GPU compressors can be run with `gpu` feature. ## Why ❔ Running compressors with GPU significantly improves efficiency. CPU compressor average proving time - 15 minutes GPU compressor average proving time - 2 minutes ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. - [x] Spellcheck has been run via `zk spellcheck`. - [x] Linkcheck has been run via `zk linkcheck`.
- Loading branch information
1 parent
fc2fe4e
commit e9a2213
Showing
17 changed files
with
346 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -961,3 +961,6 @@ vec | |
zksync_merkle_tree | ||
TreeMetadata | ||
delegator | ||
Bbellman | ||
Sbellman | ||
DCMAKE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Will work locally only after prior universal setup key download | ||
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 as builder | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG CUDA_ARCH=89 | ||
ENV CUDAARCHS=${CUDA_ARCH} | ||
|
||
RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ git \ | ||
pkg-config build-essential libclang-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:$PATH | ||
|
||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \ | ||
rustup install nightly-2023-08-21 && \ | ||
rustup default nightly-2023-08-21 | ||
|
||
RUN curl -Lo cmake-3.24.2-linux-x86_64.sh https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.sh && \ | ||
chmod +x cmake-3.24.2-linux-x86_64.sh && \ | ||
./cmake-3.24.2-linux-x86_64.sh --skip-license --prefix=/usr/local | ||
|
||
WORKDIR /usr/src/zksync | ||
COPY . . | ||
|
||
RUN cd prover && \ | ||
git clone https://github.com/matter-labs/era-bellman-cuda.git --branch main bellman-cuda && \ | ||
cmake -Bbellman-cuda/build -Sbellman-cuda/ -DCMAKE_BUILD_TYPE=Release && \ | ||
cmake --build bellman-cuda/build/ | ||
|
||
RUN cd prover && BELLMAN_CUDA_DIR=$PWD/bellman-cuda cargo build --features "gpu" --release --bin zksync_proof_fri_compressor | ||
|
||
FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 | ||
|
||
RUN apt-get update && apt-get install -y curl libpq5 ca-certificates && rm -rf /var/lib/apt/lists/* | ||
|
||
# copy VK required for proof wrapping | ||
COPY prover/vk_setup_data_generator_server_fri/data/ /prover/vk_setup_data_generator_server_fri/data/ | ||
|
||
COPY setup_2\^24.key /setup_2\^24.key | ||
|
||
ENV CRS_FILE=/setup_2\^24.key | ||
|
||
COPY --from=builder /usr/src/zksync/prover/target/release/zksync_proof_fri_compressor /usr/bin/ | ||
|
||
ENTRYPOINT ["zksync_proof_fri_compressor"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[fri_proof_compressor] | ||
compression_mode=1 | ||
prometheus_listener_port=3321 | ||
prometheus_pushgateway_url="http://127.0.0.1:9091" | ||
prometheus_push_interval_ms=100 | ||
generation_timeout_in_secs=3600 | ||
max_attempts=5 | ||
universal_setup_path="../keys/setup/setup_2^26.key" | ||
universal_setup_download_url="https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2^26.key" | ||
verify_wrapper_proof=true | ||
compression_mode = 1 | ||
prometheus_listener_port = 3321 | ||
prometheus_pushgateway_url = "http://127.0.0.1:9091" | ||
prometheus_push_interval_ms = 100 | ||
generation_timeout_in_secs = 3600 | ||
max_attempts = 5 | ||
universal_setup_path = "../keys/setup/setup_2^24.key" | ||
universal_setup_download_url = "https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2^24.key" | ||
verify_wrapper_proof = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.