Skip to content

Commit

Permalink
fix: propagate glwe config on hybrid mlp unit test (#935)
Browse files Browse the repository at this point in the history
Signed-off-by: Aline Almeida <aline@io.net>
Co-authored-by: Aline Almeida <aline@io.net>
  • Loading branch information
andrei-stoian-zama and alinealfa authored Oct 28, 2024
1 parent 6000b4c commit 664cbd4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/torch/test_hybrid_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ def run_hybrid_llm_test(
m.setitem(sys.modules, "transformers", None)
if has_pbs_reshape:
has_pbs = True
if not glwe_backend_installed:
m.setattr(concrete.ml.quantization.linear_op_glwe_backend, "_HAS_GLWE_BACKEND", False)
m.setattr(concrete.ml.torch.hybrid_model, "_HAS_GLWE_BACKEND", False)

# Propagate glwe_backend_installed state being tested to constants of affected modules
for affected_module in (
concrete.ml.quantization.linear_op_glwe_backend,
concrete.ml.torch.hybrid_model,
):
m.setattr(affected_module, "_HAS_GLWE_BACKEND", glwe_backend_installed)

# Create a hybrid model
hybrid_model = HybridFHEModel(model, module_names)
Expand Down

0 comments on commit 664cbd4

Please sign in to comment.