-
Notifications
You must be signed in to change notification settings - Fork 28
feat: Adding GPU test #24
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
443985a
added gpu test
mm-zk 2c5258d
added CI and inline everything in test
mm-zk 36fade7
update cuda to 12.6
mm-zk b83e62e
update gcc version
mm-zk 5f677af
cpp 11
mm-zk d89f01a
update ubuntu
mm-zk 2ab4b92
update even more
mm-zk e254d72
fixes from Robert
mm-zk 0f4d317
added rust toolchain in the test compilation
mm-zk 16daea4
fix gpu running part
mm-zk 30429b3
improve gpu running part
mm-zk 90d4f89
try different runtime
mm-zk 32adfaf
Merge remote-tracking branch 'origin/main' into mmzk_0602_gpu_test
mm-zk 498530b
try with static build
mm-zk d51a61a
try withhout nvidia-smi
mm-zk 9f07bb8
try with 12.5
mm-zk 72c4738
try ubuntu 22
mm-zk 42154b4
added cmake
mm-zk 7a00a9b
re-add curl
mm-zk e493d0a
go back to 24 and 12.6
mm-zk d0a1f6e
try with static compilation
mm-zk 32b233c
don't build static
mm-zk 6c03f90
compile back on 22.04
mm-zk a147d3c
Merge remote-tracking branch 'origin/main' into mmzk_0602_gpu_test
mm-zk c97a4ef
use hashed fibonacci as example
mm-zk 01bb5ca
Merge branch 'main' into mmzk_0602_gpu_test
mm-zk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,129 @@ | ||
| name: Test on GPU | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| zksync-airbender-build: | ||
| runs-on: [ ubuntu-latest ] | ||
| strategy: | ||
| matrix: | ||
| cuda: [ "12.5.0-devel-ubuntu20.04" ] | ||
| package: [ "zksmith" ] | ||
| 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-2025-05-24 | ||
| rustup default nightly-2025-05-24 | ||
|
|
||
| - name: Build tests and copy binary to a separate dir | ||
| shell: bash | ||
| run: | | ||
| mkdir artifacts | ||
| CUDAARCHS=80 CARGO_TARGET_DIR=./build \ | ||
| cargo +nightly-2025-05-24 test -p ${{ matrix.package }} --no-run --release --message-format=json -q \ | ||
| | jq -r 'select(.executable != null) | .executable' \ | ||
| | while read binary; do | ||
| cp "$binary" artifacts/${{ matrix.package }} | ||
| done | ||
|
|
||
| - name: Upload test binary | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: zksync-airbender-${{ matrix.cuda }}-${{ matrix.package }}-test-binary | ||
| path: artifacts/${{ matrix.package }} | ||
| if-no-files-found: error | ||
|
|
||
| zksync-airbender-test: | ||
| runs-on: [ matterlabs-ci-gpu-runner ] | ||
| strategy: | ||
| matrix: | ||
| package: [ "zksmith" ] | ||
| needs: zksync-airbender-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 binary built with CUDA 12.5 | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: zksync-airbender-12.5.0-devel-ubuntu20.04-${{ matrix.package }}-test-binary | ||
| path: zksync-airbender-test-binary/12.5/ | ||
|
|
||
| - name: Run test binary built with CUDA 12.5 | ||
| id: test_cuda_12_5 | ||
| continue-on-error: true | ||
| run: | | ||
| chmod +x zksync-airbender-test-binary/12.5/${{ matrix.package }} | ||
| zksync-airbender-test-binary/12.5/${{ matrix.package }} --nocapture | ||
|
||
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.