Skip to content

Commit

Permalink
add collapsible for opcode and table prove
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Dec 3, 2024
1 parent 6efe728 commit 0e03834
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ceno_zkvm/src/bin/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ struct Args {
#[arg(long)]
profiling: Option<usize>,

distinct_opcode: bool,

/// The preset configuration to use.
#[arg(short, long, value_enum, default_value_t = Preset::Ceno)]
platform: Preset,
Expand Down Expand Up @@ -73,13 +75,17 @@ fn main() {
.any(|field| metadata.fields().field(&field).is_some())
});

let filter_non_collapsible =
filter_fn(move |metadata| metadata.fields().field("collapsible").is_none());

let fmt_layer = fmt::layer()
.compact()
.with_thread_ids(false)
.with_thread_names(false)
.without_time();

Registry::default()
.with(filter_non_collapsible)
.with(ForestLayer::default())
.with(fmt_layer)
// if some profiling granularity is specified, use the profiling filter,
Expand Down
7 changes: 4 additions & 3 deletions ceno_zkvm/src/scheme/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> ZKVMProver<E, PCS> {
let span = entered_span!(
"commit to iteration",
circuit_name = circuit_name,
profiling_2 = true
profiling_2 = true,
collapsible = true,
);
let witness = match num_instances {
0 => vec![],
Expand Down Expand Up @@ -212,7 +213,7 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> ZKVMProver<E, PCS> {
/// 1: witness layer inferring from input -> output
/// 2: proof (sumcheck reduce) from output to input
#[allow(clippy::too_many_arguments)]
#[tracing::instrument(skip_all, name = "create_opcode_proof", fields(circuit_name=name,profiling_2), level="trace")]
#[tracing::instrument(skip_all, name = "create_opcode_proof", fields(circuit_name=name,profiling_2,collapsible=true), level="trace")]
pub fn create_opcode_proof(
&self,
name: &str,
Expand Down Expand Up @@ -658,7 +659,7 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> ZKVMProver<E, PCS> {
/// support batch prove for logup + product arguments each with different num_vars()
/// side effect: concurrency will be determine based on min(thread, num_vars()),
/// so suggest dont batch too small table (size < threads) with large table together
#[tracing::instrument(skip_all, name = "create_table_proof", fields(table_name=name, profiling_2), level="trace")]
#[tracing::instrument(skip_all, name = "create_table_proof", fields(table_name=name, profiling_2,collapsible=true), level="trace")]
pub fn create_table_proof(
&self,
name: &str,
Expand Down

0 comments on commit 0e03834

Please sign in to comment.