-
Notifications
You must be signed in to change notification settings - Fork 113
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
Update Rust APIs #292
Update Rust APIs #292
Conversation
* refactor * refactor * revert * refactor: clang format * Update icicle/appUtils/msm/msm.cu
…fc7ed6068e8eab9d81a8d6002949524597a19' into develop/vhnat/feat-233-update-api-fix-rust-build
…lop/vhnat/feat-233-update-api-fix-rust-build
…vhnat/feat-233-update-api-fix-rust-build
Hotfix to slowdown in go when more than one curve is imported.
Add concurrency groups at workflow level for CI. Remove dev CI since we no longer use dev branch. Resolves #180
Update bug issue template to apply correct label
* Update rust bindings to support large_bucket_factor parameter * Special treatment of ones in MSM removed --------- Co-authored-by: DmytroTym <dmytrotym1@gmail.com>
Docs: Emphasize enabling tests in cmake build process
Out implementation of Barrett modular multiplication improved by utilising Karatsuba multiplication and more careful optimisations of lsb and msb multipliers in reduction stage
…dima/feat-233-update-rust-apis
This is an early version of refactored NTT on CUDA and Rust sides. Some things I would like to note:
Everything is super raw for now and there are several obvious things to do (which are in progress rn) like creating more tests, merging in main and adding the rest of the curves to Rust. There are even several cases where NTT is still incorrect which I'll solve as tests are added for these cases. That said, there are several problems I want to solve but am not sure how:
|
@DmytroTym |
@ChickenLover oh... |
never mind. There are two subgroups, but one of them is itself a subgroup of a bigger one, so I guess it's ok |
let mut extended_omega = F::ROOT_OF_UNITY;
// Get extended_omega, the 2^{extended_k}'th root of unity
// The loop computes extended_omega = omega^{2 ^ (S - extended_k)}
// Notice that extended_omega ^ {2 ^ extended_k} = omega ^ {2^S} = 1.
for _ in extended_k..F::S {
extended_omega = extended_omega.square();
}
let extended_omega = extended_omega;
let mut extended_omega_inv = extended_omega; // Inversion computed later
// Get omega, the 2^{k}'th root of unity (i.e. n'th root of unity)
// The loop computes omega = extended_omega ^ {2 ^ (extended_k - k)}
// = (omega^{2 ^ (S - extended_k)}) ^ {2 ^ (extended_k - k)}
// = omega ^ {2 ^ (S - k)}.
// Notice that omega ^ {2^k} = omega ^ {2^S} = 1.
let mut omega = extended_omega;
for _ in k..extended_k {
omega = omega.square();
} This is how they are computed in the halo2 code |
@ChickenLover yup, that's supported, you just need to pass omega of larger order, so |
@DmytroTym Regarding return types - I think that hiding as much CUDA specific details is always better for us, despite situations like unexpected CUDA errors or CUDA related configuration. Following this logic, maybe it would be a good idea to have our own structs for the Result and Error type. For the error handling - we definitely want to design error classes on the C++ side. We can do something as simple as error_code + string message and, if needed, wrap them with the wrapper language native structs. Regarding floating msm and ntt functions: maybe we can define MSM and NTT as traits and implement them for different curves with macros? Regarding tests - I really like what you described. If you'll make a draft PR that implements that idea - that would be nice |
No description provided.