Skip to content

Commit

Permalink
fix: Fix shard_batch_size = 0 support and re-add the cycle count pr…
Browse files Browse the repository at this point in the history
…int for execution (#163)

* refactor: reinstate shard_batch_size

Restore the ability to run the entire process in one chunk by setting `SHARD_BATCH_SIZE` to `0`.

Fixes #160

* feat: Print summary at end of execution

---------

Co-authored-by: François Garillot <francois@garillot.net>
Co-authored-by: wwared <541936+wwared@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 26, 2024
1 parent 062a840 commit d392acc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,10 @@ impl<'a> Runtime<'a> {
self.emit_events = false;
self.print_report = true;
while !self.execute()? {}

// Print the summary.
tracing::info!("summary: cycles={}", self.state.global_clk,);

Ok(())
}

Expand Down
7 changes: 6 additions & 1 deletion prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,12 @@ impl SphinxProver {
);

let mut reduce_proofs = Vec::new();
let shard_batch_size = opts.recursion_opts.shard_batch_size;
// We want the ability to set SHARD_BATCH_SIZE to 0 to run everything in one chunk
let shard_batch_size = if opts.recursion_opts.shard_batch_size > 0 {
opts.recursion_opts.shard_batch_size
} else {
usize::MAX
};
for inputs in core_inputs.chunks(shard_batch_size) {
let proofs = inputs
.into_par_iter()
Expand Down

0 comments on commit d392acc

Please sign in to comment.