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
GLV framework + precomp scripts #296
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* adds CIOS assembly * fix cfg for asm unsafe code Co-authored-by: jon-chuang <9093549+jon-chuang@users.noreply.github.com>
* First draft affine batch ops & wnaf * changes to mutability and lifetimes * delete superfluous files * crazy direction: Passing a FnMut to generate an iterator locally * unsuccessful further attempts * compile sucess using index approach * fixes for mutable borrows * Successfully passed scalar mul test * benchmarks + prefetching * stash * generic impl of batch arith for all affinecurves * batched affine formulas for TE - too expensive * improved TE affine * cleanup batch inversion * fmt... * fix minor error * remove debugging scaffolding * fmt... * delete batch arith bench as not suitable for criterion or bench * fix bench removal errors * fmt... * added missing coeff_a * refactor BatchGroupArithmetic to be separate trait * Batch verification with radix sort * Cache-locality & parallelisation * Successfully impl batch verify * added tests and bench for batch_ver, parallel_random_gen, ^ thread util * fmt * enabled missing test * remove voracious_radix_sort * commented unneeded Instant::now() * Fixed batch_ver tests for curves of small or unit cofactor * split recursive and non-recursive, tidy up shared functionality * reduce max_logn * adjust max_logn further * Batch MSM, speedup only for bw6 due to poor cache performance * fmt... * GLV iBiginteger * stash * stash * GLV with Parameter-based specialisation * GLV lattice basis script success * Successfully passed tests and benched * Improvments to MSM with and bucketed adds using lightweight index sort * changed rng to be external parameter for non-parallel batch veri * remove bench print scaffolding * remove old batch_bucketed_add using vectors instead of fixed offsets * retain parallel batch_add_split * Comments for batch arith * remove need for hashmap for no std for batch_bucketed_add * minor changes * cleanup * cleanup * fmt + use no_std Vec * removed std:: * add scratch space * Add GLV for non-batched SW mul * fix for glv_scalar_decomposition when k == MODULUS (subgroup check) * Fixed performance BUG: unnecessary table generation * GLV -> has_glv(), bigint slice bd check, refactor batch loops, u32 index * clean remove of batch_verify * fix mistake with elems indexing, unused arg for future recursion PR * trivial errors * more minor fixes * fix issues with batch_ver (.is_zero(), TE affine->proj mul) * fix issue with batch_bucketed_add_split * misname * Success in test and bench \(*v*)/ * tmp commit to cache experimental batch_add_write_shift_.. * remove batch_add_write_shift.. * optional dep, fmt... * undo accidental deletion of dlsd sort * fmt... * cleanup batch bucket add, unify impl * no std... * fixed tests * fixed unimplemented for TE, swapped wnaf table row/col for batchaddwrite * wnaf table generation uses fewer copies, remove timing instrumentation * Minor Cleanup * Add feature-activated timing instrumentation, reduce code bloat (wnaf) * unused var, no_std * Make timing macros defined globally, instrument more code * instrument w/ tid, better num_rounds est. f64, timing black/whitelisting * Minor changes * refactor tests, generic MSM test * 2D test matrix :) * batchaffine * tests * additive features * big_n feature for test-benching * prefetch unroll * minor adjustments * extension(s -> "")_fields * remove artifacts, fix asm * uncomment subgroup checks, glv param sources * Clean up GLV murkiness and add comments * Set defaults for glv_window_size * refactor glv to use examples * redact glv * ammend accidental failed resolve * remove all batch ops * ammend bititerator merge conflicts * ammend accidental deletion of batch ops and glv * Fix trait bound issues by adding `+ From` to ScalarField * fix inexplicable fp6 error * minor import errors * additional small errors * remove everything but test changes * yml * yml * remove batch arith from benches * minor changes * more minor fixes * fmt * fmt
jon-chuang
force-pushed
the
jonch/trinity/glv
branch
from
October 6, 2020 11:05
aa38655
to
54132f1
Compare
* First draft affine batch ops & wnaf * changes to mutability and lifetimes * delete superfluous files * crazy direction: Passing a FnMut to generate an iterator locally * unsuccessful further attempts * compile sucess using index approach * fixes for mutable borrows * Successfully passed scalar mul test * benchmarks + prefetching * stash * generic impl of batch arith for all affinecurves * batched affine formulas for TE - too expensive * improved TE affine * cleanup batch inversion * fmt... * fix minor error * remove debugging scaffolding * fmt... * delete batch arith bench as not suitable for criterion or bench * fix bench removal errors * fmt... * added missing coeff_a * refactor BatchGroupArithmetic to be separate trait * Batch verification with radix sort * Cache-locality & parallelisation * Successfully impl batch verify * added tests and bench for batch_ver, parallel_random_gen, ^ thread util * fmt * enabled missing test * remove voracious_radix_sort * commented unneeded Instant::now() * Fixed batch_ver tests for curves of small or unit cofactor * split recursive and non-recursive, tidy up shared functionality * reduce max_logn * adjust max_logn further * Batch MSM, speedup only for bw6 due to poor cache performance * fmt... * GLV iBiginteger * stash * stash * GLV with Parameter-based specialisation * GLV lattice basis script success * Successfully passed tests and benched * Improvments to MSM with and bucketed adds using lightweight index sort * changed rng to be external parameter for non-parallel batch veri * remove bench print scaffolding * remove old batch_bucketed_add using vectors instead of fixed offsets * retain parallel batch_add_split * Comments for batch arith * remove need for hashmap for no std for batch_bucketed_add * minor changes * cleanup * cleanup * fmt + use no_std Vec * removed std:: * add scratch space * Add GLV for non-batched SW mul * fix for glv_scalar_decomposition when k == MODULUS (subgroup check) * Fixed performance BUG: unnecessary table generation * GLV -> has_glv(), bigint slice bd check, refactor batch loops, u32 index * clean remove of batch_verify * fix mistake with elems indexing, unused arg for future recursion PR * trivial errors * more minor fixes * fix issues with batch_ver (.is_zero(), TE affine->proj mul) * fix issue with batch_bucketed_add_split * misname * Success in test and bench \(*v*)/ * tmp commit to cache experimental batch_add_write_shift_.. * remove batch_add_write_shift.. * optional dep, fmt... * undo accidental deletion of dlsd sort * fmt... * cleanup batch bucket add, unify impl * no std... * fixed tests * fixed unimplemented for TE, swapped wnaf table row/col for batchaddwrite * wnaf table generation uses fewer copies, remove timing instrumentation * Minor Cleanup * Add feature-activated timing instrumentation, reduce code bloat (wnaf) * unused var, no_std * Make timing macros defined globally, instrument more code * instrument w/ tid, better num_rounds est. f64, timing black/whitelisting * Minor changes * refactor tests, generic MSM test * 2D test matrix :) * batchaffine * tests * additive features * big_n feature for test-benching * prefetch unroll * minor adjustments * extension(s -> "")_fields * remove artifacts, fix asm * uncomment subgroup checks, glv param sources * Clean up GLV murkiness and add comments * Set defaults for glv_window_size * refactor glv to use examples * redact glv * ammend accidental failed resolve * ammend bititerator merge conflicts * ammend accidental deletion of batch ops and glv * Fix trait bound issues by adding `+ From` to ScalarField * fix inexplicable fp6 error * minor import errors * additional small errors * yml * yml
Hi @jon-chuang do you mind re-opening this PR against arkworks-rs/algebra and against arkworks-rs/curves? (It'll probably be quite a rework, sorry for the inconvenience!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The final piece of the puzzle, GLV. Patent expired 2 days ago.
Recommended to review after rest of algorithmic optimisations have been merged.
A description of the approach taken for GLV and background knowledge can be found in this hackmd article.
3/3 of a series of PRs to scipr-lab/zexe.
Features:
Combined speedup (with w-NAF) for
Without GLV: 1.65-1.8x and 1.4x resp.
Speedup for subgroup verification
Future PRs:
Future work: