Skip to content

Commit

Permalink
chore: exact to appox
Browse files Browse the repository at this point in the history
  • Loading branch information
fd0r committed Jun 5, 2024
1 parent 893e956 commit c35c57e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ def wrapper(*args, **kwargs):
# Multi-parameter strategy is used in order to speed-up the FHE executions
base_configuration = Configuration()

exactness = fhe.Exactness.APPROXIMATE

tlu_optimizer = TLU1bitDecomposition(
n_jumps_limit=2,
exactness=fhe.Exactness.EXACT,
exactness=exactness,
)
rounding = InsertRounding(6)
rounding = InsertRounding(6, exactness=exactness)

configuration = Configuration(
dump_artifacts_on_unexpected_failures=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def evaluate(torch_model, cml_model, device, num_workers):

# Import and load the CIFAR test dataset (following bnn_pynq_train.py)
test_set = get_test_set(dataset="CIFAR10", datadir=CURRENT_DIR / ".datasets/")
test_set = Subset(test_set, np.arange(128))
# test_set = Subset(test_set, np.arange(128))
test_loader = DataLoader(test_set, batch_size=128, shuffle=False, num_workers=num_workers)

torch_top_1_batches = []
Expand Down Expand Up @@ -121,12 +121,13 @@ def main(args):
# Eval mode
model.eval()

exactness=fhe.Exactness.APPROXIMATE
# Multi-parameter strategy is used in order to speed-up the FHE executions
tlu_optimizer = TLU1bitDecomposition(
n_jumps_limit=2,
exactness=fhe.Exactness.EXACT,
exactness=exactness,
)
insert_rounding = InsertRounding(6)
insert_rounding = InsertRounding(6,exactness=exactness)
# debug_processor = Debug()
cfg = Configuration(
verbose=True,
Expand Down

0 comments on commit c35c57e

Please sign in to comment.