vacp2p / nescience-zkvm-testing

This repo reflects the tests conducted by Nescience Team on selected zkVMs.
MIT License
6 stars 2 forks source link

sp1 is faster when including recommended compilation flags #1

Open jtguibas opened 1 week ago

jtguibas commented 1 week ago

The instructions in this repo for running SP1 are missing rust compilation flags that give free performance gains on most CPUs. The AMD EPYC 7713 used in your most recent benchmarking report supports AVX acceleration and hence should be enabled.

On my r6a.16xlarge instance, I get the following numbers:

These flags are recommended in our docs.

tyshko-rostyslav commented 1 week ago

The instructions in this repo for running SP1 are missing rust compilation flags that give free performance gains on most CPUs. The AMD EPYC 7713 used in your most recent benchmarking report supports AVX acceleration and hence should be enabled.

On my r6a.16xlarge instance, I get the following numbers:

  • Simple Arithmetic (SP1): 2.47 Seconds
  • Simple Arithmetic (R0): 5.3 Seconds
  • Memory Alloc (SP1): 3.84 Seconds
  • Memory Alloc (R0): 9.72 Seconds

These flags are recommended in our docs.

Dear @jtguibas,

Thank you for your comments and suggestions!

We have implemented the native optimization flag you proposed, and it has improved SP1’s performance. Specifically, the optimized simple arithmetic test for SP1 now runs in 14.383s, compared to 15.623s in the non-optimized case, and the optimized memory allocation test runs in 16.029s, compared to 17.900s without optimization.

Please note that since running our benchmarks, our machine has been updated and now operates approximately 10% faster. As a result, all zkVMs are running about 10% faster in our current tests.

In general, we opted not to use hardware acceleration when performing our benchmarks, as our project targets a broad audience. We cannot assume AVX512 support by default, given that this is primarily available in high-end CPUs.

We will update the current blog post to explicitly mention that hardware acceleration was not tested in our initial comparison. Additionally, we will soon include hardware acceleration results for SP1 (enabling AVX512).

Looking ahead, we plan to compare RISC0 and SP1, both with CUDA acceleration. We hope that by that time, other zkVMs will also support such acceleration, allowing for a fair and representative comparison.

Please feel free to reach out if you have any further questions or concerns.