Skip to content

Commit

Permalink
Feat: use gpu-oriented plonky3 (#2)
Browse files Browse the repository at this point in the history
* use p3-gpu

* use self-hosted ci runner

* use https instead of git url

* use github secret to fetch plonky3-gpu

* Revert "use https instead of git url"

This reverts commit 0b3343f3ece9b920644553e7e6101106ee620351.

* set CARGO_NET_GIT_FETCH_WITH_CLI

* Revert "set CARGO_NET_GIT_FETCH_WITH_CLI"

This reverts commit 7973118c3c221ffb7637750df641631f4562b6c0.

* add sppark deploy key
  • Loading branch information
kunxian-xia authored and Velaciela committed Jan 24, 2025
1 parent 47a0bda commit eeaea33
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 74 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ concurrency:
jobs:
lint:
name: Build
runs-on:
- runs-on=${{ github.run_id }}
- runner=8cpu-linux-arm64
runs-on: [self-hosted,x64,linux,gpu]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Give Github Action access to plonky3-gpu
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: |
${{ secrets.SECRET_FOR_PLONKY3_GPU }}
${{ secrets.SECRET_FOR_SPPARK }}
- name: Run build
run: |
cargo build --verbose
44 changes: 0 additions & 44 deletions .github/workflows/docs.yml

This file was deleted.

11 changes: 8 additions & 3 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ concurrency:
jobs:
lint:
name: Lint
runs-on:
- runs-on=${{ github.run_id }}
- runner=8cpu-linux-arm64
runs-on: [self-hosted,x64,linux,gpu]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Give Github Action access to plonky3-gpu
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: |
${{ secrets.SECRET_FOR_PLONKY3_GPU }}
${{ secrets.SECRET_FOR_SPPARK }}
- name: Run fmt
run: |
cargo fmt --all -- --check
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/stark-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches: ["**"]
paths:
- "crates/stark-backend/**"
- "Cargo.toml"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
Expand All @@ -17,10 +18,7 @@ env:

jobs:
build:
runs-on:
- runs-on=${{ github.run_id }}
- runner=16cpu-linux-arm64

runs-on: [self-hosted,x64,linux,gpu]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -29,6 +27,13 @@ jobs:
cache-on-failure: true
- uses: taiki-e/install-action@nextest

- name: Give Github Action access to plonky3-gpu
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: |
${{ secrets.SECRET_FOR_PLONKY3_GPU }}
${{ secrets.SECRET_FOR_SPPARK }}
- name: Run tests
working-directory: crates/stark-backend
run: |
Expand Down
63 changes: 43 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,48 @@ hex = { version = "0.4.3", default-features = false }
itertools = { version = "0.13.0", default-features = false }
serde = { version = "1.0.201", default-features = false, features = ["derive"] }

[patch."https://github.com/Plonky3/Plonky3.git"]
p3-air = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-field = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-commit = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-matrix = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-baby-bear = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-util = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-challenger = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-dft = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-fri = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-goldilocks = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-keccak = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-keccak-air = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-blake3 = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-mds = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-merkle-tree = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-poseidon2 = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-symmetric = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-uni-stark = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-maybe-rayon = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-bn254-fr = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }
p3-gpu-backend = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu", branch = "openvm-v1" }

# For local development. Add to your `.cargo/config.toml`
# [patch."https://github.com/Plonky3/Plonky3.git"]
# p3-air = { path = "../Plonky3/air" }
# p3-field = { path = "../Plonky3/field" }
# p3-commit = { path = "../Plonky3/commit" }
# p3-matrix = { path = "../Plonky3/matrix" }
# p3-baby-bear = { path = "../Plonky3/baby-bear" }
# p3-util = { path = "../Plonky3/util" }
# p3-challenger = { path = "../Plonky3/challenger" }
# p3-dft = { path = "../Plonky3/dft" }
# p3-fri = { path = "../Plonky3/fri" }
# p3-goldilocks = { path = "../Plonky3/goldilocks" }
# p3-keccak = { path = "../Plonky3/keccak" }
# p3-keccak-air = { path = "../Plonky3/keccak-air" }
# p3-blake3 = { path = "../Plonky3/blake3" }
# p3-mds = { path = "../Plonky3/mds" }
# p3-merkle-tree = { path = "../Plonky3/merkle-tree" }
# p3-poseidon2 = { path = "../Plonky3/poseidon2" }
# p3-symmetric = { path = "../Plonky3/symmetric" }
# p3-uni-stark = { path = "../Plonky3/uni-stark" }
# p3-maybe-rayon = { path = "../Plonky3/maybe-rayon" }
# p3-bn254-fr = { path = "../Plonky3/bn254-fr" }
# p3-air = { path = "../Plonky3-gpu/air" }
# p3-field = { path = "../Plonky3-gpu/field" }
# p3-commit = { path = "../Plonky3-gpu/commit" }
# p3-matrix = { path = "../Plonky3-gpu/matrix" }
# p3-baby-bear = { path = "../Plonky3-gpu/baby-bear" }
# p3-util = { path = "../Plonky3-gpu/util" }
# p3-challenger = { path = "../Plonky3-gpu/challenger" }
# p3-dft = { path = "../Plonky3-gpu/dft" }
# p3-fri = { path = "../Plonky3-gpu/fri" }
# p3-goldilocks = { path = "../Plonky3-gpu/goldilocks" }
# p3-keccak = { path = "../Plonky3-gpu/keccak" }
# p3-keccak-air = { path = "../Plonky3-gpu/keccak-air" }
# p3-blake3 = { path = "../Plonky3-gpu/blake3" }
# p3-mds = { path = "../Plonky3-gpu/mds" }
# p3-merkle-tree = { path = "../Plonky3-gpu/merkle-tree" }
# p3-poseidon2 = { path = "../Plonky3-gpu/poseidon2" }
# p3-symmetric = { path = "../Plonky3-gpu/symmetric" }
# p3-uni-stark = { path = "../Plonky3-gpu/uni-stark" }
# p3-maybe-rayon = { path = "../Plonky3-gpu/maybe-rayon" }
# p3-bn254-fr = { path = "../Plonky3-gpu/bn254-fr" }

0 comments on commit eeaea33

Please sign in to comment.