-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(raiko): load program from elf for risc zero (#194)
* include_bytes! * sgx default not enable * no dummy-elf * relative path * test,bench * fmt * test,bench * RUSTFLAGS='-C target-cpu=native' --------- Co-authored-by: d1onys1us <[email protected]> Co-authored-by: Brecht Devos <[email protected]>
- Loading branch information
1 parent
09e0005
commit dc0a427
Showing
22 changed files
with
98 additions
and
185,786 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,3 +161,4 @@ rand_core = "0.6.4" | |
base64-serde = "0.7.0" | ||
base64 = "0.21.7" | ||
dirs = "5.0.1" | ||
pathdiff = "0.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
reference: https://succinctlabs.github.io/sp1/generating-proofs/advanced.html | ||
|
||
## CPU Acceleration | ||
|
||
To enable CPU acceleration, you can use the `RUSTFLAGS` environment variable to enable the `target-cpu=native` flag when running your script. This will enable the compiler to generate code that is optimized for your CPU. We encapsulate this with `CPU_OPT=1` | ||
|
||
```bash | ||
RUSTFLAGS='-C target-cpu=native' cargo run --release | ||
``` | ||
|
||
Currently there is support for AVX512 and NEON SIMD instructions. For NEON, you must also enable the `sp1-driver` feature `neon`. | ||
|
||
```bash | ||
cargo run --features sp1,neon --release | ||
``` | ||
|
||
## Performance | ||
|
||
For maximal performance, you should run proof generation with the following command and vary your `shard_size` depending on your program's number of cycles. | ||
|
||
```rust,noplayground | ||
SHARD_SIZE=4194304 RUST_LOG=info RUSTFLAGS='-C target-cpu=native' cargo run --release | ||
``` | ||
|
||
## Memory Usage | ||
|
||
To reduce memory usage, set the `SHARD_BATCH_SIZE` enviroment variable depending on how much RAM | ||
your machine has. A higher number will use more memory, but will be faster. | ||
|
||
```rust,noplayground | ||
SHARD_BATCH_SIZE=1 SHARD_SIZE=2097152 RUST_LOG=info RUSTFLAGS='-C target-cpu=native' cargo run --release | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.