Skip to content

Commit

Permalink
Optimize Phase1.
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire authored and porcuquine committed Sep 25, 2020
1 parent 1b2d97a commit 21e4820
Show file tree
Hide file tree
Showing 12 changed files with 1,103 additions and 264 deletions.
Empty file added config.json
Empty file.
45 changes: 1 addition & 44 deletions fil-proofs-tooling/src/bin/settings/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,6 @@ use anyhow::Result;
use storage_proofs::settings::{Settings, SETTINGS};

fn main() -> Result<()> {
let Settings {
parameter_cache,
maximize_caching,
verify_cache,
verify_production_params,
parent_cache,
sdr_parents_cache_size,
use_gpu_column_builder,
max_gpu_column_batch_size,
column_write_batch_size,
use_gpu_tree_builder,
max_gpu_tree_batch_size,
rows_to_discard,
window_post_synthesis_num_cpus,
pedersen_hash_exp_window_size,
use_fil_blst,
} = &*SETTINGS.lock().unwrap();

println!("parameter_cache: {}", parameter_cache);
println!("maximize_caching: {}", maximize_caching);
println!("verify_cache: {}", verify_cache);
println!("verify_production_params: {}", verify_production_params);
println!("parent_cache: {}", parent_cache);
println!("sdr_parents_cache_size: {}", sdr_parents_cache_size);

println!("use_gpu_column_builder: {}", use_gpu_column_builder);
println!("max_gpu_column_batch_size: {}", max_gpu_column_batch_size);
println!("column_write_batch_size: {}", column_write_batch_size);

println!("use_gpu_tree_builder: {}", use_gpu_tree_builder);
println!("max_gpu_tree_batch_size: {}", max_gpu_tree_batch_size);

println!("rows_to_discard: {}", rows_to_discard);
println!(
"window_post_synthesis_num_cpus: {}",
window_post_synthesis_num_cpus
);
println!(
"pedersen_hash_exp_window_size: {}",
pedersen_hash_exp_window_size
);

println!("use_fil_blst: {}", use_fil_blst);

println!("{:#?}", *SETTINGS.lock().unwrap());
Ok(())
}
4 changes: 4 additions & 0 deletions storage-proofs/core/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ pub struct Settings {
pub max_gpu_tree_batch_size: u32,
pub rows_to_discard: u32,
pub sdr_parents_cache_size: u32,
pub sdr_parents_cache_window_nodes: u32,
pub window_post_synthesis_num_cpus: u32,
pub parameter_cache: String,
pub parent_cache: String,
pub use_fil_blst: bool,
pub use_multicore_sdr: bool,
}

impl Default for Settings {
Expand All @@ -47,13 +49,15 @@ impl Default for Settings {
max_gpu_tree_batch_size: 700_000,
rows_to_discard: 2,
sdr_parents_cache_size: 2_048,
sdr_parents_cache_window_nodes: 1024,
window_post_synthesis_num_cpus: num_cpus::get() as u32,
// `parameter_cache` does not use the cache() mechanism because it is now used
// for durable, canonical Groth parameters and verifying keys.
// The name is retained for backwards compatibility.
parameter_cache: "/var/tmp/filecoin-proof-parameters/".to_string(),
parent_cache: cache("filecoin-parents"),
use_fil_blst: false,
use_multicore_sdr: false,
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions storage-proofs/porep/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ repository = "https://github.com/filecoin-project/rust-fil-proofs"
readme = "README.md"

[dependencies]
crossbeam = "0.7.3"
digest = "0.9"
storage-proofs-core = { path = "../core", version = "^5.0.0"}
sha2raw = { path = "../../sha2raw", version = "^2.0.0"}
rand = "0.7"
merkletree = "0.21.0"
memmap = "0.7"
# memmap = "0.7"
memmap = { git = "https://github.com/dignifiedquire/memmap-rs", branch ="lock" }
num-bigint = "0.2"
num-traits = "0.2"
sha2 = "0.9.1"
sha2 = { version = "0.9.1", features = ["compress"] }
rayon = "1.0.0"
serde = { version = "1.0", features = ["derive"]}
serde_json = "1.0"
Expand All @@ -34,6 +37,7 @@ hex = "0.4.2"
bincode = "1.1.2"
byteorder = "1.3.4"
lazy_static = "1.2"
byte-slice-cast = "0.3.5"

[dev-dependencies]
tempfile = "3"
Expand Down
16 changes: 12 additions & 4 deletions storage-proofs/porep/src/stacked/circuit/create_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ mod tests {
util::{data_at_node, NODE_SIZE},
};

use crate::stacked::vanilla::{
create_label_exp, StackedBucketGraph, EXP_DEGREE, TOTAL_PARENTS,
};
use crate::stacked::vanilla::{create_label, StackedBucketGraph, EXP_DEGREE, TOTAL_PARENTS};

#[test]
fn test_create_label() {
Expand Down Expand Up @@ -167,7 +165,17 @@ mod tests {
assert_eq!(cs.num_constraints(), 532_025);

let (l1, l2) = data.split_at_mut(size * NODE_SIZE);
create_label_exp(&graph, None, &id_fr.into(), &*l2, l1, layer, node).unwrap();
// FIXME: Update this test.
create_label(
&mut graph.parent_cache().unwrap(),
&fr_into_bytes(&id_fr),
&*l2,
l1,
layer,
node,
false,
)
.unwrap();
let expected_raw = data_at_node(&l1, node).unwrap();
let expected = bytes_into_fr(expected_raw).unwrap();

Expand Down
Loading

0 comments on commit 21e4820

Please sign in to comment.