-
Notifications
You must be signed in to change notification settings - Fork 46
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
Implement ec_gpu:GpuField for Fp/Fq #31
Conversation
This commit introduces a new feature called "gpu", which enables an `ec_gpu:GpuField` implementation of `Fp` and `Fq`. This enables the field arithmetics to be run on a GPU. The code to convert from a u64 to a u32 vector was taken from https://github.com/filecoin-project/blstrs/blob/07a84f9727d2fb7387efb2df0f17ddc5d35571d3/src/lib.rs#L102-L108
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.
utACK
#22 is documented as covering only this change:
My question above was, is that what this PR achieves? And what (if any) purpose does the |
It will enable finite field arithmetic to be run on GPUs. This can, e.g. be used by Neptune to run Poseidon hashing with the paste curves (lurk-lab/neptune#135). |
Co-authored-by: str4d <thestr4d@gmail.com>
Hi @str4d This PR allows the field arithmetic kernel source code to be generated for the Pasta scalar fields using
I believe that this PR does that (cc. @vmx). What this PR does not achieve is the ability to generate FFT and MSM kernels for the Pasta curves. Implementing |
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.
utACK
The code base is now on Rust 1.56 and Rust edition 2021. As per zcash#31 (comment) the code can now be simplified. This commit is also adding a test for the u64_to_u32 function.
This commit introduces a new feature called "gpu", which enables an
ec_gpu:GpuField
implementation ofFp
andFq
. This enables thefield arithmetics to be run on a GPU.
The code to convert from a u64 to a u32 vector was taken from
https://github.com/filecoin-project/blstrs/blob/07a84f9727d2fb7387efb2df0f17ddc5d35571d3/src/lib.rs#L102-L108