Skip to content
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

Sparse poly eval #214

Merged
merged 11 commits into from
Feb 11, 2021
Merged

Sparse poly eval #214

merged 11 commits into from
Feb 11, 2021

Conversation

jon-chuang
Copy link
Contributor

@jon-chuang jon-chuang commented Feb 8, 2021

Description

closes: #123
Results:
2.5x improvement.

New
Screenshot from 2021-02-08 13-50-46

Old
Screenshot from 2021-02-08 13-52-53


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

ff/src/fields/mod.rs Outdated Show resolved Hide resolved
@jon-chuang jon-chuang force-pushed the sparse_poly_eval branch 3 times, most recently from 691d9a1 to 7340519 Compare February 8, 2021 07:17
Comment on lines 66 to 69
let total_bits = core::mem::size_of::<usize>() * 8;
let max_pow_2 = total_bits - self.degree().leading_zeros() as usize;

let mut pows_2 = Vec::<F>::with_capacity(max_pow_2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is computing log2(total_bits), right? You can replace it with let max_pow_2 = ark_std::log2(total_bits);.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo this should be a usize default function

Copy link
Contributor Author

@jon-chuang jon-chuang Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, I am uncomfortable with the current name, imo it ought to be named log2_then_ceil, or log2_of_next_pow_of_2 or something. I like the second name best.

@Pratyush
Copy link
Member

Thanks for this! This LGTM once the comment is addressed

@jon-chuang
Copy link
Contributor Author

Ok, it should be good to merge now

ff/src/fields/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@Pratyush Pratyush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good now!

@jon-chuang jon-chuang merged commit 920070c into master Feb 11, 2021
@jon-chuang jon-chuang deleted the sparse_poly_eval branch February 11, 2021 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poly: Investigate Faster sparse polynomial evaluation methods
2 participants