Skip to content

Commit

Permalink
feat: allocator works
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu authored and ratankaliani committed Dec 13, 2024
1 parent 3aff6c9 commit 6c64526
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ op-alloy-network = { version = "0.6.8", default-features = false }
# sp1
sp1-lib = { version = "3.3.0", features = ["verify"] }
sp1-zkvm = { git = "https://github.com/succinctlabs/sp1-wip.git", branch = "ratan/allocators", features = ["verify", "embedded", "libm", "lib"], default-features = false }
# Note: This rev includes the SP1 mock groth16 bytes fix, skipping deferred verification, executor opts and network-v2 changes.
# Note: This rev includes the SP1 mock groth16 bytes fix, skipping deferred verification, executor opts and network-v2 changes. Also turn off debug assertions on the executor.
# ratan/v3.3.0-network-v2-with-features branch includes the network-v2 changes from `19ae3e1`.
sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "cd23301f627370eace27a6cb28450d65151cbed4", features = [
sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "3ef33280f638d080a1ceda6de597867e720df660", features = [
"network-v2",
] }
sp1-build = { version = "3.3.0" }
Expand Down
15 changes: 15 additions & 0 deletions programs/range/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ fn main() {
number = number,
output_root = output_root
);

// Manually forget large objects to avoid allocator overhead
std::mem::forget(pipeline);
std::mem::forget(executor);
std::mem::forget(l2_provider);
std::mem::forget(l1_provider);
std::mem::forget(oracle);
std::mem::forget(cfg);
std::mem::forget(cursor);
std::mem::forget(boot);
});
}

Expand Down Expand Up @@ -337,6 +347,11 @@ where
.map_err(DriverError::Executor)?,
);
cursor.advance(origin, tip_cursor);

// Reduce the amount of de-allocation by forgetting the block.
// Manually forget objects before loop continues
std::mem::forget(block);

println!("cycle-tracker-report-end: output-root");
}
}
8 changes: 6 additions & 2 deletions scripts/utils/bin/cost_estimator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ use op_succinct_host_utils::{
block_range::{
get_rolling_block_range, get_validated_block_range, split_range_based_on_safe_heads,
split_range_basic, SpanBatchRange,
}, fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext}, get_proof_stdin, stats::ExecutionStats, witnessgen::run_native_data_generation, HostExecutorArgs, ProgramType
},
fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext},
get_proof_stdin,
stats::ExecutionStats,
witnessgen::run_native_data_generation,
HostExecutorArgs, ProgramType,
};
use op_succinct_scripts::HostExecutorArgs;
use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator};
use sp1_sdk::{utils, ProverClient};
use std::{
Expand Down
6 changes: 1 addition & 5 deletions scripts/utils/bin/gen_sp1_test_artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ use futures::StreamExt;
use kona_host::HostCli;
use log::info;
use op_succinct_host_utils::{
block_range::{get_validated_block_range, split_range_basic, SpanBatchRange},
fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext},
get_proof_stdin,
witnessgen::run_native_data_generation,
ProgramType,
block_range::{get_validated_block_range, split_range_basic, SpanBatchRange}, fetcher::{CacheMode, OPSuccinctDataFetcher, RunContext}, get_proof_stdin, witnessgen::run_native_data_generation, HostExecutorArgs, ProgramType
};
use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator};
use sp1_sdk::{utils, ProverClient, SP1Stdin};
Expand Down

0 comments on commit 6c64526

Please sign in to comment.