Skip to content

Commit

Permalink
improve gpu perf and add CI for icicle
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-a16z committed Dec 2, 2024
1 parent 1a38fa8 commit 4c0a59c
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 198 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
with:
command: clippy
args: --all
- name: cargo clippy icicle
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --features icicle

machete:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -77,6 +82,23 @@ jobs:
- name: Run jolt-core tests
run: cargo nextest run --release -p jolt-core

test-icicle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cache Jolt RISC-V Rust toolchain
uses: actions/cache@v4
with:
key: jolt-rust-toolchain-${{hashFiles('guest-toolchain-tag')}}
path: ~/.jolt
- name: Install Jolt RISC-V Rust toolchain
run: cargo run install-toolchain
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Run jolt-core tests
run: cargo nextest run --release -p jolt-core --features icicle

on-chain:
name: Onchain Verifier Tests
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions jolt-core/benches/msm_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rand_core::{RngCore, SeedableRng};
#[cfg(feature = "icicle")]
use rayon::prelude::*;

const SRS_SIZE: usize = 1 << 12;
const SRS_SIZE: usize = 1 << 14;

// Sets up the benchmark
fn setup_bench<PCS, F, ProofTranscript>(
Expand Down Expand Up @@ -143,8 +143,8 @@ struct BatchConfig {
fn main() {
let mut criterion = Criterion::default()
.configure_from_args()
.sample_size(20)
.warm_up_time(std::time::Duration::from_secs(5));
.sample_size(10)
.warm_up_time(std::time::Duration::from_secs(10));
benchmark_msm_batch::<Zeromorph<Bn254, KeccakTranscript>, Fr, KeccakTranscript>(
&mut criterion,
"VariableBaseMSM::msm_batch(bias: Large)",
Expand Down
5 changes: 4 additions & 1 deletion jolt-core/src/jolt/vm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ where
max_memory_address: usize,
max_trace_length: usize,
) -> JoltPreprocessing<C, F, PCS, ProofTranscript> {
//TODO(sagar): This should be moved to a more appropriate place - icicle makes a network request
// which impacts prover time.
icicle::icicle_init();

let bytecode_commitment_shapes = BytecodeProof::<F, PCS, ProofTranscript>::commit_shapes(
max_bytecode_size,
max_trace_length,
Expand Down Expand Up @@ -401,7 +405,6 @@ where
println!("Trace length: {}", trace_length);

JoltTraceStep::pad(&mut trace);
icicle::icicle_init();

let mut transcript = ProofTranscript::new(b"Jolt transcript");
Self::fiat_shamir_preamble(
Expand Down
Loading

0 comments on commit 4c0a59c

Please sign in to comment.