Skip to content

Commit 5a2b2de

Browse files
feat: enable gpu snarks by default (#916)
feat: enable gpu snarks by default
2 parents ca2d8a0 + 2cef3bf commit 5a2b2de

File tree

10 files changed

+28
-23
lines changed

10 files changed

+28
-23
lines changed

Dockerfile-ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN apt-get update && \
1212
apt-get install -y curl file gcc g++ git make openssh-client \
1313
autoconf automake cmake libtool libcurl4-openssl-dev libssl-dev \
1414
libelf-dev libdw-dev binutils-dev zlib1g-dev libiberty-dev wget \
15-
xz-utils pkg-config python clang
15+
xz-utils pkg-config python clang ocl-icd-opencl-dev
1616

1717
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
1818

fil-proofs-tooling/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ human-size = "0.4"
2222
prettytable-rs = "0.8"
2323
regex = "1.1.6"
2424
commandspec = "0.12.2"
25-
bellperson = "0.3"
25+
bellperson = "0.3.3"
2626
chrono = { version = "0.4.7", features = ["serde"] }
2727
fil-sapling-crypto = "0.1.2"
2828
memmap = "0.7.0"
@@ -42,5 +42,5 @@ log = "0.4.8"
4242
uom = "0.25.0"
4343

4444
[features]
45-
default = []
45+
default = ["gpu"]
4646
gpu = ["storage-proofs/gpu", "filecoin-proofs/gpu", "bellperson/gpu", "fil-sapling-crypto/gpu"]

fil-proofs-tooling/src/bin/benchy/stacked.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ where
151151
let pb = stacked::PublicInputs::<H::Domain, <Blake2sHasher as Hasher>::Domain> {
152152
replica_id,
153153
seed,
154-
tau: Some(tau.clone()),
154+
tau: Some(tau),
155155
k: Some(0),
156156
};
157157

filecoin-proofs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ regex = "1"
2828
ff = "0.4.0"
2929
blake2b_simd = "0.5"
3030
phase21 = "0.3"
31-
bellperson = "0.3"
31+
bellperson = "0.3.3"
3232
paired = "0.15"
3333
fil-sapling-crypto = "0.1.2"
3434
clap = "2"
@@ -55,7 +55,7 @@ pretty_env_logger = "0.3.1"
5555
pretty_assertions = "0.6.1"
5656

5757
[features]
58-
default = []
58+
default = ["gpu"]
5959
cpu-profile = []
6060
heap-profile = ["gperftools/heap"]
6161
simd = ["storage-proofs/simd"]

filecoin-proofs/src/fr32.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -589,15 +589,20 @@ pub fn extract_bits_and_shift(
589589
let input = &input[..BitByte::from_bits(extraction_offset + num_bits).bytes_needed()];
590590

591591
// (2).
592-
let mut output = if new_offset < extraction_offset {
593-
// Shift right.
594-
shift_bits(input, extraction_offset - new_offset, false)
595-
} else if new_offset > extraction_offset {
596-
// Shift left.
597-
shift_bits(input, new_offset - extraction_offset, true)
598-
} else {
599-
// No shift needed, take the `input` as is.
600-
input.to_vec()
592+
use std::cmp::Ordering;
593+
let mut output = match new_offset.cmp(&extraction_offset) {
594+
Ordering::Less => {
595+
// Shift right.
596+
shift_bits(input, extraction_offset - new_offset, false)
597+
}
598+
Ordering::Greater => {
599+
// Shift left.
600+
shift_bits(input, new_offset - extraction_offset, true)
601+
}
602+
Ordering::Equal => {
603+
// No shift needed, take the `input` as is.
604+
input.to_vec()
605+
}
601606
};
602607

603608
// After the shift we may not need the last byte of the `output` (either

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-08-09
1+
nightly-2019-10-17

storage-proofs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ blake2b_simd = "0.5"
4040
blake2s_simd = "0.5"
4141
toml = "0.5"
4242
ff = "0.4.0"
43-
bellperson = "0.3"
43+
bellperson = "0.3.3"
4444
paired = { version = "0.15.1", features = ["serde"] }
4545
fil-sapling-crypto = "0.1.2"
4646
serde_json = "1.0"
@@ -51,7 +51,7 @@ crossbeam = "0.7.2"
5151
num_cpus = "1.10.1"
5252

5353
[features]
54-
default = []
54+
default = ["gpu"]
5555
simd = []
5656
asm = ["sha2/sha2-asm"]
5757
mem-trees = []

storage-proofs/src/circuit/metric/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<E: Engine> ConstraintSystem<E> for MetricCS<E> {
202202
AR: Into<String>,
203203
{
204204
let path = compute_path(&self.current_namespace, &annotation().into());
205-
self.aux.push(path.clone());
205+
self.aux.push(path);
206206

207207
Ok(Variable::new_unchecked(Index::Aux(self.aux.len() - 1)))
208208
}
@@ -214,7 +214,7 @@ impl<E: Engine> ConstraintSystem<E> for MetricCS<E> {
214214
AR: Into<String>,
215215
{
216216
let path = compute_path(&self.current_namespace, &annotation().into());
217-
self.inputs.push(path.clone());
217+
self.inputs.push(path);
218218

219219
Ok(Variable::new_unchecked(Index::Input(self.inputs.len() - 1)))
220220
}
@@ -245,7 +245,7 @@ impl<E: Engine> ConstraintSystem<E> for MetricCS<E> {
245245
{
246246
let name = name_fn().into();
247247
let path = compute_path(&self.current_namespace, &name);
248-
self.set_named_obj(path.clone(), NamedObject::Namespace);
248+
self.set_named_obj(path, NamedObject::Namespace);
249249
self.current_namespace.push(name);
250250
}
251251

storage-proofs/src/circuit/stacked/params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<H: Hasher> InclusionPath<H> {
178178
) -> Result<(), SynthesisError> {
179179
let InclusionPath { auth_path, .. } = self;
180180

181-
let root = Root::from_allocated::<CS>(root.clone());
181+
let root = Root::from_allocated::<CS>(root);
182182
let value = Root::from_allocated::<CS>(leaf);
183183
PoRCircuit::<Bls12, H>::synthesize(cs, params, value, auth_path, root, true)
184184
}

storage-proofs/src/circuit/test/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl<E: Engine> ConstraintSystem<E> for TestConstraintSystem<E> {
399399
{
400400
let name = name_fn().into();
401401
let path = compute_path(&self.current_namespace, &name);
402-
self.set_named_obj(path.clone(), NamedObject::Namespace);
402+
self.set_named_obj(path, NamedObject::Namespace);
403403
self.current_namespace.push(name);
404404
}
405405

0 commit comments

Comments
 (0)