Skip to content

Commit d8dee38

Browse files
VitaliiHVitaliiH
authored andcommitted
comment extra printing
1 parent 5a7f235 commit d8dee38

File tree

9 files changed

+65
-72
lines changed

9 files changed

+65
-72
lines changed

crates/prover/src/constraint_framework/component.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ impl<E: FrameworkEval + Sync> ComponentProver<SimdBackend> for FrameworkComponen
263263
let trace_domain = CanonicCoset::new(self.eval.log_size());
264264
nvtx_timed_pop!();
265265

266+
//println!("trace: {:?}", trace);
267+
266268
nvtx_timed!("component_polys");
267269
let mut component_polys = trace.polys.sub_tree(&self.trace_locations);
268270
component_polys[PREPROCESSED_TRACE_IDX] = self

crates/prover/src/core/air/components.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ impl<B: Backend> ComponentProvers<'_, B> {
140140
random_coeff: SecureField,
141141
trace: &Trace<'_, B>,
142142
) -> SecureCirclePoly<B> {
143+
//println!("trace: {:?}", trace);
144+
143145
nvtx_timed!("total_constraints");
144146
let start = std::time::Instant::now();
145147
let total_constraints: usize = self.components.iter().map(|c| c.n_constraints()).sum();

crates/prover/src/core/backend/icicle/blake2s.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl MerkleOps<Blake2sMerkleHasher> for IcicleBackend {
150150
prev_layer: Option<&Col<Self, <Blake2sMerkleHasher as MerkleHasher>::Hash>>,
151151
columns: &[&Col<Self, BaseField>],
152152
) -> Col<Self, <Blake2sMerkleHasher as MerkleHasher>::Hash> {
153-
nvtx_timed!("[ICICLE] Extract prev_layer");
153+
//nvtx_timed!("[ICICLE] Extract prev_layer");
154154
let prev_layer = match prev_layer {
155155
Some(layer) => layer,
156156
// Hacky, since creating a DeviceVec of size 0 seems to not work
@@ -160,22 +160,22 @@ impl MerkleOps<Blake2sMerkleHasher> for IcicleBackend {
160160
&<Col<Self, <Blake2sMerkleHasher as MerkleHasher>::Hash> as Column<Blake2sHash>>::uninitialized(1)
161161
},
162162
};
163-
nvtx_timed_pop!();
163+
//nvtx_timed_pop!();
164164

165-
nvtx_timed!("[ICICLE] Create matrices");
165+
//nvtx_timed!("[ICICLE] Create matrices");
166166
let mut columns_as_matrices = vec![];
167167
for &col in columns {
168168
let col_as_slice = col.data[..].as_slice();
169169
columns_as_matrices.push(Matrix::from_slice(&col_as_slice, 4, col.len()));
170170
}
171-
nvtx_timed_pop!();
171+
//nvtx_timed_pop!();
172172

173-
nvtx_timed!("[ICICLE] Cuda malloc digests");
173+
//nvtx_timed!("[ICICLE] Cuda malloc digests");
174174
let digests_bytes = (1 << log_size) * 32;
175175
let mut d_digests_slice = DeviceVec::cuda_malloc(digests_bytes).unwrap();
176-
nvtx_timed_pop!();
176+
//nvtx_timed_pop!();
177177

178-
nvtx_timed!("[ICICLE] cuda commit layer");
178+
//nvtx_timed!("[ICICLE] cuda commit layer");
179179
blake2s_commit_layer(
180180
&(unsafe { transmute::<&DeviceVec<Blake2sHash>, &DeviceVec<u8>>(&prev_layer.data) })[..],
181181
true,
@@ -185,7 +185,7 @@ impl MerkleOps<Blake2sMerkleHasher> for IcicleBackend {
185185
1 << log_size,
186186
&mut d_digests_slice[..],
187187
).unwrap();
188-
nvtx_timed_pop!();
188+
//nvtx_timed_pop!();
189189

190190
DeviceColumnBlake {
191191
data: unsafe { transmute(d_digests_slice) },

crates/prover/src/core/backend/icicle/circle.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl PolyOps for IcicleBackend {
6464
initialize_dcct_domain(eval.domain.log_size(), rou, &DeviceContext::default()).unwrap();
6565
// nvtx_timed_pop!();
6666
let eval_values = unsafe { transmute::<&DeviceSlice<BaseField>, &DeviceSlice<ScalarField>>(&eval.values.data[..]) };
67-
println!("interpolate domain size: {} vals len {:?}", eval.domain.size(), eval_values.len());
67+
//println!("interpolate domain size: {} vals len {:?}", eval.domain.size(), eval_values.len());
6868
let mut coeffs = unsafe { DeviceColumn::uninitialized(eval_values.len()) };
6969
let mut coeffs_data = unsafe { transmute::<&mut DeviceSlice<BaseField>, &mut DeviceSlice<ScalarField>>(&mut coeffs.data[..]) };
7070

@@ -83,6 +83,12 @@ impl PolyOps for IcicleBackend {
8383
}
8484

8585
fn eval_at_point(poly: &CirclePoly<Self>, point: CirclePoint<SecureField>) -> SecureField {
86+
//println!("fold poly.coeffs len {}", poly.coeffs.len());
87+
// if poly.coeffs.len() == 64 {
88+
// let trace = std::backtrace::Backtrace::capture();
89+
// println!("Backtrace:\n{}", trace);
90+
// }
91+
8692
// todo!()
8793
// unsafe { CpuBackend::eval_at_point(transmute(poly), point) }
8894
if poly.log_size() == 0 {
@@ -99,12 +105,6 @@ impl PolyOps for IcicleBackend {
99105
mappings.reverse();
100106
// nvtx_timed_pop!();
101107

102-
println!("fold poly.coeffs len {}", poly.coeffs.len());
103-
if poly.coeffs.len() == 64 {
104-
let trace = std::backtrace::Backtrace::capture();
105-
println!("Backtrace:\n{}", trace);
106-
}
107-
108108
// nvtx_timed!("[ICICLE] fold");
109109
let folded = crate::core::backend::icicle::utils::fold::<BaseField, SecureField>(&poly.coeffs, &mappings);
110110
// nvtx_timed_pop!();
@@ -148,7 +148,7 @@ impl PolyOps for IcicleBackend {
148148
// let mut evaluations = vec![ScalarField::zero(); values.len()];
149149
let mut evaluations = DeviceColumn { data: DeviceVec::cuda_malloc(values.len()).unwrap()};
150150

151-
println!("evaluate domain size: {} vals len {:?}", domain.size(), values.len());
151+
//println!("evaluate domain size: {} vals len {:?}", domain.size(), values.len());
152152

153153
let mut cfg = NTTConfig::default();
154154
cfg.ordering = Ordering::kNM;

crates/prover/src/core/backend/icicle/fri.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl FriOps for IcicleBackend {
3737

3838
let dom_vals_len = length / 2;
3939

40-
nvtx_timed!("[ICICLE] domain evals convert + move");
40+
//nvtx_timed!("[ICICLE] domain evals convert + move");
4141
let eval1: &DeviceSlice<BaseField> = eval.values.columns[0].data.deref();
4242
let eval2: &DeviceSlice<BaseField> = eval.values.columns[1].data.deref();
4343
let eval3: &DeviceSlice<BaseField> = eval.values.columns[2].data.deref();
@@ -50,7 +50,7 @@ impl FriOps for IcicleBackend {
5050
unsafe { transmute::<&DeviceSlice<BaseField>, &DeviceSlice<ScalarField>>(eval3) };
5151
let eval_slice4 =
5252
unsafe { transmute::<&DeviceSlice<BaseField>, &DeviceSlice<ScalarField>>(eval4) };
53-
nvtx_timed_pop!();
53+
//nvtx_timed_pop!();
5454
let mut d_folded_eval =
5555
DeviceVec::<QuarticExtensionField>::cuda_malloc(dom_vals_len).unwrap();
5656

@@ -92,7 +92,7 @@ impl FriOps for IcicleBackend {
9292
)
9393
};
9494

95-
nvtx_timed!("[ICICLE] fold_line");
95+
//nvtx_timed!("[ICICLE] fold_line");
9696
let _ = fri::fold_line_new(
9797
eval_slice1,
9898
eval_slice2,
@@ -108,9 +108,9 @@ impl FriOps for IcicleBackend {
108108
&cfg,
109109
)
110110
.unwrap();
111-
nvtx_timed_pop!();
111+
//nvtx_timed_pop!();
112112

113-
nvtx_timed!("[ICICLE] convert to SecureColumnByCoords");
113+
//nvtx_timed!("[ICICLE] convert to SecureColumnByCoords");
114114
let folded_values = SecureColumnByCoords {
115115
columns: [
116116
icicle_device_result1,
@@ -121,7 +121,7 @@ impl FriOps for IcicleBackend {
121121
};
122122

123123
let line_eval = LineEvaluation::new(domain.double(), folded_values);
124-
nvtx_timed_pop!();
124+
//nvtx_timed_pop!();
125125

126126
line_eval
127127
}
@@ -137,7 +137,7 @@ impl FriOps for IcicleBackend {
137137
let domain = src.domain;
138138
let length = src.values.len();
139139

140-
nvtx_timed!("[ICICLE] d_evals_icicle");
140+
//nvtx_timed!("[ICICLE] d_evals_icicle");
141141
let eval_vec1 = src.columns[0].data.deref();
142142
let eval_vec2 = src.columns[1].data.deref();
143143
let eval_vec3 = src.columns[2].data.deref();
@@ -150,9 +150,9 @@ impl FriOps for IcicleBackend {
150150
unsafe { transmute::<&DeviceSlice<BaseField>, &DeviceSlice<ScalarField>>(eval_vec3) };
151151
let eval4 =
152152
unsafe { transmute::<&DeviceSlice<BaseField>, &DeviceSlice<ScalarField>>(eval_vec4) };
153-
nvtx_timed_pop!();
153+
//nvtx_timed_pop!();
154154

155-
nvtx_timed!("[ICICLE] d_folded_evals");
155+
//nvtx_timed!("[ICICLE] d_folded_evals");
156156
let mut iter = dst.values.columns.iter_mut();
157157
let icicle_device_result_transmuted1: &mut DeviceSlice<BaseField> =
158158
iter.next().unwrap().data.deref_mut();
@@ -183,12 +183,12 @@ impl FriOps for IcicleBackend {
183183
icicle_device_result_transmuted4,
184184
)
185185
};
186-
nvtx_timed_pop!();
186+
//nvtx_timed_pop!();
187187

188188
let cfg = FriConfig::default();
189189
let icicle_alpha = unsafe { transmute(alpha) };
190190

191-
nvtx_timed!("[ICICLE] fold circle");
191+
//nvtx_timed!("[ICICLE] fold circle");
192192
let _ = fold_circle_into_line_new(
193193
eval1,
194194
eval2,
@@ -204,7 +204,7 @@ impl FriOps for IcicleBackend {
204204
&cfg,
205205
)
206206
.unwrap();
207-
nvtx_timed_pop!();
207+
//nvtx_timed_pop!();
208208
}
209209

210210
fn decompose(

crates/prover/src/core/backend/icicle/quotient.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::core::fields::secure_column::SecureColumnByCoords;
1717
use crate::core::pcs::quotients::{ColumnSampleBatch, QuotientOps};
1818
use crate::core::poly::circle::{CircleDomain, CircleEvaluation, SecureEvaluation};
1919
use crate::core::poly::BitReversedOrder;
20-
use crate::{nvtx_timed, nvtx_timed_pop};
20+
// use crate::{nvtx_timed, nvtx_timed_pop};
2121

2222

2323
impl QuotientOps for IcicleBackend {
@@ -45,13 +45,13 @@ impl QuotientOps for IcicleBackend {
4545
.fold(0, |acc, column| acc + column.values.len());
4646
let mut ptr_columns: Vec<*const ScalarField> = Vec::with_capacity(columns.len());
4747
let mut start = 0;
48-
nvtx_timed!("[ICICLE] columns to device");
48+
// nvtx_timed!("[ICICLE] columns to device");
4949
columns.iter().for_each(|column| {
5050
ptr_columns.push(unsafe { transmute(column.values.data.as_ptr()) });
5151
});
52-
nvtx_timed_pop!();
52+
// nvtx_timed_pop!();
5353

54-
nvtx_timed!("[ICICLE] column sample batch");
54+
// nvtx_timed!("[ICICLE] column sample batch");
5555
let icicle_sample_batches: Vec<_> = sample_batches
5656
.into_iter()
5757
.map(|sample| {
@@ -73,11 +73,11 @@ impl QuotientOps for IcicleBackend {
7373
})
7474
.collect();
7575
let icicle_internal_sample_batches = to_internal_column_batch(&icicle_sample_batches);
76-
nvtx_timed_pop!();
76+
// nvtx_timed_pop!();
7777

7878
let icicle_columns = HostSlice::from_slice(&ptr_columns);
7979

80-
nvtx_timed!("[ICICLE] allocate accumualtion results");
80+
// nvtx_timed!("[ICICLE] allocate accumualtion results");
8181
let stream1 = CudaStream::create().unwrap();
8282
let mut icicle_device_result1 = unsafe { DeviceColumn::uninitialized_async(domain.size(), &stream1) };
8383
let stream2 = CudaStream::create().unwrap();
@@ -105,11 +105,11 @@ impl QuotientOps for IcicleBackend {
105105
icicle_device_result3.data.deref_mut();
106106
let icicle_device_result_transmuted4: &mut DeviceSlice<BaseField> =
107107
icicle_device_result4.data.deref_mut();
108-
nvtx_timed_pop!();
108+
// nvtx_timed_pop!();
109109

110110
let mut cfg = QuotientConfig::default();
111111

112-
nvtx_timed!("[ICICLE] accumulate_quotients_wrapped");
112+
// nvtx_timed!("[ICICLE] accumulate_quotients_wrapped");
113113
quotient::accumulate_quotients_wrapped(
114114
domain.log_size() as u32,
115115
icicle_columns,
@@ -137,17 +137,17 @@ impl QuotientOps for IcicleBackend {
137137
},
138138
&cfg,
139139
);
140-
nvtx_timed_pop!();
140+
// nvtx_timed_pop!();
141141

142-
nvtx_timed!("[ICICLE] res to SecureEvaluation");
142+
// nvtx_timed!("[ICICLE] res to SecureEvaluation");
143143
let res_vec = [
144144
icicle_device_result1,
145145
icicle_device_result2,
146146
icicle_device_result3,
147147
icicle_device_result4,
148148
];
149149
let result = SecureColumnByCoords { columns: res_vec };
150-
nvtx_timed_pop!();
150+
// nvtx_timed_pop!();
151151

152152
SecureEvaluation::new(domain, result)
153153
}

crates/prover/src/core/backend/simd/circle.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl PolyOps for SimdBackend {
156156
let twiddles = domain_line_twiddles_from_tree(eval.domain, &twiddles.itwiddles);
157157
// nvtx_timed_pop!();
158158

159-
println!("interpolate domain size: {} vals len {:?}", eval.domain.size(), values.len());
159+
//println!("interpolate domain size: {} vals len {:?}", eval.domain.size(), values.len());
160160

161161

162162
// Safe because [PackedBaseField] is aligned on 64 bytes.
@@ -180,18 +180,17 @@ impl PolyOps for SimdBackend {
180180
}
181181

182182
fn eval_at_point(poly: &CirclePoly<Self>, point: CirclePoint<SecureField>) -> SecureField {
183+
//println!("fold poly.coeffs len {}", poly.coeffs.len());
184+
// if poly.coeffs.len() == 64 {
185+
// let trace = std::backtrace::Backtrace::capture();
186+
// println!("Backtrace:\n{}", trace);
187+
// }
183188
// If the polynomial is small, fallback to evaluate directly.
184189
// TODO(Ohad): it's possible to avoid falling back. Consider fixing.
185190
if poly.log_size() <= 8 {
186191
return slow_eval_at_point(poly, point);
187192
}
188193

189-
println!("fold poly.coeffs len {}", poly.coeffs.len());
190-
if poly.coeffs.len() == 64 {
191-
let trace = std::backtrace::Backtrace::capture();
192-
println!("Backtrace:\n{}", trace);
193-
}
194-
195194
// nvtx_timed!("[SIMD] generate mappings");
196195
let mappings = Self::generate_evaluation_mappings(point, poly.log_size());
197196
// nvtx_timed_pop!();
@@ -263,7 +262,7 @@ impl PolyOps for SimdBackend {
263262
"Can only evaluate on larger domains"
264263
);
265264

266-
println!("evaluate domain size: {} vals len {:?}", domain.size(), poly.coeffs.len());
265+
//println!("evaluate domain size: {} vals len {:?}", domain.size(), poly.coeffs.len());
267266

268267
if fft_log_size < MIN_FFT_LOG_SIZE {
269268
let cpu_poly: CirclePoly<CpuBackend> = CirclePoly::new(poly.coeffs.to_cpu());

crates/prover/src/core/fri.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,22 +229,22 @@ impl<'a, B: FriOps + MerkleOps<MC::H>, MC: MerkleChannel> FriProver<'a, B, MC> {
229229
while layer_evaluation.len() > config.last_layer_domain_size() {
230230
// Check for circle polys in the first layer that should be combined in this layer.
231231
while let Some(column) = columns.next_if(|c| folded_size(c) == layer_evaluation.len()) {
232-
nvtx_timed!("fold circle");
232+
//nvtx_timed!("fold circle");
233233
B::fold_circle_into_line(
234234
&mut layer_evaluation,
235235
column,
236236
circle_poly_folding_alpha,
237237
twiddles,
238238
);
239-
nvtx_timed_pop!();
239+
//nvtx_timed_pop!();
240240
}
241241

242242
let layer = FriInnerLayerProver::new(layer_evaluation);
243243
MC::mix_root(channel, layer.merkle_tree.root());
244244
let folding_alpha = channel.draw_felt();
245-
nvtx_timed!("fold line");
245+
//nvtx_timed!("fold line");
246246
let folded_layer_evaluation = B::fold_line(&layer.evaluation, folding_alpha, twiddles);
247-
nvtx_timed_pop!();
247+
//nvtx_timed_pop!();
248248

249249
layer_evaluation = folded_layer_evaluation;
250250
layers.push(layer);
@@ -864,12 +864,12 @@ struct FriFirstLayerProver<'a, B: FriOps + MerkleOps<H>, H: MerkleHasher> {
864864

865865
impl<'a, B: FriOps + MerkleOps<H>, H: MerkleHasher> FriFirstLayerProver<'a, B, H> {
866866
fn new(columns: &'a [SecureEvaluation<B, BitReversedOrder>]) -> Self {
867-
nvtx_timed!("extract columns");
867+
//nvtx_timed!("extract columns");
868868
let coordinate_columns = extract_coordinate_columns(columns);
869-
nvtx_timed_pop!();
870-
nvtx_timed!("Merkle commit");
869+
//nvtx_timed_pop!();
870+
//nvtx_timed!("Merkle commit");
871871
let merkle_tree = MerkleProver::commit(coordinate_columns);
872-
nvtx_timed_pop!();
872+
//nvtx_timed_pop!();
873873

874874
FriFirstLayerProver {
875875
columns,
@@ -953,7 +953,7 @@ struct FriInnerLayerProver<B: FriOps + MerkleOps<H>, H: MerkleHasher> {
953953

954954
impl<B: FriOps + MerkleOps<H>, H: MerkleHasher> FriInnerLayerProver<B, H> {
955955
fn new(evaluation: LineEvaluation<B>) -> Self {
956-
nvtx_timed!("Merkle commit");
956+
// nvtx_timed!("Merkle commit");
957957
let merkle_tree = MerkleProver::commit(evaluation.values.columns.iter().collect_vec());
958958
nvtx_timed_pop!();
959959
FriInnerLayerProver {

0 commit comments

Comments
 (0)