Skip to content

Commit 9c77864

Browse files
committed
feat: enable multicore-sdr by default; allow env var to disable
1 parent 1c7190d commit 9c77864

File tree

5 files changed

+74
-21
lines changed

5 files changed

+74
-21
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
command: cd rust && cargo +$(cat rust-toolchain) clippy --all-targets -- -D warnings
163163
- run:
164164
name: Run cargo clippy (blst)
165-
command: cd rust && cargo +$(cat rust-toolchain) clippy --all-targets --no-default-features --features blst -- -D warnings
165+
command: cd rust && cargo +$(cat rust-toolchain) clippy --all-targets --no-default-features --features multicore-sdr --features blst -- -D warnings
166166

167167
workflows:
168168
version: 2
@@ -262,7 +262,7 @@ commands:
262262
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-standard-pairing"
263263
264264
# Note: the blst dependency uses the portable configuration for maximum compatibility
265-
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) --verbose --locked --no-default-features --features pairing,gpu --features blst-portable
265+
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) --verbose --locked --no-default-features --features multicore-sdr --features pairing,gpu --features blst-portable
266266
./scripts/package-release.sh $TARBALL_PATH
267267
./scripts/publish-release.sh $TARBALL_PATH $RELEASE_NAME
268268
- run:
@@ -274,7 +274,7 @@ commands:
274274
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-standard-blst"
275275
276276
# Note: the blst dependency uses the portable configuration for maximum compatibility
277-
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) --verbose --locked --no-default-features --features blst,gpu --features blst-portable
277+
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) --verbose --locked --no-default-features --features multicore-sdr --features blst,gpu --features blst-portable
278278
./scripts/package-release.sh $TARBALL_PATH
279279
./scripts/publish-release.sh $TARBALL_PATH $RELEASE_NAME
280280
- run:
@@ -285,7 +285,7 @@ commands:
285285
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-optimized.tar.gz"
286286
RUSTFLAGS="-C target-feature=$(cat rustc-target-features-optimized.json | jq -r '.[].rustc_target_feature' | tr '\n' ',')"
287287
288-
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) --verbose --locked --no-default-features --features pairing,gpu
288+
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) --verbose --locked --no-default-features --features multicore-sdr --features pairing,gpu
289289
./scripts/package-release.sh $TARBALL_PATH
290290
- run:
291291
name: Build the optimized release (blst)

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ rm .install-filcrypto \
4040
; FFI_BUILD_FROM_SOURCE=1 FFI_USE_BLST_PORTABLE=1 make
4141
```
4242

43-
By default, a 'gpu' option is used in the proofs library. This feature is also used in FFI unless explicitly disabled. . To disable building with the 'gpu' dependency, set `FFI_USE_GPU=0`:
43+
By default, a 'gpu' option is used in the proofs library. This feature is also used in FFI unless explicitly disabled. To disable building with the 'gpu' dependency, set `FFI_USE_GPU=0`:
4444

4545
```shell
4646
rm .install-filcrypto \
4747
; make clean \
48-
; FFI_BUILD_FROM_SOURCE=1 FFI_USE_BLST=1 make
48+
; FFI_BUILD_FROM_SOURCE=1 FFI_USE_BLST=1 FFI_USE_GPU=0 make
49+
```
50+
51+
By default, a 'multicore-sdr' option is used in the proofs library. This feature is also used in FFI unless explicitly disabled. To disable building with the 'multicore-sdr' dependency, set `FFI_USE_MULTICORE_SDR=0`:
52+
53+
```shell
54+
rm .install-filcrypto \
55+
; make clean \
56+
; FFI_BUILD_FROM_SOURCE=1 FFI_USE_MULTICORE_SDR=0 make
4957
```
5058

5159
## Updating rust-fil-proofs (via rust-filecoin-proofs-api)

install-filcrypto

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,19 @@ build_from_source() {
154154
if [ "${FFI_USE_GPU}" == "0" ]; then
155155
gpu_flags=""
156156
fi
157+
# Default to use multicore_sdr flags, unless specified to disable
158+
use_multicore_sdr="--features multicore-sdr"
159+
if [ "${FFI_USE_MULTICORE_SDR}" == "0" ]; then
160+
use_multicore_sdr=""
161+
fi
157162

158163
# Add feature specific rust flags as needed here.
159164
if [ "${FFI_USE_BLST_PORTABLE}" == "1" ]; then
160-
additional_flags="--no-default-features --features blst --features blst-portable${gpu_flags}"
165+
additional_flags="--no-default-features ${use_multicore_sdr} --features blst --features blst-portable${gpu_flags}"
161166
elif [ "${FFI_USE_BLST}" == "1" ]; then
162-
additional_flags="--no-default-features --features blst${gpu_flags}"
167+
additional_flags="--no-default-features ${use_multicore_sdr} --features blst${gpu_flags} --verbose"
163168
else
164-
additional_flags="--no-default-features --features pairing${gpu_flags}"
169+
additional_flags="--no-default-features ${use_multicore_sdr} --features pairing${gpu_flags}"
165170
fi
166171

167172
if [ -n "${__release_flags}" ]; then

rust/Cargo.lock

Lines changed: 44 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ rand = "0.7"
3232
rand_chacha = "0.2.1"
3333
rayon = "1.2.1"
3434
anyhow = "1.0.23"
35-
bellperson = { version = "0.14.0", default-features = false }
35+
bellperson = { version = "0.14.1", default-features = false }
3636
serde_json = "1.0.46"
3737
rust-gpu-tools = "0.3.0"
38+
storage-proofs-porep = { version = "~8.0.1", default-features = false }
3839

3940
[dependencies.filecoin-proofs-api]
4041
package = "filecoin-proofs-api"
41-
version = "8.0"
42+
version = "8.0.1"
4243
default-features = false
4344

4445
[build-dependencies]
@@ -48,8 +49,9 @@ cbindgen = "= 0.14.0"
4849
tempfile = "3.0.8"
4950

5051
[features]
51-
default = ["pairing", "gpu"]
52-
pairing = ["filecoin-proofs-api/pairing", "bellperson/pairing"]
53-
blst = ["filecoin-proofs-api/blst", "bellperson/blst"]
52+
default = ["pairing", "gpu", "multicore-sdr" ]
53+
pairing = ["filecoin-proofs-api/pairing", "bellperson/pairing", "storage-proofs-porep/pairing"]
54+
blst = ["filecoin-proofs-api/blst", "bellperson/blst", "storage-proofs-porep/blst"]
5455
blst-portable = ["bls-signatures/blst-portable", "blstrs/portable"]
55-
gpu = ["filecoin-proofs-api/gpu", "bellperson/gpu"]
56+
gpu = ["filecoin-proofs-api/gpu", "bellperson/gpu", "storage-proofs-porep/gpu"]
57+
multicore-sdr = ["storage-proofs-porep/multicore-sdr"]

0 commit comments

Comments
 (0)