diff --git a/src/execute.rs b/src/execute.rs index 6e904a7b7..25652f521 100644 --- a/src/execute.rs +++ b/src/execute.rs @@ -867,7 +867,7 @@ pub(crate) fn calibrate( .load_graph_from_file_exclusively(&chunk) .map_err(|e| format!("failed to load circuit inputs: {}", e))?; - circuit + let forward_res = circuit .calibrate(&data, max_logrows, lookup_safety_margin) .map_err(|e| format!("failed to calibrate: {}", e))?; diff --git a/src/graph/mod.rs b/src/graph/mod.rs index 6953ab48e..9e676557f 100644 --- a/src/graph/mod.rs +++ b/src/graph/mod.rs @@ -26,6 +26,7 @@ use crate::circuit::modules::ModulePlanner; use crate::circuit::table::{Table, RESERVED_BLINDING_ROWS_PAD}; use crate::circuit::{CheckMode, InputType}; use crate::fieldutils::felt_to_f64; +use crate::pfsys::PrettyElements; use crate::tensor::{Tensor, ValTensor}; use crate::RunArgs; use halo2_proofs::{ @@ -1124,7 +1125,7 @@ impl GraphCircuit { lookup_safety_margin: i128, ) -> Result> { let res = self.forward(&mut input.to_vec(), None, None)?; - self.calc_min_logrows(&res, max_logrows)?; + self.calc_min_logrows(&res, max_logrows, lookup_safety_margin)?; Ok(res) } diff --git a/src/graph/model.rs b/src/graph/model.rs index 2438b2280..bff2ac21e 100644 --- a/src/graph/model.rs +++ b/src/graph/model.rs @@ -775,15 +775,20 @@ impl Model { for (i, _) in model.clone().outputs.iter().enumerate() { model.set_output_fact(i, InferenceFact::default())?; } - // Note: do not optimize the model, as the layout will depend on underlying hardware - let mut model = model.into_typed()?.into_decluttered()?; + let mut symbol_values = SymbolValues::default(); for (symbol, value) in run_args.variables.iter() { let symbol = model.symbol_table.sym(symbol); symbol_values = symbol_values.with(&symbol, *value as i64); info!("set {} to {}", symbol, value); } - model = model.concretize_dims(&symbol_values)?; + + // Note: do not optimize the model, as the layout will depend on underlying hardware + let model = model + .into_typed()? + .into_decluttered()? + .concretize_dims(&symbol_values)?; + Ok((model, symbol_values)) }