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

Enabling Intel HEXL leads to large noise consumption (for specific parameters) #385

Closed
dkales opened this issue Aug 23, 2021 · 2 comments · Fixed by intel/hexl#50
Closed

Comments

@dkales
Copy link

dkales commented Aug 23, 2021

While testing out the performance gains of the new INTEL HEXL dependency, we stumbled upon a strange case:

for our specific parameter set (plaintext_mod=4398046150657, N=16384, coeff_mod=BFVDefault) enabling HEXL uses up the full noise budget on a single ct-ct multiplication. This only happens when using HEXL on a machine that actually has avx512 instructions, the HEXL C++ implementation does not produce this behavior, nor does the SEAL implementation that does not use HEXL.

I've put together a minimal example here: https://github.com/dkales/seal_hexl_test
Here is the output for this on my machine (Intel(R) Core(TM) i5-1035G1) with feature_flags:

fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid md_clear flush_l1d arch_capabilities

SEAL_USE_INTEL_HEXL=ON

Initial noise: 342
Computing mult......done
Time: 66 milliseconds
Final noise: 0

SEAL_USE_INTEL_HEXL=OFF

Initial noise: 342
Computing mult......done
Time: 92 milliseconds
Final noise: 287

Using N=32768 and a comparable sized plaintext_mod works again (both HEXL=ON and HEXL=OFF have the same noise consumption)

If there something more to using Intel HEXL than just enabling it, I have not found it, even then I would expect the HEXL C++ implementation to agree with its AVX512 implementation.

If I can provide any more debug information, please let me know.
(also mentioning @fboemer since he contributed the HEXL integration)

@fboemer
Copy link
Contributor

fboemer commented Aug 24, 2021

@dkales , thanks for pointing this out and tagging me. It looks like the underlying issue comes from HEXL. We'll release HEXL v1.2.1 with this fix and update the SEAL integration PR (#375) with this fix as well.

@WeiDaiWD
Copy link
Contributor

It'll be released within a day. Thank you both!

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 a pull request may close this issue.

3 participants