facebook / winterfell

A STARK prover and verifier for arbitrary computations
MIT License
795 stars 180 forks source link

Parallelize Lagrange constraints evaluation #316

Closed Al-Kindi-0 closed 2 months ago

Al-Kindi-0 commented 2 months ago

Improves Lagrange constraints evaluation. This improves the end-to-end LogUp-GKR benchmark by 17-18% on my machine.

irakliyk commented 2 months ago

Thank you! Not a review yet, but a couple of questions:

Improves Lagrange constraints evaluation by 17-18% on my machine.

What can I ran to test the effect on my machine?

Also, this seems quite a bit less than what we get by parallelizing general constraint evaluation (I think it is something like 4x or 5x on your machine). Are there big parts still left to address for Lagrange kernel constraints? Or is there something inherently different here?

Al-Kindi-0 commented 2 months ago

The command I used are:

  1. cargo bench --bench logup_gkr
  2. cargo bench --features concurrent --bench logup_gkr

The improvement is for the overall benchmark, which is end-to-end. As constraint evaluation is a small percentage, I think the improvement to Lagrange constraint evaluation is probably on the order you gave. I updated the original comment as it was misleading.

Edit: did some back of the envelop calculations and the actual improvement should probably be around 1.5x.

Al-Kindi-0 commented 2 months ago

Subsumed by #317