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

cmake: Add option to select micro-arch, use x86-64-v2 by default #548

Merged
merged 3 commits into from
Apr 27, 2023

Conversation

chfast
Copy link
Member

@chfast chfast commented Jan 10, 2023

No description provided.

@chfast
Copy link
Member Author

chfast commented Jan 10, 2023

Clang 15, Haswell

baseline/execute/main/blake2b_huff/empty_mean                                -0.0666         -0.0666            10             9            10             9
bnocgoto/execute/main/blake2b_huff/empty_mean                                -0.0562         -0.0562            12            11            12            11
baseline/execute/main/blake2b_huff/8415nulls_mean                            -0.0727         -0.0727           617           572           617           572
bnocgoto/execute/main/blake2b_huff/8415nulls_mean                            -0.0540         -0.0540           724           685           724           685
baseline/execute/main/blake2b_shifts/8415nulls_mean                          -0.0403         -0.0403          5963          5723          5963          5723
bnocgoto/execute/main/blake2b_shifts/8415nulls_mean                          +0.0002         +0.0002          7073          7075          7073          7075
baseline/execute/main/sha1_divs/empty_mean                                   -0.0196         -0.0196            44            43            44            43
bnocgoto/execute/main/sha1_divs/empty_mean                                   +0.0174         +0.0174            46            47            46            47
baseline/execute/main/sha1_divs/5311_mean                                    -0.0197         -0.0197          3502          3433          3502          3433
bnocgoto/execute/main/sha1_divs/5311_mean                                    +0.0131         +0.0131          3668          3716          3668          3716
baseline/execute/main/sha1_shifts/empty_mean                                 -0.0247         -0.0247            23            22            23            22
bnocgoto/execute/main/sha1_shifts/empty_mean                                 -0.0186         -0.0186            25            25            25            25
baseline/execute/main/sha1_shifts/5311_mean                                  -0.0224         -0.0224          1881          1838          1881          1838
bnocgoto/execute/main/sha1_shifts/5311_mean                                  -0.0006         -0.0006          2034          2032          2034          2032
baseline/execute/main/snailtracer/benchmark_mean                             -0.0269         -0.0269         32389         31518         32389         31518
bnocgoto/execute/main/snailtracer/benchmark_mean                             -0.0257         -0.0257         34465         33580         34465         33580
baseline/execute/main/structarray_alloc/nfts_rank_mean                       -0.0706         -0.0706           458           426           458           426
bnocgoto/execute/main/structarray_alloc/nfts_rank_mean                       -0.0295         -0.0295           478           464           478           464
baseline/execute/main/swap_math/spent_mean                                   -0.0322         -0.0322             2             2             2             2
bnocgoto/execute/main/swap_math/spent_mean                                   -0.0158         -0.0158             3             3             3             3
baseline/execute/main/swap_math/received_mean                                -0.0133         -0.0133             2             2             2             2
bnocgoto/execute/main/swap_math/received_mean                                -0.0120         -0.0120             3             3             3             3
baseline/execute/main/swap_math/insufficient_liquidity_mean                  -0.0120         -0.0120             1             1             1             1
bnocgoto/execute/main/swap_math/insufficient_liquidity_mean                  +0.0065         +0.0065             2             2             2             2
baseline/execute/main/weierstrudel/1_mean                                    -0.0090         -0.0090           145           144           145           144
bnocgoto/execute/main/weierstrudel/1_mean                                    -0.0019         -0.0019           149           149           149           149
baseline/execute/main/weierstrudel/15_mean                                   -0.0098         -0.0098          1444          1430          1444          1430
bnocgoto/execute/main/weierstrudel/15_mean                                   +0.0059         +0.0060          1493          1502          1493          1502
OVERALL_GEOMEAN                                                              -0.0221         -0.0221             0             0             0             0

@chfast
Copy link
Member Author

chfast commented Jan 10, 2023

GCC 12, Haswell

baseline/execute/main/blake2b_huff/empty_mean                                -0.0777         -0.0776            10             9            10             9
bnocgoto/execute/main/blake2b_huff/empty_mean                                -0.0724         -0.0724            10            10            10            10
baseline/execute/main/blake2b_huff/8415nulls_mean                            -0.0725         -0.0725           641           595           641           595
bnocgoto/execute/main/blake2b_huff/8415nulls_mean                            -0.0735         -0.0735           650           602           650           602
baseline/execute/main/blake2b_shifts/8415nulls_mean                          -0.0178         -0.0178          6051          5943          6051          5943
bnocgoto/execute/main/blake2b_shifts/8415nulls_mean                          -0.0438         -0.0438          6857          6556          6857          6556
baseline/execute/main/sha1_divs/empty_mean                                   -0.0117         -0.0117            43            43            43            43
bnocgoto/execute/main/sha1_divs/empty_mean                                   -0.0191         -0.0191            45            44            45            44
baseline/execute/main/sha1_divs/5311_mean                                    -0.0117         -0.0117          3521          3480          3521          3480
bnocgoto/execute/main/sha1_divs/5311_mean                                    -0.0157         -0.0157          3535          3480          3535          3480
baseline/execute/main/sha1_shifts/empty_mean                                 -0.0043         -0.0043            21            21            21            21
bnocgoto/execute/main/sha1_shifts/empty_mean                                 -0.0335         -0.0335            22            21            22            21
baseline/execute/main/sha1_shifts/5311_mean                                  -0.0048         -0.0048          1694          1686          1694          1686
bnocgoto/execute/main/sha1_shifts/5311_mean                                  -0.0153         -0.0153          1752          1725          1752          1725
baseline/execute/main/snailtracer/benchmark_mean                             -0.0239         -0.0239         32646         31866         32646         31866
bnocgoto/execute/main/snailtracer/benchmark_mean                             -0.0139         -0.0139         33506         33040         33505         33040
baseline/execute/main/structarray_alloc/nfts_rank_mean                       -0.0494         -0.0494           415           394           415           394
bnocgoto/execute/main/structarray_alloc/nfts_rank_mean                       -0.0693         -0.0692           437           407           437           407
baseline/execute/main/swap_math/spent_mean                                   -0.0040         -0.0040             2             2             2             2
bnocgoto/execute/main/swap_math/spent_mean                                   -0.0029         -0.0029             2             2             2             2
baseline/execute/main/swap_math/received_mean                                +0.0178         +0.0178             2             2             2             2
bnocgoto/execute/main/swap_math/received_mean                                -0.0227         -0.0227             3             3             3             3
baseline/execute/main/swap_math/insufficient_liquidity_mean                  -0.0213         -0.0213             1             1             1             1
bnocgoto/execute/main/swap_math/insufficient_liquidity_mean                  -0.0087         -0.0087             1             1             1             1
baseline/execute/main/weierstrudel/1_mean                                    -0.0097         -0.0097           176           174           176           174
bnocgoto/execute/main/weierstrudel/1_mean                                    -0.0102         -0.0102           174           172           174           172
baseline/execute/main/weierstrudel/15_mean                                   -0.0033         -0.0033          1662          1656          1662          1656
bnocgoto/execute/main/weierstrudel/15_mean                                   -0.0054         -0.0054          1649          1640          1649          1640
OVERALL_GEOMEAN                                                              -0.0253         -0.0253             0             0             0             0

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #548 (cc81572) into master (fcf6b33) will decrease coverage by 0.03%.
The diff coverage is 60.00%.

❗ Current head cc81572 differs from pull request most recent head 97f9124. Consider uploading reports for the commit 97f9124 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #548      +/-   ##
==========================================
- Coverage   97.30%   97.28%   -0.03%     
==========================================
  Files          79       80       +1     
  Lines        7679     7684       +5     
==========================================
+ Hits         7472     7475       +3     
- Misses        207      209       +2     
Flag Coverage Δ
blockchaintests 65.14% <60.00%> (-0.03%) ⬇️
statetests 63.10% <60.00%> (-0.01%) ⬇️
unittests 94.83% <60.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/evmone/cpu_check.cpp 60.00% <60.00%> (ø)

... and 3 files with indirect coverage changes

@chfast
Copy link
Member Author

chfast commented Jan 10, 2023

GCC 12, Zen2

baseline/execute/main/blake2b_huff/empty_mean                                -0.0794         -0.0794            10             9            10             9
baseline/execute/main/blake2b_huff/8415nulls_mean                            -0.0785         -0.0784           632           583           632           583
baseline/execute/main/blake2b_shifts/8415nulls_mean                          +0.0059         +0.0058          6088          6124          6088          6123
baseline/execute/main/sha1_divs/empty_mean                                   -0.0148         -0.0148            45            44            45            44
baseline/execute/main/sha1_divs/5311_mean                                    -0.0143         -0.0143          3585          3534          3585          3534
baseline/execute/main/sha1_shifts/empty_mean                                 -0.0259         -0.0258            22            21            22            21
baseline/execute/main/sha1_shifts/5311_mean                                  -0.0400         -0.0399          1756          1686          1756          1686
baseline/execute/main/snailtracer/benchmark_mean                             -0.0042         -0.0041         31579         31446         31575         31447
baseline/execute/main/structarray_alloc/nfts_rank_mean                       -0.0340         -0.0340           398           385           398           385
baseline/execute/main/swap_math/spent_mean                                   -0.0231         -0.0229             2             2             2             2
baseline/execute/main/swap_math/received_mean                                -0.0535         -0.0533             2             2             2             2
baseline/execute/main/swap_math/insufficient_liquidity_mean                  -0.0464         -0.0464             1             1             1             1
baseline/execute/main/weierstrudel/1_mean                                    -0.0124         -0.0123           149           147           149           147
baseline/execute/main/weierstrudel/15_mean                                   -0.0001         -0.0000          1465          1464          1464          1464
OVERALL_GEOMEAN                                                              -0.0304         -0.0304             0             0             0             0

@yperbasis
Copy link
Member

I'd add a runtime check in the beginning of execution that terminates the program on a CPU not meeting x86-64-v2.

CMakeLists.txt Outdated Show resolved Hide resolved
@chfast chfast added the optimization Iproves performance without functional changes label Jan 12, 2023
@chfast chfast force-pushed the cmake_x86-64-v2 branch 5 times, most recently from 7034aa8 to 9942b02 Compare January 26, 2023 21:53
@chfast chfast marked this pull request as draft February 21, 2023 18:31
@chfast chfast force-pushed the cmake_x86-64-v2 branch 6 times, most recently from cc81572 to 595135f Compare April 23, 2023 19:50
@chfast chfast marked this pull request as ready for review April 23, 2023 19:51
@chfast
Copy link
Member Author

chfast commented Apr 23, 2023

Clang 16, Haswell

baseline/execute/main/blake2b_huff/empty_mean                                -0.1000         -0.1000            10             9            10             9
bnocgoto/execute/main/blake2b_huff/empty_mean                                -0.0385         -0.0385            11            10            11            10
baseline/execute/main/blake2b_huff/8415nulls_mean                            -0.0941         -0.0941           608           550           608           550
bnocgoto/execute/main/blake2b_huff/8415nulls_mean                            -0.0395         -0.0395           665           638           665           638
baseline/execute/main/blake2b_shifts/8415nulls_mean                          -0.0512         -0.0512          5800          5503          5800          5503
bnocgoto/execute/main/blake2b_shifts/8415nulls_mean                          -0.0026         -0.0026          6753          6735          6753          6735
baseline/execute/main/sha1_divs/empty_mean                                   -0.0177         -0.0177            43            43            43            43
bnocgoto/execute/main/sha1_divs/empty_mean                                   -0.0244         -0.0244            46            45            46            45
baseline/execute/main/sha1_divs/5311_mean                                    -0.0165         -0.0165          3483          3426          3483          3426
bnocgoto/execute/main/sha1_divs/5311_mean                                    -0.0162         -0.0162          3659          3600          3659          3600
baseline/execute/main/sha1_shifts/empty_mean                                 -0.0284         -0.0284            23            22            23            22
bnocgoto/execute/main/sha1_shifts/empty_mean                                 -0.0168         -0.0168            24            24            24            24
baseline/execute/main/sha1_shifts/5311_mean                                  -0.0267         -0.0267          1855          1805          1855          1805
bnocgoto/execute/main/sha1_shifts/5311_mean                                  -0.0210         -0.0210          1961          1920          1961          1920
baseline/execute/main/snailtracer/benchmark_mean                             -0.0281         -0.0281         31042         30171         31042         30170
bnocgoto/execute/main/snailtracer/benchmark_mean                             -0.0173         -0.0173         33072         32501         33072         32500
baseline/execute/main/structarray_alloc/nfts_rank_mean                       -0.0653         -0.0653           438           409           438           409
bnocgoto/execute/main/structarray_alloc/nfts_rank_mean                       -0.0305         -0.0305           461           447           461           447
baseline/execute/main/swap_math/spent_mean                                   -0.0241         -0.0241             2             2             2             2
bnocgoto/execute/main/swap_math/spent_mean                                   +0.0155         +0.0155             2             2             2             2
baseline/execute/main/swap_math/received_mean                                -0.0266         -0.0266             2             2             2             2
bnocgoto/execute/main/swap_math/received_mean                                +0.0129         +0.0129             3             3             3             3
baseline/execute/main/swap_math/insufficient_liquidity_mean                  -0.0358         -0.0358             1             1             1             1
bnocgoto/execute/main/swap_math/insufficient_liquidity_mean                  +0.0075         +0.0075             1             1             1             1
baseline/execute/main/weierstrudel/1_mean                                    +0.0299         +0.0299           150           155           150           155
bnocgoto/execute/main/weierstrudel/1_mean                                    +0.0249         +0.0249           154           158           154           158
baseline/execute/main/weierstrudel/15_mean                                   +0.0094         +0.0094          1472          1486          1472          1486
bnocgoto/execute/main/weierstrudel/15_mean                                   +0.0245         +0.0245          1514          1551          1514          1551
OVERALL_GEOMEAN                                                              -0.0218         -0.0218             0             0             0             0

@chfast
Copy link
Member Author

chfast commented Apr 23, 2023

GCC 12, Haswell

baseline/execute/main/blake2b_huff/empty_mean                                -0.0811         -0.0811            10             9            10             9
bnocgoto/execute/main/blake2b_huff/empty_mean                                -0.0653         -0.0653            10             9            10             9
baseline/execute/main/blake2b_huff/8415nulls_mean                            -0.0807         -0.0807           627           576           627           576
bnocgoto/execute/main/blake2b_huff/8415nulls_mean                            -0.0570         -0.0570           613           578           613           578
baseline/execute/main/blake2b_shifts/8415nulls_mean                          -0.0264         -0.0264          5860          5706          5860          5706
bnocgoto/execute/main/blake2b_shifts/8415nulls_mean                          -0.0134         -0.0134          6565          6477          6565          6477
baseline/execute/main/sha1_divs/empty_mean                                   -0.0021         -0.0021            42            42            42            42
bnocgoto/execute/main/sha1_divs/empty_mean                                   -0.0055         -0.0055            45            45            45            45
baseline/execute/main/sha1_divs/5311_mean                                    -0.0058         -0.0057          3398          3378          3398          3378
bnocgoto/execute/main/sha1_divs/5311_mean                                    -0.0060         -0.0060          3532          3511          3532          3511
baseline/execute/main/sha1_shifts/empty_mean                                 -0.0058         -0.0058            20            20            20            20
bnocgoto/execute/main/sha1_shifts/empty_mean                                 +0.0059         +0.0059            21            21            21            21
baseline/execute/main/sha1_shifts/5311_mean                                  -0.0019         -0.0019          1638          1635          1638          1635
bnocgoto/execute/main/sha1_shifts/5311_mean                                  +0.0023         +0.0023          1663          1667          1663          1667
baseline/execute/main/snailtracer/benchmark_mean                             -0.0280         -0.0280         32769         31852         32769         31852
bnocgoto/execute/main/snailtracer/benchmark_mean                             -0.0204         -0.0204         33237         32560         33237         32560
baseline/execute/main/structarray_alloc/nfts_rank_mean                       -0.0433         -0.0433           382           365           382           365
bnocgoto/execute/main/structarray_alloc/nfts_rank_mean                       -0.0470         -0.0470           392           374           392           374
baseline/execute/main/swap_math/spent_mean                                   +0.0224         +0.0224             2             2             2             2
bnocgoto/execute/main/swap_math/spent_mean                                   -0.0112         -0.0112             2             2             2             2
baseline/execute/main/swap_math/received_mean                                +0.0138         +0.0138             2             2             2             2
bnocgoto/execute/main/swap_math/received_mean                                -0.0114         -0.0114             2             2             2             2
baseline/execute/main/swap_math/insufficient_liquidity_mean                  +0.0203         +0.0203             1             1             1             1
bnocgoto/execute/main/swap_math/insufficient_liquidity_mean                  +0.0147         +0.0147             1             1             1             1
baseline/execute/main/weierstrudel/1_mean                                    +0.0170         +0.0170           172           175           172           175
bnocgoto/execute/main/weierstrudel/1_mean                                    +0.0059         +0.0059           170           171           170           171
baseline/execute/main/weierstrudel/15_mean                                   +0.0005         +0.0005          1650          1651          1650          1651
bnocgoto/execute/main/weierstrudel/15_mean                                   +0.0133         +0.0133          1607          1629          1607          1629
OVERALL_GEOMEAN                                                              -0.0146         -0.0146             0             0             0             0

@chfast chfast merged commit 6a4a31b into master Apr 27, 2023
@chfast chfast deleted the cmake_x86-64-v2 branch April 27, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Iproves performance without functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants