From 92e9aad7921b5c4f21e3b441ff992c8fb44f07f4 Mon Sep 17 00:00:00 2001 From: Uma Roy Date: Sat, 10 Feb 2024 01:57:10 -0800 Subject: [PATCH] Cleanup --- Cargo.lock | 23 ----------------------- core/Cargo.toml | 1 - core/src/stark/prover.rs | 6 +++--- core/src/stark/types.rs | 4 ++++ core/src/utils/env.rs | 4 +--- 5 files changed, 8 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0cf73e05ed..a767224545 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1117,18 +1117,6 @@ dependencies = [ "regex", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -1280,16 +1268,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "measure_time" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56220900f1a0923789ecd6bf25fbae8af3b2f1ff3e9e297fc9b6b8674dd4d852" -dependencies = [ - "instant", - "log", -] - [[package]] name = "memchr" version = "2.7.1" @@ -2476,7 +2454,6 @@ dependencies = [ "k256", "lazy_static", "log", - "measure_time", "nohash-hasher", "num", "p3-air", diff --git a/core/Cargo.toml b/core/Cargo.toml index be539e6a4f..722ca5c6c2 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -52,7 +52,6 @@ k256 = { version = "0.13.3", features = ["expose-field"] } elliptic-curve = "0.13.8" anyhow = "1.0.79" serial_test = "3.0.0" -measure_time = "0.8.2" [dev-dependencies] criterion = "0.5.1" diff --git a/core/src/stark/prover.rs b/core/src/stark/prover.rs index 683bc698ac..61bfba9e21 100644 --- a/core/src/stark/prover.rs +++ b/core/src/stark/prover.rs @@ -562,9 +562,9 @@ where MainData: Serialize + DeserializeOwned, { let num_shards = shards.len(); - println!("num_shards={}", num_shards); - // At around 64 shards * 1 GB per shard, saving to disk starts - // to become necessary. + tracing::info!("num_shards={}", num_shards); + // Get the number of shards that is the threshold for saving shards to disk instead of + // keeping all the shards in memory. let save_disk_threshold = env::save_disk_threshold(); // Batch into at most 16 chunks (and at least 1) to limit parallelism. let chunk_size = max(shards.len() / 16, 1); diff --git a/core/src/stark/types.rs b/core/src/stark/types.rs index ce21db38d0..e9966f205b 100644 --- a/core/src/stark/types.rs +++ b/core/src/stark/types.rs @@ -65,6 +65,10 @@ impl MainData { drop(writer); let metadata = file.metadata()?; let bytes_written = metadata.len(); + trace!( + "wrote {} while saving MainData", + Size::from_bytes(bytes_written) + ); Ok(MainDataWrapper::TempFile(file, bytes_written)) } diff --git a/core/src/utils/env.rs b/core/src/utils/env.rs index 711e88d90e..2c65298377 100644 --- a/core/src/utils/env.rs +++ b/core/src/utils/env.rs @@ -10,9 +10,7 @@ pub fn shard_size() -> usize { value } -/// Gets the number of rows which by default should be used for each chip to maximize padding. -/// -/// Some chips, such as FieldLTU, may use a constant multiple of this value to optimize performance. +/// Gets the number of shards after which we should save the shard commits to disk. pub fn save_disk_threshold() -> usize { let value = match std::env::var("SAVE_DISK_THRESHOLD") { Ok(val) => val.parse().unwrap(),