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

chore: activate input compression for encrypted data-frames [BLOCKED BY CP] #731

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/concrete/ml/pandas/_development.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ def save_client_server(client_path: Path = CLIENT_PATH, server_path: Path = SERV
# Get the input-set and circuit generating functions
inputset = config["get_inputset"]()
cp_func = config["to_compile"]
compilation_configuration = Configuration(compress_evaluation_keys=True)
configuration = Configuration(
composable=True, compress_evaluation_keys=True, compress_input_ciphertexts=True
)

# Compile the circuit and allow it to be composable with itself
merge_circuit = cp_func.compile(
inputset, composable=True, configuration=compilation_configuration
)
merge_circuit = cp_func.compile(inputset, configuration=configuration)

# Save the client and server files using the MLIR
merge_circuit.client.save(client_path)
Expand Down
11 changes: 1 addition & 10 deletions tests/torch/test_hybrid_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import pytest
import torch
from concrete.fhe import Configuration
from transformers import GPT2LMHeadModel, GPT2Tokenizer

from concrete.ml.pytest.torch_models import PartialQATModel
Expand Down Expand Up @@ -37,17 +36,9 @@ def run_hybrid_llm_test(
):
"""Run the test for any model with its private module names."""

# Multi-parameter strategy is used in order to speed-up the FHE executions
configuration = Configuration(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, these options are the QM's default, so let's avoid some confusion / unexpected mismatches

single_precision=False,
compress_input_ciphertexts=True,
)

# Create a hybrid model
hybrid_model = HybridFHEModel(model, module_names)
hybrid_model.compile_model(
inputs, p_error=0.01, n_bits=8, rounding_threshold_bits=8, configuration=configuration
)
hybrid_model.compile_model(inputs, p_error=0.01, n_bits=8, rounding_threshold_bits=8)

# Check we can run the simulate locally
logits_simulate = hybrid_model(inputs, fhe="simulate").logits
Expand Down
Loading