Skip to content

Commit e4711f4

Browse files
authored
fix(gpu_prover): fix swapped tree cache mode in allocate_only_evaluation, disable setup recomputations (#173)
## What ❔ This PR fixes a bug that caused unnecessary allocations. This PR also disables setup coset re-computations. ## Why ❔ The bug cause additional unnecessary allocations, because of memory issues we enabled setup re-computations previously, with this fix we can disable them again, getting a 5-10 % raw proving performance boost. ## Is this a breaking change? - [ ] Yes - [x] No ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Code has been formatted.
1 parent 1390243 commit e4711f4

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

gpu_prover/src/execution/gpu_worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn gpu_worker(
128128
circuit,
129129
log_lde_factor,
130130
log_tree_cap_size,
131-
true,
131+
false,
132132
setup_trees_and_caps,
133133
&context,
134134
)?;

gpu_prover/src/prover/proof.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ pub fn prove<'a, A: GoodAllocator>(
124124
setup_range.start(stream)?;
125125
setup.ensure_is_extended(context)?;
126126
setup_range.end(stream)?;
127+
#[cfg(feature = "log_gpu_mem_usage")]
128+
context.log_gpu_mem_usage("after setup.ensure_is_extended");
127129

128130
let mut stage_1_output = StageOneOutput::allocate_trace_holders(
129131
&circuit,

gpu_prover/src/prover/trace_holder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@ impl<T> TraceHolder<T> {
363363
false => CosetsHolder::Full(vec![evaluations]),
364364
};
365365
let trees = match trees_cache_mode {
366-
TreesCacheMode::CacheNone => TreesHolder::Full(vec![]),
366+
TreesCacheMode::CacheNone => TreesHolder::None,
367367
TreesCacheMode::CachePatrial => unimplemented!(),
368-
TreesCacheMode::CacheFull => TreesHolder::None,
368+
TreesCacheMode::CacheFull => TreesHolder::Full(vec![]),
369369
};
370370
Ok(Self {
371371
log_domain_size,

0 commit comments

Comments
 (0)