Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions .github/workflows/test-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,29 @@ jobs:
rustup toolchain install nightly-2024-08-01
rustup default nightly-2024-08-01

- name: Build tests and copy binaries to a separate dir
- name: Build tests and copy binary 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/
cp "$binary" artifacts/${{ matrix.package }}
done

- name: Upload test binaries as a single artifact
uses: actions/upload-artifact@v3
- name: Upload test binary
uses: actions/upload-artifact@v4
with:
name: zksync-crypto-gpu-${{ matrix.cuda }}-test-binaries
path: artifacts/
name: zksync-crypto-gpu-${{ matrix.cuda }}-${{ matrix.package }}-test-binary
path: artifacts/${{ matrix.package }}
if-no-files-found: error

zksync-crypto-gpu-test:
runs-on: [ matterlabs-ci-gpu-runner ]
strategy:
matrix:
package: [ "era_cudart", "boojum-cuda", "shivini" ]
needs: zksync-crypto-gpu-build
env:
BELLMAN_CUDA_DIR: ${{ github.workspace }}/bellman-cuda
Expand All @@ -116,31 +119,27 @@ jobs:
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
- name: Download test binary built with CUDA 12.0
uses: actions/download-artifact@v4
with:
name: zksync-crypto-gpu-12.0.0-devel-ubuntu20.04-test-binaries
path: zksync-crypto-gpu-test-binaries/12.0
name: zksync-crypto-gpu-12.0.0-devel-ubuntu20.04-${{ matrix.package }}-test-binary
path: zksync-crypto-gpu-test-binary/12.0/

- name: Download test binaries built with CUDA 12.5
uses: actions/download-artifact@v3
- name: Download test binary built with CUDA 12.5
uses: actions/download-artifact@v4
with:
name: zksync-crypto-gpu-12.5.0-devel-ubuntu20.04-test-binaries
path: zksync-crypto-gpu-test-binaries/12.5
name: zksync-crypto-gpu-12.5.0-devel-ubuntu20.04-${{ matrix.package }}-test-binary
path: zksync-crypto-gpu-test-binary/12.5/

- name: Run test binaries built with CUDA 12.5
- name: Run test binary 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
chmod +x zksync-crypto-gpu-test-binary/12.5/${{ matrix.package }}
zksync-crypto-gpu-test-binary/12.5/${{ matrix.package }}

- name: Run test binaries built with CUDA 12.0
- name: Run test binary 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
chmod +x zksync-crypto-gpu-test-binary/12.0/${{ matrix.package }}
zksync-crypto-gpu-test-binary/12.0/${{ matrix.package }}
3 changes: 1 addition & 2 deletions crates/boojum-cuda/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ fn main() {
println!("cargo::rustc-cfg=no_cuda");
} else {
use era_cudart_sys::{get_cuda_lib_path, get_cuda_version};
use std::env::var;
let cuda_version =
get_cuda_version().expect("Failed to determine the CUDA Toolkit version.");
if !cuda_version.starts_with("12.") {
println!("cargo::warning=CUDA Toolkit version {cuda_version} detected. This crate is only tested with CUDA Toolkit 12.*.");
}
let cudaarchs = var("CUDAARCHS").unwrap_or("native".to_string());
let cudaarchs = std::env::var("CUDAARCHS").unwrap_or("native".to_string());
let dst = cmake::Config::new("native")
.profile("Release")
.define("CMAKE_CUDA_ARCHITECTURES", cudaarchs)
Expand Down