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

Enable a faster backend for OpenFHE #1209

Open
j2kun opened this issue Dec 17, 2024 · 2 comments
Open

Enable a faster backend for OpenFHE #1209

j2kun opened this issue Dec 17, 2024 · 2 comments
Labels
dialect: openfhe Issues related to the openfhe dialect

Comments

@j2kun
Copy link
Collaborator

j2kun commented Dec 17, 2024

Cf. #1195 for discussion of the impact. We will need to add OpenMP as a dependency.

@j2kun j2kun added the dialect: openfhe Issues related to the openfhe dialect label Dec 17, 2024
@j2kun
Copy link
Collaborator Author

j2kun commented Dec 17, 2024

We patch in the openfhe config that would be generated by Cmake here: https://github.com/google/heir/blob/main/bazel/openfhe/add_config_core.patch

First step is figuring out what the right generated header file is to replace that patch, then work through build issues.

@ZenithalHourlyRate do you have a copy of the generated src/core/include/config_core.h that came with your faster build from #1195 ?

@ZenithalHourlyRate
Copy link
Collaborator

I was just using openfhe-development, not even openfhe-hexl.

$ cat build/src/core/config_core.h
//==================================================
// DO NOT TOUCH THIS FILE! It is generated by cmake
//==================================================
#ifndef __CMAKE_GENERATED_CONFIG_CORE_H__
#define __CMAKE_GENERATED_CONFIG_CORE_H__

/* #undef WITH_BE2 */
#define WITH_BE4
/* #undef WITH_NOISE_DEBUG */
/* #undef WITH_NTL */
/* #undef WITH_TCM */

#define CKKS_M_FACTOR 1
#define HAVE_INT128 TRUE
#define HAVE_INT64 TRUE
#define MATHBACKEND 4
#define NATIVEINT 64

I think the real problem is these lines

OPENFHE_DEFINES = [
"MATHBACKEND=2",
"OMP_NUM_THREADS=1",

I tried to delete the "OMP_NUM_THREADS=1" line but the resulting program is still single threaded. Do not know why there is such limitation, maybe it is related to bazel job control?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialect: openfhe Issues related to the openfhe dialect
Projects
None yet
Development

No branches or pull requests

2 participants