kroma-network / tachyon

Modular ZK(Zero Knowledge) backend accelerated by GPU
MIT License
7.78k stars 226 forks source link

perf: use msm gpu when generating groth16 proof #463

Closed chokobole closed 2 weeks ago

chokobole commented 2 weeks ago

Description

This PR uses msm gpu when generating groth16 proofs.

The benchmarking result based on circom proof generation received from Orbiter Finance Team are as follows:

# Gpu
Run 1, Time Taken: {Parse ZKey: 29.472 s, Parse Wtns: 0.505613 s, Prove: 14.5769 s, Verify: 0.005145 s} 
# Cpu
Run 1, Time Taken: {Parse ZKey: 29.4742 s, Parse Wtns: 0.498701 s, Prove: 32.4379 s, Verify: 0.001405 s}
chokobole commented 2 weeks ago

LGTM. Please update the "Speed" section in circom README after GPU benchmark.

Since MSM Gpu doesn't improve the performance on sha256_512.circom, we need to find additional circom file to benchmark to show performance gain. Maybe https://github.com/kroma-network/tachyon/tree/benchmark/plonky2-circom is one candidate, the problem is the size of the files are too large..

batzor commented 2 weeks ago

LGTM