-
Notifications
You must be signed in to change notification settings - Fork 36
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
Feat/Msm with gpu (metal shader language) on laptop #150
Merged
Merged
Changes from 65 commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
c760b2c
feat(msm_benchmark): integrate zprize2022 TrapdoorTech msm algo on Rust
moven0831 01b036d
refactor(msm_benchmark): separate arkworks_pippenger as baseline from…
moven0831 2f6ce16
refactor(benchmark): rewrite scalars and points gen to preprocess
moven0831 51828ae
refactor(baseline): rewrite benchmark method to 2^10 x 2^16 instance …
moven0831 bcc0ebe
refactor: modify benchmark standard to match zprize works
moven0831 4e19e96
feat(baseline): adopt zprize benchmarking method and enable multi ben…
moven0831 3344167
feat(ffi): integrate trapdoor tech msm in mopro-ffi
FoodChain1028 af11bd4
feat(ffi): add test of trapdoor tech msm
FoodChain1028 e36cab6
fix(ffi): modify input for trapdoor msm
FoodChain1028 47a2872
fix: update arkowrks pippenger input/ ouput
FoodChain1028 6c955cf
fix: update trapdoor tech zprize msm input/ ouput
FoodChain1028 6de77ea
fix: add the feature flag back
FoodChain1028 b385344
fix: modify msm functions input
FoodChain1028 0ee47bc
fix: lint
FoodChain1028 6127e1e
feat(benchmark data): accelerate the benchmark data generation. 2^20 …
moven0831 75f1b73
feat: add a README file for gpu-exploration
FoodChain1028 86ace53
feat(gpu-explorations): benchmark msm on BN254 curve, which leads to …
moven0831 1a714da
feat(gpu-explorations): integrated halo2curve's msm and benchmarks
moven0831 a446f0a
refactor(msm): disable other msm's except the arkworks 0.4 msm
moven0831 69a39f0
feat(metal): provide basic structure of metal backend and rust wrappe…
moven0831 79447ab
fix: compile pathway error
FoodChain1028 b3a401c
chore: fix shader path config and identify parallel part of arkworks'…
moven0831 52dee44
feat(metal): draft msm wrapper in Rust for metal backend
moven0831 92cdb5f
doc: added reference for bls-12-381 and bn254
FoodChain1028 e233fe9
chore(metal): add python helper to compute BN254 params
moven0831 2438bdc
feat(metal): introduce u256 type implementation and bn254 params
moven0831 6001bc8
docs(metal): generate abstract addition chain instructions for furthe…
moven0831 9d1684f
feat: add instruction for bn254 addchain
FoodChain1028 79c28e6
test(metal): add fixed-params tests for bn254 operations
moven0831 7f98e76
test(metal): update u256 type and focus on add test
moven0831 bea50c8
test(metal): fix To and From BigInt format, provide better view on ad…
moven0831 f7c32f6
fix: make the path root-compatible
FoodChain1028 ac23566
chore: added error test
FoodChain1028 27967fa
feat: compiled metal lib
FoodChain1028 36730e1
chore(metal): update test log for better view on the bug
moven0831 0e5d8e5
fix(metal): correct logic of {to, from}_u32_limbs and addition logic …
moven0831 e7c1239
fix(metal): correct data repr logic between metal and arkworks and co…
moven0831 519596d
fix(metal): update bn254 tests and fix logic
FoodChain1028 67ae3f1
fix(metal): update bn254 neg test
FoodChain1028 255802a
fix(metal): use larger result arrays
FoodChain1028 554968a
test(metal): add & sub fuzzing test for Fq_bn254
moven0831 5b8c994
fix(metal): correct the Montgomery Mul. Constant and complete mul test
moven0831 f71cbd2
test(metal): add pow test for bn254 base field
moven0831 cfca30a
fix(metal): fix logic for msm usage on bn254
moven0831 c8b1c4f
fix(metal): correct the metal buffer index
FoodChain1028 d9a7279
refactor(metal): utils module for data format between metal (GPU) and…
moven0831 2270ad4
fix(metal): correct encode/decode logic
moven0831 3bc0b75
test(metal): add test for msm accumulation phase to ensure correctnes…
moven0831 d5a62e7
test(metal): add test to bn254 points arithmetics
moven0831 e83098b
fix: modified double_in_place
FoodChain1028 71cde1e
refactor(metal): add limbs_conversion module for to/from metal
moven0831 3a6d791
feat(metal): implement arkworks msm accumulation logic in metal
moven0831 c4fdea6
refactor(metal): add Fq conversion to/from limbs for metal
moven0831 a9f73a9
feat(metal): compute msm bucket in window-wise fashion
moven0831 8fef337
test(metal): add msm wrapper test on metal implementation
moven0831 edb21d6
feat(metal): implement msm with enabling GPU computation on accumulat…
moven0831 909e0b2
refactor(metal): update paths for metal shader files
moven0831 c1e61e0
feat: integrate metal msm into mopro-ffi
FoodChain1028 f0a5449
feat(metal): add mont_reduction module for gpu result conversion
moven0831 9659393
test(metal): enable latest limb conversion and remove unused module
moven0831 cfe112a
feat(metal): optimize msm bucket computation with window-wise accumul…
moven0831 0dd64fa
feat(metal): Rust wrapper for latest metal msm accumulation
moven0831 a3003d3
chore: update the instanceSize and numInstance in metal to make consi…
FoodChain1028 8eed163
chore: remove commented code for bls12_377 curve parsing
moven0831 bf0ae37
fix: correct warning for GPU explorations code
moven0831 e99f439
chore(gpu-benchmarks): correct minor changes
moven0831 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
mopro-core/gpu_explorations/benchmarks/arkworks_pippenger_benchmark.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
msm_size,num_msm,avg_processing_time(ms) | ||
8,5,3.302555666666667 | ||
8,10,1.7059585000000002 | ||
12,5,11.544680666666668 | ||
12,10,11.7898874 | ||
16,5,128.50465099999997 | ||
16,10,139.1740167 | ||
18,5,472.9359916 | ||
18,10,477.0808459000001 | ||
8,10,1.3042915 | ||
12,10,8.4526458 | ||
16,10,82.19201659999999 | ||
18,10,307.24009179999996 | ||
20,10,1140.8793625 | ||
22,10,4160.4375503 |
7 changes: 7 additions & 0 deletions
7
mopro-core/gpu_explorations/benchmarks/halo2curve_multicore_msm_benchmark.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
msm_size,num_msm,avg_processing_time(ms) | ||
8,10,2.72165 | ||
12,10,12.6313959 | ||
16,10,116.79077500000001 | ||
18,10,410.9840459 | ||
20,10,1544.3454166 | ||
22,10,5254.7052669 |
7 changes: 7 additions & 0 deletions
7
mopro-core/gpu_explorations/benchmarks/halo2curve_singlecore_msm_benchmark.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
msm_size,num_msm,avg_processing_time(ms) | ||
8,10,5.959329 | ||
12,10,39.155546 | ||
16,10,464.353125 | ||
18,10,1649.2290374 | ||
20,10,6154.858971 | ||
22,10,20962.7212291 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am interested about why halo2curve is benchmarked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, TLDR Carlos suggested that Halo2curve's msm is state-of-the-art. So we get benchmarks of it.
As you can see below, indeed, Halo2curve performs well with "asm" feature. However, this acceleration feature is only compatible with x86_64 architecture. Therefore, we didn't take this as a reference for our future work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will they support acceleration feature in the future? or it is not possible in arm?
so it will be a legacy benchmark?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've talked to the team and it's actually possible in arm for "asm" feature but they're not going to support this in the plan atm.