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

Bounded MSM #1

Open
wants to merge 5 commits into
base: ml-is-poly-vec
Choose a base branch
from
Open

Bounded MSM #1

wants to merge 5 commits into from

Conversation

mmagician
Copy link

@mmagician mmagician commented Oct 16, 2023

Description

For our use case of polynomial with small coefficients, we are interested in doing MSMs over small scalars.

For MAX_BITS = 30 we have a massive 7x performance improvement:

MSM small for Bls12_381::G1    time:   [186.06 ms 188.58 ms 191.62 ms]

versus the naive MSM:

MSM for Bls12_381::G1          time:   [1.3238 s 1.3446 s 1.3680 s]

For MAX_BITS = 60, we have:

time:   [303.07 ms 304.08 ms 305.53 ms]

This is actually "only" 5x better. Surprisingly, or perhaps not*, this is MUCH better than claimed in Lasso: https://github.com/a16z/Lasso/blob/823da601422d17f7c150631947b33a9db1ad5b98/src/msm/README.md?plain=1#L2

*I think that the claim in Lasso actually refers to the costs of the entire scheme, instead of just MSM.

Also, the interface change is a little ugly VERY BAD, as the default is almost never respected.
Probably we'd need to also add this const to sw Projective and all its implementations... it's quickly turning messy, but I don't know if there's a better way.

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.

1 participant