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

fix: propagate GLWE config on hybrid MLP unit test #928

Closed
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
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
Loading