Faster PoT verification for CPUs that support AVX512F+VAES#3552
Faster PoT verification for CPUs that support AVX512F+VAES#3552
Conversation
40b1904 to
4bd0793
Compare
4bd0793 to
4508aee
Compare
|
Looks like Rust toolchain upgrade is needed here, will wait for #3535 |
teor2345
left a comment
There was a problem hiding this comment.
Looks fine to me once compilation is fixed.
From the tracking issue it looks like there's a CPU feature missing, and it's still unstable in nightly: |
| //! Proof of time implementation. | ||
|
|
||
| #![cfg_attr(target_arch = "x86_64", feature(stdarch_x86_avx512))] | ||
| #![cfg_attr(target_arch = "x86_64", feature(avx512_target_feature, stdarch_x86_avx512))] |
There was a problem hiding this comment.
There are more problems with code than this. And this will not be needed once Rust toolchain is upgraded: rust-lang/rust#138940
In fact soon stdarch_x86_avx512 will not be needed either: rust-lang/rust#111137 (comment)
|
Last commit is neither necessary nor sufficient, just wait for toolchain to be upgraded and it will all light up green and compile successfully. |
We'll need a later nightly, the current one in PR #3535 does not include stabilisation of |
|
True, but it is fairly trivial to upgrade there from where #3535 stands |
I've asked for the later nightly, we might as well do it all at once. |
3561e14 to
bb4d9af
Compare
|
Pushed another commit that reduces usage of This should make life easier for auditors. |
|
Backported nazar-pc/abundance#269 too in the last commit, it implements VAES support without AVX512F and even regular AES-NI support for older CPUs, basically covering everything on x86-64 side. |
|
And I ended up implementing optimized version of both proving and verification for aarch64 too (no SVE AES because no intrinsics in standard library yet): nazar-pc/abundance#270 Will submit as a separate PR once this is merged. |
These have now been marked as safe: |
|
Yes, but |
I understand it will take some time to upstream, this was more about any reviews/audits of the "unsafe" code. |
|
That |
|
This is now ready for a merge with the 2025-05-31 nightly update. |
# Conflicts: # crates/subspace-proof-of-time/src/aes/x86_64.rs
|
AVX512 intrinsics were just stabilized in nightly-2025-06-08 and unsafe is no longer needed for them as well. |
Backport of nazar-pc/abundance#260, doubles PoT verification performance on my Zen 4 machine on top of #3551, which itself is ~10% faster than
main.Would be nice for someone to invest time into optimizing verification for Aarch64, there are both generic and low-level optimized examples now.
To be merged after #3551.
Code contributor checklist: