penumbra icon indicating copy to clipboard operation
penumbra copied to clipboard

refactor(arkworks): Improve performance of arkworks proving stack

Open TalDerei opened this issue 2 years ago • 1 comments

In ZKSummit 9, Snarkify presented the ArkMSM Rust library for accelerating the Multi-Scalar Multiplication (MSM) module in Arkworks. They currently boast a ~1.8x performance improvement for 2^16 MSMs. After following-up with the founder (https://twitter.com/drouyang), I learned that this work has not currently been upstreamed to the Arkworks stack in any capacity.

Currently, the implementation is built around Arkworks 0.3.0 (~ June, 2021) and will need to be modified to work with Arkworks 0.4.0 (February, 2023 - present), comprising mainly of data-structure related changes. We currently use Arkworks 0.4.0 for our circuits. This will eventually be upstreamed into the Arkworks monorepo and yield benefits for the entire ecosystem, and both Snarkify and Pratyush are probably willing to offer additional guidance and support. They anticipate this initial integration work to take about a week to complete. I think this can possibly yield noticeable benefits in the wasm context alongside our decaf377 changes.

Additionally, there's a set of work after the integration to improve x86 multithreading, but it's a lower priority item.

I've been learning about ArkMSM, and I'd like to take this on. Thoughts?

cc @hdevalence

TalDerei avatar Feb 13 '24 21:02 TalDerei

This sounds great. We should just ensure that there aren't loose ends left over with other work.

hdevalence avatar Feb 13 '24 22:02 hdevalence

This is currently in-progress, tracked by my forks https://github.com/TalDerei/arkmsm/pull/1 and https://github.com/TalDerei/algebra

TalDerei avatar Mar 26 '24 15:03 TalDerei