Skip to content

[WIP] add collapsible for opcode and table prove #680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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