-
Notifications
You must be signed in to change notification settings - Fork 85
ARM: default to NUDUPL squaring, drop phased pipeline, and add NUDUPL profiling + CI reliability fixes #297
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
c2f6b39
Port optimized VDF GCD path to ARM (aarch64/arm64)
hoffmang9 eae35d1
thread_local ARM UV callback; vdf_bench include/defs at file scope
hoffmang9 63cf20c
Address cursor review issues and enable vdf-client testing on Macos ARM
hoffmang9 70d2127
Revert to minimal chagnes to compile vdf on macos-arm
hoffmang9 9b5751e
fix bug and add make clean to the vdf makefile
hoffmang9 ffcb8a6
Fix bugs found by ASAN
hoffmang9 edc4461
various fixes to threading etc for ARM
hoffmang9 acd6cb4
Fix various TSAN and ASAN surfaced issues
hoffmang9 4841124
conditionally check before brew installing e.g. cmake on MacOS
hoffmang9 2ef7bbb
take a different conditional strategy for cibuildwheel
hoffmang9 d9a1e65
Refactor to enhance speed and tighten restrictions on ARM
hoffmang9 63f27e9
Tighten tolerances and fix TSAN bug
hoffmang9 cfa3198
Continue optimizing on ARM
hoffmang9 4b322d5
consolidate setting base bits
hoffmang9 e4d9a85
IPS in the 90K range and lots of instrumenting
hoffmang9 1d7e74a
Don't automatically build fast_wrapper_test
hoffmang9 9a5dc61
Address TSAN issue
hoffmang9 15104dc
Additional uv optimizations and fixes for CI failures
hoffmang9 a846d1d
Fix gcc issues
hoffmang9 f0ec03c
Fix the rust fuzz test and add some more performance
hoffmang9 043a3af
Additional significant optimizations on ARM64 Mac
hoffmang9 0e784f3
Lets call 135.3K ips on MacOS ARM64 good enough for now
hoffmang9 295a88b
Final optimizations, update the README, attempt o fix long rust fuzz …
hoffmang9 0353c91
make entered_after_single_slow diagnostics consistent and stop overst…
hoffmang9 69ed50a
Add more tests for these changes
hoffmang9 1a7c8b6
Restore rust fuzzer
hoffmang9 32a2261
Update the Readme and speed up Rust fuzzing
hoffmang9 7ac15d7
Fix readme parsing on Windows
hoffmang9 832b931
get rust fuzzer running again
hoffmang9 965f07c
fix MacOS Intel rust build issue
hoffmang9 f342713
Fix transient ubuntu apt get issues
hoffmang9 b96d68f
fix test passes 1-byte buffer as 100-byte form
hoffmang9 022a5de
Fix leftover dead code path
hoffmang9 d0391b0
Fix possible divide by zero in metrics
hoffmang9 58c4865
Note the changes to prover_test in README.md
hoffmang9 a88eede
Fix possible hang from reading an uninitialized “iter 0” entry
hoffmang9 7201f58
Fix README statements about rust tests
hoffmang9 22e1261
NUDUPL won. remove ARM alt path and much of the instrumentation to ti…
hoffmang9 194ed80
Fix wheel builds
hoffmang9 84534b7
revert-unrelated-changes
hoffmang9 f58f2c1
Add a few things back in
hoffmang9 5e453f8
fix Windows builds, work around ubuntu runner silliness
hoffmang9 292dfb8
Fixed the ASAN LeakSanitizer leak
hoffmang9 46ef9b3
address mac cibuildwheel flakiness, bring back the short prover test …
hoffmang9 d15e489
fix PulmarkReducer created inside loop
hoffmang9 16abd8f
update README.md
hoffmang9 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,95 @@ | ||
| /* | ||
| * ARM C++ fallback implementation. Include this from exactly one .cpp per binary | ||
| * when ARCH_ARM (after vdf.h so all types are available). | ||
| */ | ||
| #if defined(ARCH_ARM) | ||
|
|
||
| thread_local void (*gcd_unsigned_arm_uv_callback)(int index, const array<array<uint64, 2>, 2>& uv, int parity) = nullptr; | ||
|
|
||
| namespace { | ||
|
|
||
| thread_local asm_code::asm_func_gcd_unsigned_data* g_arm_gcd_data = nullptr; | ||
| thread_local int g_arm_iter_count = 0; | ||
|
|
||
| void arm_uv_callback(int index, const array<array<uint64, 2>, 2>& uv, int parity) { | ||
| g_arm_iter_count = index + 1; | ||
| asm_code::asm_func_gcd_unsigned_data* data = g_arm_gcd_data; | ||
| if (!data || !data->out_uv_addr) return; | ||
|
|
||
| uint64* entry = data->out_uv_addr + index * 8; | ||
| entry[0] = uv[0][0]; | ||
| entry[1] = uv[1][0]; | ||
| entry[2] = uv[0][1]; | ||
| entry[3] = uv[1][1]; | ||
| entry[4] = static_cast<uint64>(parity); | ||
| entry[5] = 0; | ||
| entry[6] = 0; | ||
| entry[7] = 0; | ||
| } | ||
|
|
||
| void load_limbs_to_fixed_integer(uint64* limbs, fixed_integer<uint64, gcd_size>& out) { | ||
| integer tmp; | ||
| mpz_import(tmp.impl, gcd_size, -1, sizeof(uint64), -1, 0, limbs); | ||
| out = fixed_integer<uint64, gcd_size>(tmp); | ||
| } | ||
|
|
||
| void store_fixed_integer_to_limbs(const fixed_integer<uint64, gcd_size>& in, uint64* limbs) { | ||
| for (int i = 0; i < gcd_size; i++) { | ||
| limbs[i] = in[i]; | ||
| } | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| extern "C" int asm_arm_func_gcd_unsigned(asm_code::asm_func_gcd_unsigned_data* data) { | ||
| assert(data != nullptr); | ||
| assert(data->a != nullptr && data->b != nullptr); | ||
| assert(data->a_2 != nullptr && data->b_2 != nullptr); | ||
| assert(data->threshold != nullptr); | ||
|
|
||
| fixed_integer<uint64, gcd_size> a, b, threshold; | ||
| load_limbs_to_fixed_integer(data->a, a); | ||
| load_limbs_to_fixed_integer(data->b, b); | ||
| load_limbs_to_fixed_integer(data->threshold, threshold); | ||
|
|
||
| if (a < b) { | ||
| std::swap(a, b); | ||
| } | ||
| if (b <= threshold) { | ||
| return -1; | ||
| } | ||
|
|
||
| array<fixed_integer<uint64, gcd_size>, 2> ab = {a, b}; | ||
| array<fixed_integer<uint64, gcd_size>, 2> uv; | ||
| uv[0] = fixed_integer<uint64, gcd_size>(integer(1)); | ||
| uv[1] = fixed_integer<uint64, gcd_size>(integer(0)); | ||
| int parity = 1; | ||
|
|
||
| g_arm_gcd_data = data; | ||
| gcd_unsigned_arm_uv_callback = arm_uv_callback; | ||
|
|
||
| gcd_unsigned<gcd_size>(ab, uv, parity, threshold); | ||
|
|
||
| gcd_unsigned_arm_uv_callback = nullptr; | ||
| int iter = g_arm_iter_count; | ||
| g_arm_gcd_data = nullptr; | ||
| g_arm_iter_count = 0; | ||
|
|
||
| store_fixed_integer_to_limbs(ab[0], data->a_2); | ||
| store_fixed_integer_to_limbs(ab[1], data->b_2); | ||
| store_fixed_integer_to_limbs(ab[0], data->a); | ||
| store_fixed_integer_to_limbs(ab[1], data->b); | ||
|
|
||
| data->iter = iter; | ||
|
|
||
| if (data->out_uv_counter_addr) { | ||
| *data->out_uv_counter_addr = data->uv_counter_start + iter; | ||
|
hoffmang9 marked this conversation as resolved.
Outdated
|
||
| } | ||
| if (data->out_uv_addr && iter > 0) { | ||
| data->out_uv_addr[(iter - 1) * 8 + 5] = 1; | ||
| } | ||
|
|
||
| return 0; | ||
|
hoffmang9 marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| #endif | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.