Skip to content

Fix HEXL benchmark performance degradation#416

Merged
WeiDaiWD merged 1 commit into
microsoft:contribfrom
fboemer:fboemer/faster-benchmark-random
Nov 12, 2021
Merged

Fix HEXL benchmark performance degradation#416
WeiDaiWD merged 1 commit into
microsoft:contribfrom
fboemer:fboemer/faster-benchmark-random

Conversation

@fboemer

@fboemer fboemer commented Nov 8, 2021

Copy link
Copy Markdown
Contributor

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.

2 participants