Skip to content

Commit

Permalink
feat: clear virtual phase0 columns in builder before next phase (#295)
Browse files Browse the repository at this point in the history
* feat: clear virtual phase0 columns in builder before next phase

In prover stage, these columns should never be touched again once they
have been raw assigned. This should save memory before the real phase0
assigned columns are KZG commited (MSM leads to memory spike).

* chore: bump axiom-eth v0.4.3, axiom-query v2.0.17
  • Loading branch information
jonathanpwang committed Apr 30, 2024
1 parent 9dda66d commit a1eaeaf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion axiom-eth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "axiom-eth"
version = "0.4.2"
version = "0.4.3"
authors = ["Intrinsic Technologies"]
license = "MIT"
edition = "2021"
Expand Down
16 changes: 11 additions & 5 deletions axiom-eth/src/utils/component/circuit/comp_circuit_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,16 +360,22 @@ impl<F: Field, C: CoreBuilder<F>, P: PromiseBuilder<F>> Circuit<F>
{
let mut core_builder = self.core_builder.borrow_mut();
let mut promise_builder = self.promise_builder.borrow_mut();
let rlc_builder = self.rlc_builder.borrow_mut();
let mut rlc_builder = self.rlc_builder.borrow_mut();

let mut phase0_layouter = layouter.namespace(|| "raw synthesize phase0");
core_builder.borrow_mut().raw_synthesize_phase0(&config.0, &mut phase0_layouter);
promise_builder.raw_synthesize_phase0(&config.1, &mut phase0_layouter);
rlc_builder.raw_synthesize_phase0(&config.2, phase0_layouter);
}
#[cfg(feature = "halo2-axiom")]
{
layouter.next_phase();

#[cfg(feature = "halo2-axiom")]
{
if rlc_builder.witness_gen_only() {
// To save memory, clear virtual columns in phase0 because they should never be used again
rlc_builder.base.pool(0).threads.clear();
}
drop(rlc_builder);
layouter.next_phase();
}
}
self.rlc_builder
.borrow_mut()
Expand Down
4 changes: 2 additions & 2 deletions axiom-query/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "axiom-query"
version = "2.0.16"
version = "2.0.17"
authors = ["Intrinsic Technologies"]
license = "MIT"
edition = "2021"
Expand Down Expand Up @@ -35,7 +35,7 @@ rand = "0.8"
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] }

# halo2, features turned on by axiom-eth
axiom-eth = { version = "=0.4.2", path = "../axiom-eth", default-features = false, features = ["providers", "aggregation", "evm"] }
axiom-eth = { version = "0.4.3", path = "../axiom-eth", default-features = false, features = ["providers", "aggregation", "evm"] }
axiom-codec = { version = "0.2.1", path = "../axiom-codec", default-features = false }

# crypto
Expand Down

0 comments on commit a1eaeaf

Please sign in to comment.