mirror of
https://github.com/powdr-labs/powdr.git
synced 2026-01-10 11:27:58 -05:00
split simd features in backend (#1961)
Unfortunately, cargo weirdness attacks again. Even with `estark-starky-simd = ["starky?/avx512"]` enabling the feature only if `starky` is being used, cargo still selects `starky` for compilation. Then, because `starky` itself doesn't check the architecture being used at compile time to enable AVX and only checks the features, compilation fails for https://github.com/powdr-labs/powdr-template with `simd` if AVX is not available. Therefore, we can't group both p3 and starky's simd features in the same backend `simd` feature, and need one simd feature per prover. This is what this PR does. The result has been tested with the template repo and starky is correctly *not* selected for compilation both with and without the `simd` feature of the template crate.
This commit is contained in:
@@ -27,8 +27,7 @@ stwo = ["dep:stwo-prover"]
|
||||
|
||||
# Enable AVX or Neon accordingly in backends that support them.
|
||||
plonky3-simd = ["powdr-plonky3?/nightly-features"]
|
||||
estark-starky-simd = ["starky/avx512"]
|
||||
simd = ["plonky3-simd", "estark-starky-simd"]
|
||||
estark-starky-simd = ["starky?/avx512"]
|
||||
|
||||
[dependencies]
|
||||
powdr-ast.workspace = true
|
||||
|
||||
@@ -41,7 +41,7 @@ cargo install --git https://github.com/powdr-labs/powdr --features halo2,plonky3
|
||||
With SIMD support for the provers that support it:
|
||||
|
||||
```sh
|
||||
RUSTFLAGS='-C target-cpu=native' cargo install --git https://github.com/powdr-labs/powdr --features halo2,plonky3,simd powdr-cli
|
||||
RUSTFLAGS='-C target-cpu=native' cargo install --git https://github.com/powdr-labs/powdr --features halo2,plonky3,plonky3-simd powdr-cli
|
||||
```
|
||||
|
||||
Or, by manually building from a local copy of the [powdr repository](https://github.com/powdr-labs/powdr):
|
||||
@@ -53,7 +53,7 @@ cd powdr
|
||||
# install powdr-cli
|
||||
cargo install --features halo2,plonky3 --path ./cli
|
||||
# install powdr-cli with SIMD support (only for the crates that support it)
|
||||
RUSTFLAGS='-C target-cpu=native' cargo install --features halo2,plonky3,simd --path ./cli
|
||||
RUSTFLAGS='-C target-cpu=native' cargo install --features halo2,plonky3,plonky3-simd --path ./cli
|
||||
```
|
||||
|
||||
## Building *powdr-rs*
|
||||
|
||||
@@ -19,7 +19,8 @@ estark-polygon = [
|
||||
]
|
||||
stwo = ["powdr-backend/stwo", "powdr-pipeline/stwo"]
|
||||
|
||||
simd = ["powdr-backend/simd", "powdr-pipeline/simd"]
|
||||
plonky3-simd = ["powdr-backend/plonky3-simd", "powdr-pipeline/plonky3-simd"]
|
||||
estark-starky-simd = ["powdr-backend/estark-starky-simd", "powdr-pipeline/estark-starky-simd"]
|
||||
|
||||
[dependencies]
|
||||
powdr-backend.workspace = true
|
||||
|
||||
@@ -15,7 +15,8 @@ estark-starky = ["powdr-backend/estark-starky"]
|
||||
estark-polygon = ["powdr-backend/estark-polygon"]
|
||||
stwo = ["powdr-backend/stwo"]
|
||||
|
||||
simd = ["powdr-backend/simd"]
|
||||
plonky3-simd = ["powdr-backend/plonky3-simd"]
|
||||
estark-starky-simd = ["powdr-backend/estark-starky-simd"]
|
||||
|
||||
[dependencies]
|
||||
powdr-airgen.workspace = true
|
||||
|
||||
@@ -33,7 +33,8 @@ estark-polygon = [
|
||||
"powdr-pipeline/estark-polygon",
|
||||
"powdr-riscv/estark-polygon",
|
||||
]
|
||||
simd = ["powdr-backend/simd", "powdr-pipeline/simd"]
|
||||
plonky3-simd = ["powdr-backend/plonky3-simd", "powdr-pipeline/plonky3-simd"]
|
||||
estark-starky-simd = ["powdr-backend/estark-starky-simd", "powdr-pipeline/estark-starky-simd"]
|
||||
|
||||
[lints.clippy]
|
||||
uninlined_format_args = "deny"
|
||||
|
||||
Reference in New Issue
Block a user