Skip to content

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

@dkales

Description

@dkales

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions