Skip to content

Commit db84f47

Browse files
zhenfeizhangzhiyong1997mcfx
authored
update main to v0.0.4 (#126)
* code refactor (#115) * wip * refactor eq poly * wip * fix tests * wip * wip * minor refactoring * wip * simplify proof * more refactoring * wip * wip * more edits * wip * bench polynomials * wip * improving polynomial * fmt * ping specific version of openmpi * fix ci * commit cargo lock * try fix * try again * Update ci.yml * Update ci.yml * clean up * lint * Zz/fix poseidon witnesses (#118) * fix poseidon witnesses * wip * fix all binaries * add e2e CI * use 7950x3d * fix circuit * update ci * mpi chunk size * clippy * update branch for scripts (#120) * Mpi chunk size (#121) * mpi chunk size * clippy * fix a correctness problem * fix a problem in mpi chunk size * Fix expander-exec (#122) * fix expander-exec * fix * Update readme.md --------- Co-authored-by: zhenfei <[email protected]> * fix mpi (#124) * fix mpi * add tests in e2e * fix * optimize expander eq * minor --------- Signed-off-by: Zhiyong Fang <[email protected]> Co-authored-by: Zhiyong Fang <[email protected]> Co-authored-by: mcfx <[email protected]>
1 parent b577acb commit db84f47

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4821
-1449
lines changed

.github/workflows/benchmarks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: cargo install cargo-criterion
3030
- name: Install mpi
3131
run: python3 ./scripts/install.py
32-
- name: setup
32+
- name: Setup
3333
run: cargo run --bin=dev-setup --release
3434
- name: Run benchmark
3535
run: RUSTFLAGS="-C target-cpu=native" cargo criterion --message-format=json > benchmark_results.json

.github/workflows/ci.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,21 @@ jobs:
3434
- uses: actions/checkout@v4
3535
- uses: dtolnay/rust-toolchain@stable
3636
- uses: Swatinem/rust-cache@v2
37+
with:
38+
# The prefix cache key, this can be changed to start a new cache manually.
39+
prefix-key: "mpi-v5.0.5" # update me if brew formula changes to a new version
3740
- name: Set RUSTFLAGS for AVX
3841
if: matrix.feature != ''
39-
run: echo "RUSTFLAGS=$RUSTFLAGS -C target-feature=+${{ matrix.feature }}" >> $GITHUB_ENV
42+
run: echo "RUSTFLAGS=$RUSTFLAGS -C target-feature=+${{ matrix.feature }}" >> $GITHUB_ENV
4043
- name: Build and Test
4144
run: |
4245
python3 ./scripts/install.py
46+
mpiexec --version
4347
cargo run --bin=dev-setup --release
4448
cargo build --all-features --release
4549
cargo test --all-features --release --workspace
4650
47-
benchmark:
51+
gkr-e2e:
4852
name: Benchmark (${{ matrix.os }}${{ matrix.feature != '' && format(', {0}', matrix.feature) || '' }}, ${{ matrix.field }})
4953
runs-on: ${{ matrix.os }}
5054
strategy:
@@ -78,6 +82,9 @@ jobs:
7882
- uses: actions/checkout@v4
7983
- uses: dtolnay/rust-toolchain@stable
8084
- uses: Swatinem/rust-cache@v2
85+
with:
86+
# The prefix cache key, this can be changed to start a new cache manually.
87+
prefix-key: "mpi-v5.0.5" # update me if brew formula changes to a new version
8188
- name: Set RUSTFLAGS for AVX
8289
if: matrix.feature != ''
8390
run: echo "RUSTFLAGS=$RUSTFLAGS -C target-feature=+${{ matrix.feature }}" >> $GITHUB_ENV

.github/workflows/nightly_e2e.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: E2E Tests
2+
3+
on:
4+
schedule:
5+
# This will run the workflow every day at 2:00 AM UTC
6+
- cron: '0 2 * * *'
7+
8+
pull_request:
9+
branches:
10+
# not to be run on DEV branch to save resources
11+
- main
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
jobs:
17+
build-and-test:
18+
runs-on: 7950x3d
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Set up Rust
24+
uses: dtolnay/rust-toolchain@stable
25+
- uses: Swatinem/rust-cache@v2
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: '^1.16'
31+
32+
- name: Run tests
33+
run: |
34+
mkdir -p tmp/data
35+
cd tmp
36+
37+
# ECC part
38+
git clone https://github.com/PolyhedraZK/ExpanderCompilerCollection.git
39+
cd ExpanderCompilerCollection
40+
git switch dev
41+
cargo test --release
42+
cp expander_compiler/*.txt ../data
43+
44+
go run ecgo/examples/poseidon_m31/main.go
45+
cp *.txt ../data
46+
47+
cd ../
48+
49+
# Expander part
50+
git clone https://github.com/PolyhedraZK/Expander.git
51+
cd Expander
52+
git switch dev
53+
54+
mkdir data
55+
mv ../data/*.txt data/
56+
ls -l data
57+
58+
# Run local tests
59+
RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" cargo +nightly run --release --bin=gkr -- -s keccak -f gf2ext128 -t 16
60+
RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" cargo +nightly run --release --bin=gkr -- -s keccak -f m31ext3 -t 16
61+
RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" cargo +nightly run --release --bin=gkr -- -s keccak -f fr -t 16
62+
RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" cargo +nightly run --release --bin=gkr -- -s poseidon -f m31ext3 -t 16
63+
64+
# # Run MPI tests
65+
# RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" mpiexec -n 2 cargo +nightly run --release --bin=gkr-mpi -- -s keccak -f gf2ext128
66+
# RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" mpiexec -n 2 cargo +nightly run --release --bin=gkr-mpi -- -s keccak -f m31ext3
67+
# RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" mpiexec -n 2 cargo +nightly run --release --bin=gkr-mpi -- -s keccak -f fr
68+
# RUSTFLAGS="-C target-cpu=native -C target-feature=+avx512f" mpiexec -n 2 cargo +nightly run --release --bin=gkr-mpi -- -s poseidon -f m31ext3

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ target/
55

66
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
77
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8-
Cargo.lock
8+
# Cargo.lock
99

1010
# These are backup files generated by rustfmt
1111
**/*.rs.bk
@@ -30,6 +30,7 @@ flamegraph.svg
3030
output.txt
3131
.DS_Store
3232
*.log
33+
*.txt
3334

3435
# circuit files
3536
/data/*
@@ -39,4 +40,4 @@ output.txt
3940
/data
4041

4142
# vscode settings
42-
.vscode/
43+
.vscode/

0 commit comments

Comments
 (0)