-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from matter-labs/popzxc-initial-setup
Initial setup
- Loading branch information
Showing
301 changed files
with
53,903 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
name: Bug report | ||
about: Use this template for reporting issues | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
--- | ||
|
||
### 🐛 Bug Report | ||
|
||
#### 📝 Description | ||
|
||
Provide a clear and concise description of the bug. | ||
|
||
#### 🔄 Reproduction Steps | ||
|
||
Steps to reproduce the behaviour | ||
|
||
#### 🤔 Expected Behavior | ||
|
||
Describe what you expected to happen. | ||
|
||
#### 😯 Current Behavior | ||
|
||
Describe what actually happened. | ||
|
||
#### 🖥️ Environment | ||
|
||
Any relevant environment details. | ||
|
||
#### 📋 Additional Context | ||
|
||
Add any other context about the problem here. If applicable, add screenshots to help explain. | ||
|
||
#### 📎 Log Output | ||
|
||
``` | ||
Paste any relevant log output here. | ||
``` |
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,21 @@ | ||
--- | ||
name: Feature request | ||
about: Use this template for requesting features | ||
title: '' | ||
labels: feat | ||
assignees: '' | ||
--- | ||
|
||
### 🌟 Feature Request | ||
|
||
#### 📝 Description | ||
|
||
Provide a clear and concise description of the feature you'd like to see. | ||
|
||
#### 🤔 Rationale | ||
|
||
Explain why this feature is important and how it benefits the project. | ||
|
||
#### 📋 Additional Context | ||
|
||
Add any other context or information about the feature request here. |
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,20 @@ | ||
# What ❔ | ||
|
||
<!-- What are the changes this PR brings about? --> | ||
<!-- Example: This PR adds a PR template to the repo. --> | ||
<!-- (For bigger PRs adding more context is appreciated) --> | ||
|
||
## Why ❔ | ||
|
||
<!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> | ||
<!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> | ||
|
||
## Checklist | ||
|
||
<!-- Check your PR fulfills the following items. --> | ||
<!-- For draft PRs check the boxes as you complete them. --> | ||
|
||
- [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). | ||
- [ ] Tests for the changes have been added / updated. | ||
- [ ] Documentation comments have been added / updated. | ||
- [ ] Code has been formatted via `zk fmt` and `zk lint`. |
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,8 @@ | ||
name: Cargo license check | ||
on: pull_request | ||
jobs: | ||
cargo-deny: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: EmbarkStudios/cargo-deny-action@v1 |
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,80 @@ | ||
name: "Rust CI" | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: cargo build | ||
runs-on: [ubuntu-22.04-github-hosted-32core] | ||
strategy: | ||
matrix: | ||
cuda: [ "12.0.0-devel-ubuntu20.04", "12.5.0-devel-ubuntu20.04" ] | ||
container: | ||
image: nvidia/cuda:${{ matrix.cuda }} | ||
env: | ||
BELLMAN_CUDA_DIR: ${{ github.workspace }}/bellman-cuda | ||
CUDAARCHS: 89 | ||
steps: | ||
- name: Prepare environment | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
apt update && apt install -y \ | ||
pkg-config libclang-dev build-essential lldb lld \ | ||
clang openssl libssl-dev gcc g++ wget curl jq | ||
echo "/usr/local/nvidia/bin:/usr/local/cuda/bin" >> $GITHUB_PATH | ||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3 | ||
|
||
- name: Setup rustup | ||
run: | | ||
wget -q -O - https://sh.rustup.rs | bash -s -- -y | ||
echo "${HOME}/.cargo/bin" >> "${GITHUB_PATH}" | ||
echo "export PATH=\"$HOME/.cargo/bin:\$PATH\"" >> "${HOME}/.bash_profile" | ||
- name: Setup CMake | ||
run: | | ||
curl -LO https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.sh && \ | ||
chmod +x cmake-3.24.3-linux-x86_64.sh && \ | ||
./cmake-3.24.3-linux-x86_64.sh --skip-license --prefix=/usr/local | ||
- name: Check CMake version | ||
run: | | ||
cmake --version | ||
- name: Check CUDA version | ||
run: | | ||
nvcc --version | ||
- name: Setup rust | ||
run: | | ||
rustup set profile minimal | ||
rustup toolchain install nightly-2024-08-01 | ||
rustup default nightly-2024-08-01 | ||
- name: Prepare bellman-cuda directory | ||
shell: bash | ||
# Curl ugliness is required because gh can't work with authentication: https://github.com/cli/cli/issues/2680. | ||
run: | | ||
release=($(curl --silent https://api.github.com/repos/matter-labs/era-bellman-cuda/releases | jq -r '.[0] | .name, .tarball_url, .assets[0].browser_download_url')) | ||
curl --silent -L "${release[1]}" --output bellman-cuda-source.tar.gz | ||
curl --silent -L "${release[2]}" --output bellman-cuda.tar.gz | ||
mkdir -p bellman-cuda | ||
tar xvfz bellman-cuda.tar.gz -C ./bellman-cuda | ||
tar xvfz bellman-cuda-source.tar.gz -C ./bellman-cuda --strip-components=1 --wildcards \*/src/ | ||
# TODO: Right now we run tests in a separate workflow on the GPU runners, | ||
# and only for some packages, since presumably `gpu-ffi` or `gpu-prover` crates | ||
# are causing link-time errors when compiled with `--tests`. | ||
- run: cargo build --verbose | ||
|
||
formatting: | ||
name: cargo fmt | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rustfmt | ||
- name: Rustfmt Check | ||
uses: actions-rust-lang/rustfmt@v1 |
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,144 @@ | ||
name: Test on GPU | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
zksync-crypto-gpu-build: | ||
runs-on: [ ubuntu-latest ] | ||
strategy: | ||
matrix: | ||
cuda: [ "12.0.0-devel-ubuntu20.04", "12.5.0-devel-ubuntu20.04" ] | ||
# TODO: Building the whole workspace with `--test` currently fails with link-time errors, | ||
# presumably due to either `gpu-ffi` or `gpu-prover` crates. | ||
# So for now we point at specific packages we want to test. | ||
package: [ "era_cudart", "boojum-cuda", "shivini" ] | ||
container: | ||
image: nvidia/cuda:${{ matrix.cuda }} | ||
env: | ||
BELLMAN_CUDA_DIR: ${{ github.workspace }}/bellman-cuda | ||
steps: | ||
- name: Prepare environment | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
apt update && apt install -y \ | ||
pkg-config libclang-dev build-essential lldb lld \ | ||
clang openssl libssl-dev gcc g++ wget curl jq | ||
echo "/usr/local/nvidia/bin:/usr/local/cuda/bin" >> $GITHUB_PATH | ||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3 | ||
|
||
- name: Setup rustup | ||
run: | | ||
wget -q -O - https://sh.rustup.rs | bash -s -- -y | ||
echo "${HOME}/.cargo/bin" >> "${GITHUB_PATH}" | ||
echo "export PATH=\"$HOME/.cargo/bin:\$PATH\"" >> "${HOME}/.bash_profile" | ||
- name: Setup CMake | ||
run: | | ||
curl -LO https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.sh && \ | ||
chmod +x cmake-3.24.3-linux-x86_64.sh && \ | ||
./cmake-3.24.3-linux-x86_64.sh --skip-license --prefix=/usr/local | ||
- name: Prepare bellman-cuda directory | ||
shell: bash | ||
# Curl ugliness is required because gh can't work with authentication: https://github.com/cli/cli/issues/2680. | ||
run: | | ||
release=($(curl --silent https://api.github.com/repos/matter-labs/era-bellman-cuda/releases | jq -r '.[0] | .name, .tarball_url, .assets[0].browser_download_url')) | ||
curl --silent -L "${release[1]}" --output bellman-cuda-source.tar.gz | ||
curl --silent -L "${release[2]}" --output bellman-cuda.tar.gz | ||
mkdir -p bellman-cuda | ||
tar xvfz bellman-cuda.tar.gz -C ./bellman-cuda | ||
tar xvfz bellman-cuda-source.tar.gz -C ./bellman-cuda --strip-components=1 --wildcards \*/src/ | ||
- name: Check CMake version | ||
run: | | ||
cmake --version | ||
- name: Check CUDA version | ||
run: | | ||
nvcc --version | ||
- name: Setup rust | ||
run: | | ||
rustup set profile minimal | ||
rustup toolchain install nightly-2024-08-01 | ||
rustup default nightly-2024-08-01 | ||
- name: Build tests and copy binaries to a separate dir | ||
shell: bash | ||
run: | | ||
mkdir artifacts | ||
CUDAARCHS=80 CARGO_TARGET_DIR=./build \ | ||
cargo +nightly-2024-08-01 test -p ${{ matrix.package }} --no-run --release --message-format=json -q \ | ||
| jq -r 'select(.executable != null) | .executable' \ | ||
| while read binary; do | ||
cp "$binary" artifacts/ | ||
done | ||
- name: Upload test binaries as a single artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: zksync-crypto-gpu-${{ matrix.cuda }}-test-binaries | ||
path: artifacts/ | ||
if-no-files-found: error | ||
|
||
zksync-crypto-gpu-test: | ||
runs-on: [ matterlabs-ci-gpu-runner ] | ||
needs: zksync-crypto-gpu-build | ||
env: | ||
BELLMAN_CUDA_DIR: ${{ github.workspace }}/bellman-cuda | ||
steps: | ||
- name: Prepare environment | ||
run: | | ||
echo "/usr/local/nvidia/bin:/usr/local/cuda/bin" >> $GITHUB_PATH | ||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3 | ||
|
||
- name: Check Nvidia driver version | ||
run: | | ||
nvidia-smi | ||
- name: Prepare bellman-cuda directory | ||
shell: bash | ||
# Curl ugliness is required because gh can't work with authentication: https://github.com/cli/cli/issues/2680. | ||
run: | | ||
release=($(curl --silent https://api.github.com/repos/matter-labs/era-bellman-cuda/releases | jq -r '.[0] | .name, .tarball_url, .assets[0].browser_download_url')) | ||
curl --silent -L "${release[1]}" --output bellman-cuda-source.tar.gz | ||
curl --silent -L "${release[2]}" --output bellman-cuda.tar.gz | ||
mkdir -p bellman-cuda | ||
tar xvfz bellman-cuda.tar.gz -C ./bellman-cuda | ||
tar xvfz bellman-cuda-source.tar.gz -C ./bellman-cuda --strip-components=1 --wildcards \*/src/ | ||
- name: Download test binaries built with CUDA 12.0 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: zksync-crypto-gpu-12.0.0-devel-ubuntu20.04-test-binaries | ||
path: zksync-crypto-gpu-test-binaries/12.0 | ||
|
||
- name: Download test binaries built with CUDA 12.5 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: zksync-crypto-gpu-12.5.0-devel-ubuntu20.04-test-binaries | ||
path: zksync-crypto-gpu-test-binaries/12.5 | ||
|
||
- name: Run test binaries built with CUDA 12.5 | ||
id: test_cuda_12_5 | ||
continue-on-error: true | ||
run: | | ||
for binary in zksync-crypto-gpu-test-binaries/12.5/*; do | ||
chmod +x $binary | ||
$binary | ||
done | ||
- name: Run test binaries built with CUDA 12.0 | ||
if: steps.test_cuda_12_5.outcome == 'failure' || steps.test_cuda_12_5.outcome == 'success' | ||
run: | | ||
for binary in zksync-crypto-gpu-test-binaries/12.0/*; do | ||
chmod +x $binary | ||
$binary | ||
done |
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,8 @@ | ||
target | ||
Cargo.lock | ||
.vscode | ||
api-testing/src/data/ | ||
prover-service/data | ||
.idea | ||
**/*.rs.bk | ||
**/*.ncu-rep |
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,5 @@ | ||
[workspace] | ||
members = [ | ||
"crates/*" | ||
] | ||
resolver = "2" |
Oops, something went wrong.