Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanting Zhang committed Dec 3, 2023
1 parent 13fe808 commit 6be5215
Show file tree
Hide file tree
Showing 10 changed files with 10,534 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ tempfile = "3.6.0"
camino = "1.1.6"
thiserror = "1.0.44"
tracing = "0.1.37"
tracing-texray = "0.2.0"
tracing-texray = { git = "https://github.com/winston-h-zhang/tracing-texray", branch = "shim" }
tracing-subscriber = "0.3.17"

[[bin]]
Expand Down
1,691 changes: 1,691 additions & 0 deletions benches/dev/600.txt

Large diffs are not rendered by default.

3,132 changes: 3,132 additions & 0 deletions benches/dev/900.txt

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions benches/fibonacci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ use lurk::{
state::State,
};

use tracing_subscriber::{fmt, prelude::*, EnvFilter, Registry};
use tracing_texray::TeXRayLayer;

mod common;
use common::set_bench_config;

Expand Down Expand Up @@ -148,7 +151,8 @@ fn fibonacci_prove<M: measurement::Measurement>(
b.iter_batched(
|| frames,
|frames| {
let result = prover.prove(&pp, frames, &store);
let result = tracing_texray::examine(tracing::info_span!("bang!"))
.in_scope(|| prover.prove(&pp, frames, &store));
let _ = black_box(result);
},
BatchSize::LargeInput,
Expand All @@ -157,14 +161,20 @@ fn fibonacci_prove<M: measurement::Measurement>(
);
}


fn fibonacci_benchmark(c: &mut Criterion) {
// Uncomment to record the logs. May negatively impact performance
//tracing_subscriber::fmt::init();
let subscriber = Registry::default()
.with(fmt::layer().pretty())
.with(EnvFilter::from_default_env())
.with(TeXRayLayer::new().width(120));
tracing::subscriber::set_global_default(subscriber).unwrap();

set_bench_config();
tracing::debug!("{:?}", lurk::config::LURK_CONFIG);

let reduction_counts = rc_env().unwrap_or_else(|_| vec![100]);
let batch_sizes = [100, 200];
let batch_sizes = [249, 374, 499];

let state = State::init_lurk_state().rccell();

Expand All @@ -187,6 +197,8 @@ fn fibonacci_benchmark(c: &mut Criterion) {
}
}

// RUST_LOG=info LURK_RC=600 LURK_PERF=max-parallel-simple cargo criterion --bench fibonacci --features "cuda" 2> ./benches/gpu-spmvm/600.txt
// RUST_LOG=info LURK_RC=900 LURK_PERF=max-parallel-simple cargo criterion --bench fibonacci --features "cuda" 2> ./benches/dev/900.txt
cfg_if::cfg_if! {
if #[cfg(feature = "flamegraph")] {
criterion_group! {
Expand Down
2,540 changes: 2,540 additions & 0 deletions benches/gpu-spmvm/1200.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions benches/gpu-spmvm/600.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Compiling sppark v0.1.5
Compiling pasta-msm v0.1.4 (https://github.com/lurk-lab/pasta-msm?branch=dev#182b971d)
3,149 changes: 3,149 additions & 0 deletions benches/gpu-spmvm/900.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/lem/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ fn build_frames<
let mut pc = 0;
let mut frames = vec![];
let mut iterations = 0;
tracing::info!("{}", &log_fmt(0, &input, &[], store));
tracing::debug!("{}", &log_fmt(0, &input, &[], store));
for _ in 0..limit {
let mut emitted = vec![];
let (frame, must_break) =
compute_frame(lurk_step, cprocs_run, &input, store, lang, &mut emitted, pc)?;

iterations += 1;
input = frame.output.clone();
tracing::info!("{}", &log_fmt(iterations, &input, &emitted, store));
tracing::debug!("{}", &log_fmt(iterations, &input, &emitted, store));
let expr = frame.output[0];
frames.push(frame);

Expand Down
1 change: 1 addition & 0 deletions src/lem/multiframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ impl<'a, F: LurkField, C: Coprocessor<F>> nova::traits::circuit::StepCircuit<F>
2 * self.lurk_step.input_params.len()
}

#[tracing::instrument(skip_all, name = "synthesize")]
fn synthesize<CS>(
&self,
cs: &mut CS,
Expand Down
3 changes: 1 addition & 2 deletions src/lem/var_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::collections::hash_map::Entry;

use anyhow::{bail, Result};
use fxhash::FxHashMap;
use tracing::info;

use super::Var;

Expand All @@ -29,7 +28,7 @@ impl<V> VarMap<V> {
}
Entry::Occupied(mut o) => {
let v = o.insert(v);
info!("Variable {} has been overwritten", o.key());
tracing::debug!("Variable {} has been overwritten", o.key());
Some(v)
}
}
Expand Down

0 comments on commit 6be5215

Please sign in to comment.