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

devirgo style on phase 1 #83

Merged
merged 3 commits into from
Jul 15, 2024
Merged

devirgo style on phase 1 #83

merged 3 commits into from
Jul 15, 2024

Conversation

hero78119
Copy link
Collaborator

@hero78119 hero78119 commented Jul 2, 2024

optimisation type

  • same memory consumption, + throughtput

Change Scope

  • merge phase-1 two steps into single step and applied similar tricks to move parallism, refer to prev work phase-2
  • some singer utility improvement: auto-implement phaseX_idxes_map and code clean up, few debug assertion and refactor.

benchmark results on evm add 1

EVM add throughput improvement can be up to 20x

benchmark on instance > 2^13 will run out of 64GB memory. It's due to some existing design where cloning witness between nodes input/output. We can address this issue in later PR.

| #instance | master delay  | new design delay (s) | Improvement |
|-----------|---------------|----------------------|-------------|
| 2^10      | 0.317735725s  | 0.134839749s         | 2.36x       |
| 2^11      | 0.905547894s  | 0.203267641s         | 4.45x       |
| 2^12      | 3.063349368s  | 0.3163026s           | 9.48x       |
| 2^13      | 11.522649178s | 0.556362988s         | 20.71x      |

benchmark results on keccak 256 1

keccak throughput improve on low instances and remain the same on high instances

| #instance | speedup (with p < 0.05)      |
|-----------|------------------------------|
| 1         | -13.958% -13.331% -12.749% |
| 2         | -9.6296% -8.7916% -7.9326% |
| 4         | -7.7858% -7.3198% -6.8180% |
| 8         | -7.9653% -7.4081% -6.8336%  |
| 16        | -7.2831% -7.1579% -7.0342% |
| 32        | -5.6185% -5.3883% -5.1286% |
| 64        | -1.3313% -0.9198% -0.4998% |
| 128        | -3.5177% -2.2666% -0.9425% |
| 256        | -1.0312% -0.0618% +0.9341% |
| 512        | +0.8020% +1.4282% +2.1008% |

Footnotes

  1. AMD EPYC 9R14 (16 phy cores) + 32GB memory 2

@hero78119 hero78119 force-pushed the ming/rewrite_phase1 branch from f445826 to 220e0d4 Compare July 2, 2024 09:33
@hero78119 hero78119 marked this pull request as draft July 5, 2024 15:37
@hero78119
Copy link
Collaborator Author

TODO: use #[rustfmt::skip] to avoid format comment

@hero78119 hero78119 force-pushed the ming/rewrite_phase1 branch from 48107f3 to 0b47beb Compare July 8, 2024 03:54
@hero78119 hero78119 marked this pull request as ready for review July 8, 2024 03:54
@hero78119
Copy link
Collaborator Author

TODO: use #[rustfmt::skip] to avoid format comment

Done by disable wrap_comment in rustfmt.toml


// sumcheck: sigma = \sum_y( \sum_j f1^{(j)}(y) * g1^{(j)}(y))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this sigma = \sum_y( f1(y) * (\sum_j g1^{(j)}(y)))?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

more precisely, should be sigma = \sum_{t || y}(f1({t || y}) * (\sum_j g1^{(j)}({t || y})))
fixed in latest commit ad4a6d8

multilinear_extensions/src/mle.rs Outdated Show resolved Hide resolved
multilinear_extensions/src/mle.rs Outdated Show resolved Hide resolved
@hero78119 hero78119 force-pushed the ming/rewrite_phase1 branch from 6b1bcd1 to ad4a6d8 Compare July 9, 2024 03:47
@dreamATD dreamATD self-requested a review July 15, 2024 12:27
@hero78119 hero78119 force-pushed the ming/rewrite_phase1 branch from ad4a6d8 to e843bf1 Compare July 15, 2024 12:41
@dreamATD dreamATD merged commit b230551 into master Jul 15, 2024
3 of 4 checks passed
yczhangsjtu pushed a commit that referenced this pull request Aug 12, 2024
* devirgo style on phase 1

instruction add example with prove/verify

* optimize sumcheck algo

* fix comment
hero78119 added a commit that referenced this pull request Sep 30, 2024
* devirgo style on phase 1

instruction add example with prove/verify

* optimize sumcheck algo

* fix comment
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.

2 participants