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

Fix HEXL benchmark performance degradation #416

Merged
merged 1 commit into from Nov 12, 2021

Conversation

fboemer
Copy link
Contributor

@fboemer fboemer commented Nov 8, 2021

This PR fixes some performance degradation on the HEXL-enabled benchmarks, observed on ICX with clang-12. See below for one example, where this PR yields ~3.8x speedup on the N=8192 low-level NTT benchmarks.

To the best of my knowledge, using seal::UniformRandomGenerator turns out to be slow enough to cause some AVX512 transitions between benchmark iterations. AVX512 transitions also likely explains some of the strange runtime behavior described in #386. This PR switches to uniform_int_distribution for the benchmarks, which is fast enough to avoid the AVX512 transitions.

  Current SEAL Current SEAL uniform_int_dist uniform_int_dist Speedup Speedup
BM HEXL=OFF HEXL=ON HEXL=OFF HEXL=ON HEXL=OFF HEXL=ON
n=8192 / log(q)=0 / UTIL / NTTForwardLowLevel 112 45.8 112 11.6 1.00 3.95
n=8192 / log(q)=0 / UTIL / NTTInverseLowLevel 83.4 46.1 83.1 12.3 1.00 3.75
n=8192 / log(q)=0 / UTIL / NTTForwardLowLevelLazy 69.1 43.5 68.9 11 1.00 3.95
n=8192 / log(q)=0 / UTIL / NTTInverseLowLevelLazy 81.6 45.4 81.2 12.1 1.00 3.75

@WeiDaiWD WeiDaiWD merged commit 66ed03d into microsoft:contrib Nov 12, 2021
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.

None yet

2 participants