Skip to content

Commit

Permalink
chore: remove explicit sve feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbinth committed Jan 6, 2024
1 parent 8c17205 commit ad4481a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 15 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FEATURES_INTERNALS=--features internals
FEATURES_CONCURRENT_EXEC=--features concurrent,executable
FEATURES_GRAVITON_EXEC=--features concurrent,executable,sve
FEATURES_METAL_EXEC=--features concurrent,executable,metal
PROFILE_OPTIMIZED=--profile optimized
PROFILE_TEST=--profile test-release
Expand All @@ -14,8 +13,11 @@ exec:
exec-metal:
cargo build $(PROFILE_OPTIMIZED) $(FEATURES_METAL_EXEC)

exec-graviton:
RUSTFLAGS="-C target-cpu=native" cargo build $(PROFILE_OPTIMIZED) $(FEATURES_GRAVITON_EXEC)
exec-avx2:
RUSTFLAGS="-C target-feature=+avx2" cargo build $(PROFILE_OPTIMIZED) $(FEATURES_CONCURRENT_EXEC)

exec-sve:
RUSTFLAGS="-C target-feature=+sve" cargo build $(PROFILE_OPTIMIZED) $(FEATURES_CONCURRENT_EXEC)

test:
cargo test $(PROFILE_TEST) $(FEATURES_INTERNALS)
1 change: 0 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ doctest = false
[features]
default = ["std"]
std = ["miden-crypto/std", "math/std", "winter-utils/std"]
sve = ["miden-crypto/sve", "std"]

[dependencies]
math = { package = "winter-math", version = "0.7", default-features = false }
Expand Down
14 changes: 11 additions & 3 deletions docs/src/intro/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@ Similar to `make exec` command, this will place the resulting `miden` executable
Currently, GPU acceleration is applicable only to recursive proofs which can be generated using the `-r` flag.

### SIMD acceleration
Miden VM execution and proof generation can be accelerated via vectorized instructions. Currently, SIMD acceleration can be enabled only on platforms supporting [SVE](https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE)) instructions (e.g., Graviton 3). To compile Miden VM with SVE acceleration enabled, you can run the following command:
Miden VM execution and proof generation can be accelerated via vectorized instructions. Currently, SIMD acceleration can be enabled on platforms supporting [SVE](https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE)) and [AVX2](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2) instructions.

To compile Miden VM with AVX2 acceleration enabled, you can run the following command:
```
make exec-avx2
```
make exec-graviton

To compile Miden VM with SVE acceleration enabled, you can run the following command:
```
make exec-sve
```

This will place the resulting `miden` executable into the `./target/optimized` directory.

Similar to Metal acceleration, SVE acceleration is currently applicable only to recursive proofs which can be generated using the `-r` flag.
Similar to Metal acceleration, SVE/AVX2 acceleration is currently applicable only to recursive proofs which can be generated using the `-r` flag.

### Running Miden VM
Once the executable has been compiled, you can run Miden VM like so:
Expand Down
1 change: 0 additions & 1 deletion miden/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ default = ["std"]
executable = ["dep:env_logger", "dep:hex", "hex?/std", "std", "dep:serde", "serde?/std", "dep:serde_derive", "dep:serde_json", "serde_json?/std", "dep:clap", "dep:rustyline"]
metal = ["prover/metal", "std"]
std = ["assembly/std", "log/std", "processor/std", "prover/std", "verifier/std"]
sve = ["processor/sve", "prover/sve", "std"]

[dependencies]
assembly = { package = "miden-assembly", path = "../assembly", version = "0.8", default-features = false }
Expand Down
8 changes: 5 additions & 3 deletions miden/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,11 @@ make exec
# build an executable for Apple silicon (concurrent+metal)
make exec-metal

# built an executable for the Graviton 3 target (concurrent+sve)
make exec-graviton
# built an executable for targets with AVX2 instructions (concurrent)
make exec-avx2

# built an executable for targets with SVE instructions (concurrent)
make exec-sve
```

### Running Miden VM
Expand Down Expand Up @@ -263,7 +266,6 @@ Miden VM can be compiled with the following features:
* `std` - enabled by default and relies on the Rust standard library.
* `concurrent` - implies `std` and also enables multi-threaded proof generation.
* `executable` - required for building Miden VM binary as described above. Implies `std`.
* `sve` - enables [SVE](https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE))-based acceleration of the RPO hash function on supported platforms (e.g., Graviton 3).
* `metal` - enables [Metal](https://en.wikipedia.org/wiki/Metal_(API))-based acceleration of proof generation (for recursive proofs) on supported platforms (e.g., Apple silicon).
* `no_std` does not rely on the Rust standard library and enables compilation to WebAssembly.

Expand Down
1 change: 0 additions & 1 deletion processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ concurrent = ["std", "winter-prover/concurrent"]
default = ["std"]
internals = []
std = ["log/std", "vm-core/std", "winter-prover/std"]
sve = ["std", "vm-core/sve"]

[dependencies]
log = { version = "0.4", default-features = false, optional = true }
Expand Down
1 change: 0 additions & 1 deletion processor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ A much more in-depth description of Miden VM design is available [here](https://
Miden processor can be compiled with the following features:

* `std` - enabled by default and relies on the Rust standard library.
* `sve` - enables [SVE](https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE))-based acceleration of the RPO hash function on supported platforms (e.g., Graviton 3).
* `no_std` does not rely on the Rust standard library and enables compilation to WebAssembly.

To compile with `no_std`, disable default features via `--no-default-features` flag.
Expand Down
1 change: 0 additions & 1 deletion prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ concurrent = ["processor/concurrent", "std", "winter-prover/concurrent"]
default = ["std"]
metal = ["dep:ministark-gpu", "dep:elsa", "dep:pollster", "concurrent", "std"]
std = ["air/std", "processor/std", "log/std", "winter-prover/std"]
sve = ["processor/sve", "std"]

[dependencies]
air = { package = "miden-air", path = "../air", version = "0.8", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion prover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Miden prover can be compiled with the following features:

* `std` - enabled by default and relies on the Rust standard library.
* `concurrent` - implies `std` and also enables multi-threaded proof generation.
* `sve` - enables [SVE](https://en.wikipedia.org/wiki/AArch64#Scalable_Vector_Extension_(SVE))-based acceleration of the RPO hash function on supported platforms (e.g., Graviton 3).
* `metal` - enables [Metal](https://en.wikipedia.org/wiki/Metal_(API))-based acceleration of proof generation (for recursive proofs) on supported platforms (e.g., Apple silicon).
* `no_std` does not rely on the Rust standard library and enables compilation to WebAssembly.

Expand Down

0 comments on commit ad4481a

Please sign in to comment.