diff --git a/Makefile b/Makefile index 6ba366c124..1a08a1ce33 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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) diff --git a/core/Cargo.toml b/core/Cargo.toml index f7d450b95a..238eb98abb 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -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 } diff --git a/docs/src/intro/usage.md b/docs/src/intro/usage.md index 168881fe0d..96a9b120d1 100644 --- a/docs/src/intro/usage.md +++ b/docs/src/intro/usage.md @@ -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: diff --git a/miden/Cargo.toml b/miden/Cargo.toml index f8ccc399d9..f0e8b85389 100644 --- a/miden/Cargo.toml +++ b/miden/Cargo.toml @@ -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 } diff --git a/miden/README.md b/miden/README.md index 3e452ba032..3f4684542b 100644 --- a/miden/README.md +++ b/miden/README.md @@ -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 @@ -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. diff --git a/processor/Cargo.toml b/processor/Cargo.toml index d36be1aafd..fbfeae6108 100644 --- a/processor/Cargo.toml +++ b/processor/Cargo.toml @@ -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 } diff --git a/processor/README.md b/processor/README.md index d176d158e1..b0d9935619 100644 --- a/processor/README.md +++ b/processor/README.md @@ -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. diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 3cffc65b80..145aeb2539 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -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 } diff --git a/prover/README.md b/prover/README.md index f707bb5f63..87e84bac44 100644 --- a/prover/README.md +++ b/prover/README.md @@ -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.