Skip to content

Commit

Permalink
chore: default to n_jobs = 1 for the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrery committed Mar 27, 2024
1 parent 4ee74ae commit 4c3768d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,14 @@ def default_configuration():
enable_unsafe_features=True,
use_insecure_key_cache=True,
insecure_key_cache_location="ConcreteNumpyKeyCache",
fhe_simulation=False, # Simulation compilation is done lazilly on circuit.simulate
fhe_execution=True,
)


@pytest.fixture
def simulation_configuration():
"""Return the default test compilation configuration for simulation."""
"""Return the simulation test compilation configuration for simulation."""

# Parameter `enable_unsafe_features` and `use_insecure_key_cache` are needed in order to be
# able to cache generated keys through `insecure_key_cache_location`. As the name suggests,
Expand All @@ -165,6 +168,7 @@ def simulation_configuration():
fhe_execution=False,
)


REMOVE_COLOR_CODES_RE = re.compile(r"\x1b[^m]*m")


Expand Down
5 changes: 5 additions & 0 deletions src/concrete/ml/pytest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ def instantiate_model_generic(model_class, n_bits, **parameters):
model_name (str): The type of the model as a string.
model (object): The model instance.
"""
# Force multi threaded models to be single threaded as it's not working
# properly with pytest multi-threading
if "n_jobs" in model_class().get_params():
parameters["n_jobs"] = 1

# If the model is a QNN, set the model using appropriate bit-widths
if is_model_class_in_a_list(model_class, _get_sklearn_neural_net_models()):
extra_kwargs = {}
Expand Down

0 comments on commit 4c3768d

Please sign in to comment.