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

zkp: HAL cleanups and perf bump #826

Merged
merged 7 commits into from
Aug 31, 2023
Merged

zkp: HAL cleanups and perf bump #826

merged 7 commits into from
Aug 31, 2023

Conversation

flaub
Copy link
Member

@flaub flaub commented Aug 31, 2023

  • Parallelize a top 10 hotspot in the prover. TODO: consider moving this hotspot to a HAL function that stays on-device.
  • Rename EvalCheck to CircuitHal to be more appropriate for what it is now and in the future. The plan is to add more circuit-specific HALs to CircuitHal.
  • Drop unused CircuitStepHandler::calc_prefix_products.

@flaub flaub self-assigned this Aug 31, 2023
@flaub flaub enabled auto-merge (squash) August 31, 2023 06:53
@risc0 risc0 deleted a comment from github-actions bot Aug 31, 2023
@github-actions
Copy link

Benchmark for Linux-cuda

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for Linux-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-default 3250cf9

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.09ms 2.7±0.08ms -3.57%
fib/100/prove 3.7±0.05s 3.6±0.07s -2.70%
fib/100/total 3.7±0.05s 3.6±0.09s -2.70%
fib/1000/execute 3.1±0.07ms 3.0±0.10ms -3.23%
fib/1000/prove 3.7±0.05s 3.6±0.07s -2.70%
fib/1000/total 3.7±0.06s 3.7±0.03s 0.00%
fib/10000/execute 5.9±0.08ms 5.6±0.12ms -5.08%
fib/10000/prove 15.2±0.17s 15.0±0.13s -1.32%
fib/10000/total 15.2±0.11s 15.1±0.09s -0.66%

Benchmark for macOS-metal 3250cf9

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.11ms 2.6±0.09ms -7.14%
fib/100/prove 849.9±2.51ms 795.5±4.43ms -6.40%
fib/100/total 874.3±5.96ms 817.2±5.35ms -6.53%
fib/1000/execute 3.0±0.04ms 3.0±0.05ms 0.00%
fib/1000/prove 869.1±2.18ms 817.0±4.03ms -5.99%
fib/1000/total 892.8±5.68ms 837.1±5.37ms -6.24%
fib/10000/execute 5.8±0.04ms 5.8±0.10ms 0.00%
fib/10000/prove 3.3±0.01s 3.1±0.01s -6.06%
fib/10000/total 3.3±0.01s 3.1±0.01s -6.06%

@github-actions
Copy link

Benchmark for Linux-cuda 01e999b

Click to hide benchmark
Test Base PR %
fib/100/execute 5.0±0.09ms 5.0±0.09ms 0.00%
fib/100/prove 772.9±4.34ms 726.2±3.55ms -6.04%
fib/100/total 778.6±4.67ms 743.3±2.19ms -4.53%
fib/1000/execute 5.7±0.11ms 5.5±0.10ms -3.51%
fib/1000/prove 801.8±4.66ms 749.4±3.30ms -6.54%
fib/1000/total 812.8±2.92ms 768.4±3.39ms -5.46%
fib/10000/execute 11.9±0.11ms 11.2±0.08ms -5.88%
fib/10000/prove 3.2±0.02s 2.5±0.01s -21.88%
fib/10000/total 3.2±0.01s 2.5±0.01s -21.88%

Benchmark for Linux-default 01e999b

Click to hide benchmark
Test Base PR %
fib/100/execute 4.9±0.48ms 4.7±0.19ms -4.08%
fib/100/prove 2.4±1.33s 2.3±0.31s -4.17%
fib/100/total 2.5±0.55s 2.1±0.24s -16.00%
fib/1000/execute 6.4±1.31ms 5.3±0.10ms -17.19%
fib/1000/prove 3.2±0.72s 2.3±0.51s -28.13%
fib/1000/total 2.2±0.23s 2.1±0.17s -4.55%
fib/10000/execute 10.6±0.85ms 9.9±0.09ms -6.60%
fib/10000/prove 7.4±0.39s 7.3±0.38s -1.35%
fib/10000/total 7.5±0.63s 7.2±0.45s -4.00%

Benchmark for macOS-default 01e999b

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.10ms 2.7±0.15ms -3.57%
fib/100/prove 3.7±0.06s 3.6±0.08s -2.70%
fib/100/total 3.7±0.06s 3.7±0.06s 0.00%
fib/1000/execute 3.0±0.08ms 3.0±0.06ms 0.00%
fib/1000/prove 3.7±0.06s 3.7±0.05s 0.00%
fib/1000/total 3.7±0.04s 3.7±0.06s 0.00%
fib/10000/execute 5.9±0.09ms 5.8±0.10ms -1.69%
fib/10000/prove 15.2±0.07s 15.0±0.08s -1.32%
fib/10000/total 15.3±0.10s 15.0±0.16s -1.96%

Benchmark for macOS-metal 01e999b

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.12ms 2.7±0.09ms -3.57%
fib/100/prove 851.7±4.60ms 796.1±5.67ms -6.53%
fib/100/total 878.5±5.01ms 818.9±4.80ms -6.78%
fib/1000/execute 3.0±0.04ms 3.0±0.05ms 0.00%
fib/1000/prove 867.8±3.62ms 814.2±3.67ms -6.18%
fib/1000/total 896.6±6.05ms 840.0±6.76ms -6.31%
fib/10000/execute 5.8±0.16ms 5.8±0.10ms 0.00%
fib/10000/prove 3.2±0.01s 3.1±0.01s -3.13%
fib/10000/total 3.2±0.01s 3.1±0.02s -3.13%

@github-actions
Copy link

Benchmark for Linux-cuda 17b2c2c

Click to hide benchmark
Test Base PR %
fib/100/execute 5.1±0.08ms 5.1±0.11ms 0.00%
fib/100/prove 936.0±4.32ms 768.4±6.22ms -17.91%
fib/100/total 945.1±3.95ms 765.9±4.32ms -18.96%
fib/1000/execute 5.8±0.10ms 5.7±0.13ms -1.72%
fib/1000/prove 960.6±4.85ms 800.1±3.88ms -16.71%
fib/1000/total 963.6±4.50ms 801.2±5.52ms -16.85%
fib/10000/execute 12.0±0.12ms 11.3±0.12ms -5.83%
fib/10000/prove 3.2±0.02s 2.5±0.01s -21.88%
fib/10000/total 3.2±0.02s 2.5±0.01s -21.88%

Benchmark for Linux-default 17b2c2c

Click to hide benchmark
Test Base PR %
fib/100/execute 6.9±0.89ms 6.7±0.45ms -2.90%
fib/100/prove 5.1±0.03s 5.1±0.08s 0.00%
fib/100/total 5.1±0.02s 5.0±0.02s -1.96%
fib/1000/execute 8.7±1.36ms 7.8±0.60ms -10.34%
fib/1000/prove 5.2±0.03s 5.1±0.03s -1.92%
fib/1000/total 5.2±0.02s 5.1±0.02s -1.92%
fib/10000/execute 14.9±1.45ms 14.0±0.51ms -6.04%
fib/10000/prove 21.2±0.07s 21.0±0.10s -0.94%
fib/10000/total 21.2±0.11s 20.9±0.08s -1.42%

Benchmark for macOS-default 17b2c2c

Click to hide benchmark
Test Base PR %
fib/100/execute 2.7±0.05ms 2.7±0.11ms 0.00%
fib/100/prove 3.7±0.08s 3.6±0.05s -2.70%
fib/100/total 3.7±0.04s 3.6±0.06s -2.70%
fib/1000/execute 3.0±0.10ms 2.9±0.17ms -3.33%
fib/1000/prove 3.7±0.08s 3.7±0.05s 0.00%
fib/1000/total 3.7±0.05s 3.7±0.05s 0.00%
fib/10000/execute 5.9±0.06ms 5.6±0.14ms -5.08%
fib/10000/prove 15.2±0.07s 15.1±0.11s -0.66%
fib/10000/total 15.3±0.15s 15.1±0.13s -1.31%

Benchmark for macOS-metal 17b2c2c

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.12ms 2.7±0.09ms -3.57%
fib/100/prove 846.8±4.40ms 797.2±4.66ms -5.86%
fib/100/total 876.8±6.33ms 822.2±3.45ms -6.23%
fib/1000/execute 3.0±0.07ms 3.0±0.08ms 0.00%
fib/1000/prove 869.2±7.09ms 816.9±4.71ms -6.02%
fib/1000/total 896.1±4.45ms 842.2±2.53ms -6.01%
fib/10000/execute 5.8±0.18ms 5.7±0.07ms -1.72%
fib/10000/prove 3.3±0.01s 3.1±0.01s -6.06%
fib/10000/total 3.3±0.01s 3.1±0.01s -6.06%

Copy link
Contributor

@SchmErik SchmErik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a lot of knowledge on the specific prover change but everything else looks good to me. I'll approve but maybe @jbruestle or @shkoo could take a look at that portion?

@github-actions
Copy link

Benchmark for Linux-cuda

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for Linux-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-default 62f5b09

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.17ms 2.8±0.13ms 0.00%
fib/100/prove 3.7±0.08s 3.6±0.04s -2.70%
fib/100/total 3.7±0.08s 3.7±0.04s 0.00%
fib/1000/execute 3.1±0.06ms 2.9±0.04ms -6.45%
fib/1000/prove 3.7±0.07s 3.6±0.08s -2.70%
fib/1000/total 3.7±0.09s 3.7±0.06s 0.00%
fib/10000/execute 6.0±0.08ms 5.8±0.14ms -3.33%
fib/10000/prove 15.2±0.22s 15.0±0.13s -1.32%
fib/10000/total 15.3±0.08s 15.0±0.10s -1.96%

Benchmark for macOS-metal 62f5b09

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.04ms 2.6±0.06ms -7.14%
fib/100/prove 848.2±4.31ms 806.2±6.24ms -4.95%
fib/100/total 877.1±6.45ms 825.2±7.30ms -5.92%
fib/1000/execute 3.0±0.06ms 2.9±0.08ms -3.33%
fib/1000/prove 867.4±2.48ms 825.1±5.70ms -4.88%
fib/1000/total 893.2±6.87ms 840.5±10.05ms -5.90%
fib/10000/execute 5.8±0.04ms 5.7±0.16ms -1.72%
fib/10000/prove 3.3±0.01s 3.1±0.02s -6.06%
fib/10000/total 3.3±0.01s 3.1±0.01s -6.06%

@flaub flaub merged commit 9b2d494 into main Aug 31, 2023
20 checks passed
@flaub flaub deleted the flaub/hal branch August 31, 2023 22:35
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.

None yet

2 participants