fix(ci): force crt for 9, 10, 11 for table lookup

This commit is contained in:
rudy
2022-12-02 16:41:15 +01:00
committed by rudy-6-4
parent e2e6df322e
commit b742ac35ae
7 changed files with 23 additions and 3 deletions

View File

@@ -165,7 +165,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v3
with:
name: KeySetCacheV3
name: KeySetCaCheV4
path: KeySetCache
retention-days: 90
@@ -173,7 +173,7 @@ jobs:
uses: Remagpie/gha-remove-artifact@v1
if: ${{ github.ref == 'refs/heads/main' }}
with:
only-name: KeySetCacheV3
only-name: KeySetCaCheV4
max-count: 1
- name: Build the documentation

View File

@@ -16,7 +16,7 @@ CONCRETE_OPTIMIZER_DIR ?= $(shell pwd)/concrete-optimizer
KEYSETCACHEDEV=/tmp/KeySetCache
KEYSETCACHECI ?= ../KeySetCache
KEYSETCACHENAME ?= KeySetCacheV3
KEYSETCACHENAME ?= KeySetCacheV4
HPX_VERSION?=1.7.1
HPX_URL=https://github.com/STEllAR-GROUP/hpx/archive/refs/tags/$(HPX_VERSION).tar.gz

View File

@@ -337,6 +337,18 @@ template <> struct llvm::yaml::MappingTraits<EndToEndDesc> {
desc.v0Constraint->p = v0constraint[0];
desc.v0Constraint->norm2 = v0constraint[1];
}
std::string str_encoding = "auto";
io.mapOptional("encoding", str_encoding);
if (str_encoding == "auto") {
desc.encoding = concrete_optimizer::Encoding::Auto;
} else if (str_encoding == "native") {
desc.encoding = concrete_optimizer::Encoding::Native;
} else if (str_encoding == "crt") {
desc.encoding = concrete_optimizer::Encoding::Crt;
} else {
io.setError("encoding can only be native or crt");
}
mlir::concretelang::LargeIntegerParameter largeInterger;
io.mapOptional("large-integer-crt-decomposition",
largeInterger.crtDecomposition);

View File

@@ -51,6 +51,7 @@ struct EndToEndDesc {
std::vector<TestDescription> tests;
llvm::Optional<mlir::concretelang::V0Parameter> v0Parameter;
llvm::Optional<mlir::concretelang::V0FHEConstraint> v0Constraint;
concrete_optimizer::Encoding encoding;
llvm::Optional<mlir::concretelang::LargeIntegerParameter>
largeIntegerParameter;
std::vector<TestErrorRate> test_error_rates;

View File

@@ -6,6 +6,7 @@ import argparse
MIN_PRECISON = 1
MAX_PRECISION = 16
PRECISION_FORCE_CRT = 9
def generate(args):
print("# /!\ DO NOT EDIT MANUALLY THIS FILE MANUALLY")
@@ -23,6 +24,8 @@ def generate(args):
f" %1 = \"FHE.apply_lookup_table\"(%arg0, %tlu): (!FHE.eint<{p}>, tensor<{2**p}xi64>) -> (!FHE.eint<{p}>)")
print(f" return %1: !FHE.eint<{p}>")
print(" }")
if p >= PRECISION_FORCE_CRT:
print("encoding: crt")
print("tests:")
print(" - inputs:")
print(" - scalar: 0")

View File

@@ -2,6 +2,7 @@ from platform import mac_ver
import numpy as np
import argparse
PRECISION_FORCE_CRT = 9
def generate(args):
print("# /!\ DO NOT EDIT MANUALLY THIS FILE MANUALLY")
@@ -23,6 +24,8 @@ def generate(args):
print(f" (tensor<{n_ct}x!FHE.eint<{p}>>, tensor<{2**p}xi64>) -> (tensor<{n_ct}x!FHE.eint<{p}>>)")
print(f" return %{n_lut}: tensor<{n_ct}x!FHE.eint<{p}>>")
print(" }")
if p >= PRECISION_FORCE_CRT:
print("encoding: crt")
random_input = np.random.randint(max_value+1, size=n_ct)
print("tests:")
print(" - inputs:")

View File

@@ -185,6 +185,7 @@ void registerEndToEnd(std::string suiteName, std::string libpath,
if (desc.v0Constraint.hasValue()) {
options.v0FHEConstraints = desc.v0Constraint;
}
options.optimizerConfig.encoding = desc.encoding;
auto i = 0;
for (auto test : desc.tests) {
auto valueName = std::to_string(i);