New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support other fields #135
Conversation
impl< | ||
#[cfg(not(any(feature = "cuda", feature = "opencl")))] F: PrimeField, | ||
#[cfg(any(feature = "cuda", feature = "opencl"))] F: PrimeField + GpuField, | ||
A: Arity<F>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cryptonemo that's what I mentioned in our meeting. It's between crazy and nice.
I've converted it to a draft PR as the CUDA side of things needs more work. There's no need for a review atm. |
0adcaeb
to
3b91f48
Compare
CI is happy now, it's ready for review. This PR depends on zcash/pasta_curves#31. |
Cargo.toml
Outdated
criterion = "0.3" | ||
rand = "0.8.0" | ||
sha2 = "0.9" | ||
tempdir = "0.3" | ||
rand_xorshift = "0.3.0" | ||
serde_json = "1.0.53" | ||
pasta_curves = "0.2.1" | ||
pasta_curves = { git = "https://github.com/vmx/pasta_curves", branch = "ec-gpu" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs updating before merge
Cargo.toml
Outdated
criterion = "0.3" | ||
rand = "0.8.0" | ||
sha2 = "0.9" | ||
tempdir = "0.3" | ||
rand_xorshift = "0.3.0" | ||
serde_json = "1.0.53" | ||
pasta_curves = "0.2.1" | ||
pasta_curves = { git = "https://github.com/vmx/pasta_curves", branch = "ec-gpu" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs updating before merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except for one naming issue (plus needs dependency update before merging).
071aafc
to
726f745
Compare
gbench/Cargo.toml
Outdated
blstrs = "0.4.0" | ||
blstrs = { version = "0.4.0", features = ["gpu"] } | ||
#pasta_curves = "0.3.0" | ||
pasta_curves = { git = "https://github.com/vmx/pasta_curves", branch = "ec-gpu", features = ["gpu"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update before merging
Looks good! |
I've rebased and addressed all review comments from @DrPeterVanNostrand in a separate commit. |
I've just rebased and squashed it into a single commit, no other code changes. This is ready to be merged. Remember that this is a breaking change. |
@porcuquine you'll see a |
@vmx How about we make a feature branch you can use as a stable Git dependency, so we can avoid having a Git dependency on |
I find having it on master easier (you can also just use the specific commit), but whatever works. @DrPeterVanNostrand @cryptonemo what do you think? We can also just use this branch. |
I'm fine with using this branch temporarily. |
It's easier for the one consumer who needs it, but could be awkward if someone else needs something different — or if we need another release in-between, for whatever reason. |
@porcuquine given that there's an upcoming breaking change release, it would be cool if this PR could be included. In now uses released versions of the dependencies, no other changes were made since the last review. I've rebased it on top of #150 and also changed the base branch to that for this PR, so that review is easier. Once that PR is merged, I'll again rebase it on master. |
It is now possible to use Neptune with Pasta curves on the GPU. In order to make that possible, two new compile-time features are introduced. `bls` to use BLS12-381 and `pasta` to use the Pasta curves (Pallas and Vesta). BREAKING CHANGE: The API now requires to pass in the field that should be used. It does no longer default to BLS12-381. If the GPU is used (enabled by the `cuda` and/or `opencl` features), you now also need to specify the supported fields, `bls` and/or `pasta`.
So far tests were run in a single job for different configurations. Split those tests into separate jobs for more parllelism and hence shorter overall runtime.
It is now possible to use Neptune with Pasta curves on the GPU. In
order to make that possible, two new compile-time features are introduced.
bls
to use BLS12-381 andpasta
to use the Pasta curves (Pallas andVesta).
BREAKING CHANGE: The API now requires to pass in the field that
should be used. It does no longer default to BLS12-381.
If the GPU is used (enabled by the
cuda
and/oropencl
features), younow also need to specify the supported fields,
bls
and/orpasta
.