diff --git a/autofit/non_linear/search/mcmc/emcee/search.py b/autofit/non_linear/search/mcmc/emcee/search.py index ab4118e33..70dfff8a7 100644 --- a/autofit/non_linear/search/mcmc/emcee/search.py +++ b/autofit/non_linear/search/mcmc/emcee/search.py @@ -75,7 +75,7 @@ def __init__( auto_correlation_settings: Optional[AutoCorrelationsSettings] = None, iterations_per_quick_update: int = None, iterations_per_full_update: int = None, - number_of_cores: Union[int, str] = "auto", + number_of_cores: Union[int, str] = 1, silence: bool = False, session: Optional[sa.orm.Session] = None, **kwargs, @@ -111,8 +111,9 @@ def __init__( Customizes and performs auto correlation calculations performed during and after the search. number_of_cores The number of cores sampling is performed using a Python multiprocessing Pool instance: a whole - number >= 1, or `"auto"` (the default), every core this process may use, resolved when the fit starts - (1 for a JAX analysis). + number >= 1 (default 1), or `"auto"`, every core this process may use, resolved when the fit starts + (1 for a JAX analysis). Emcee stays on one core by default: its pooled path currently returns wrong + log likelihoods and leaves worker processes running at exit, so `"auto"` is opt-in until that is fixed. silence If True, the default print output of the non-linear search is silenced. session diff --git a/autofit/non_linear/search/mcmc/zeus/search.py b/autofit/non_linear/search/mcmc/zeus/search.py index 6dd322e5f..324dc13ba 100644 --- a/autofit/non_linear/search/mcmc/zeus/search.py +++ b/autofit/non_linear/search/mcmc/zeus/search.py @@ -81,7 +81,7 @@ def __init__( auto_correlation_settings: Optional[AutoCorrelationsSettings] = None, iterations_per_quick_update: int = None, iterations_per_full_update: int = None, - number_of_cores: Union[int, str] = "auto", + number_of_cores: Union[int, str] = 1, silence: bool = False, session: Optional[sa.orm.Session] = None, **kwargs @@ -117,8 +117,9 @@ def __init__( Customizes and performs auto correlation calculations performed during and after the search. number_of_cores The number of cores Zeus sampling is performed using a Python multiprocessing Pool instance: a whole - number >= 1, or `"auto"` (the default), every core this process may use, resolved when the fit starts - (1 for a JAX analysis). + number >= 1 (default 1), or `"auto"`, every core this process may use, resolved when the fit starts + (1 for a JAX analysis). Zeus stays on one core by default: its pooled path currently returns wrong + log probabilities (slice-sampler contraction failures), so `"auto"` is opt-in until that is fixed. silence If True, the default print output of the non-linear search is silenced. session diff --git a/test_autofit/non_linear/search/mcmc/test_emcee.py b/test_autofit/non_linear/search/mcmc/test_emcee.py index 93c22f872..e74683a81 100644 --- a/test_autofit/non_linear/search/mcmc/test_emcee.py +++ b/test_autofit/non_linear/search/mcmc/test_emcee.py @@ -41,7 +41,7 @@ def test__explicit_params(): assert search.auto_correlation_settings.check_size == 100 assert search.auto_correlation_settings.required_length == 50 assert search.auto_correlation_settings.change_threshold == 0.01 - assert search.number_of_cores == "auto" + assert search.number_of_cores == 1 def test__log_posteriors_are_aligned_with_the_thinned_chain(monkeypatch): diff --git a/test_autofit/non_linear/search/mcmc/test_zeus.py b/test_autofit/non_linear/search/mcmc/test_zeus.py index f45ef4d69..8b4dac8dd 100644 --- a/test_autofit/non_linear/search/mcmc/test_zeus.py +++ b/test_autofit/non_linear/search/mcmc/test_zeus.py @@ -46,7 +46,7 @@ def test__explicit_params(): assert search.auto_correlation_settings.check_size == 100 assert search.auto_correlation_settings.required_length == 50 assert search.auto_correlation_settings.change_threshold == 0.01 - assert search.number_of_cores == "auto" + assert search.number_of_cores == 1 requires_zeus = pytest.mark.skipif(