Unverified Commit e200ba5c authored by Alexandre ANDORRA's avatar Alexandre ANDORRA Committed by GitHub

Set start method to forkserver for MacOS (#3919)

* Set start method to forkserver for MacOS

* Polished up changes

* Added release note
parent ad590746
......@@ -21,9 +21,10 @@
- `pm.sample` now takes 1000 draws and 1000 tuning samples by default, instead of 500 previously (see [#3855](https://github.com/pymc-devs/pymc3/pull/3855)).
- Moved argument division out of `NegativeBinomial` `random` method. Fixes [#3864](https://github.com/pymc-devs/pymc3/issues/3864) in the style of [#3509](https://github.com/pymc-devs/pymc3/pull/3509).
- The Dirichlet distribution now raises a ValueError when it's initialized with <= 0 values (see [#3853](https://github.com/pymc-devs/pymc3/pull/3853)).
- Dtype bugfix in `MvNormal` and `MvStudentT` (see [3836](https://github.com/pymc-devs/pymc3/pull/3836))
- Dtype bugfix in `MvNormal` and `MvStudentT` (see [3836](https://github.com/pymc-devs/pymc3/pull/3836)).
- End of sampling report now uses `arviz.InferenceData` internally and avoids storing
pointwise log likelihood (see [#3883](https://github.com/pymc-devs/pymc3/pull/3883))
pointwise log likelihood (see [#3883](https://github.com/pymc-devs/pymc3/pull/3883)).
- The multiprocessing start method on MacOS is now set to "forkserver", to avoid crashes (see issue [#3849](https://github.com/pymc-devs/pymc3/issues/3849), solved by [#3919](https://github.com/pymc-devs/pymc3/pull/3919)).
### Deprecations
- Remove `sample_ppc` and `sample_ppc_w` that were deprecated in 3.6.
......@@ -16,6 +16,8 @@
__version__ = "3.8"
import logging
import multiprocessing as mp
import platform
_log = logging.getLogger("pymc3")
......@@ -25,10 +27,15 @@ if not logging.root.handlers:
handler = logging.StreamHandler()
# Set start method to forkserver for MacOS to enable multiprocessing
# Closes issue https://github.com/pymc-devs/pymc3/issues/3849
sys = platform.system()
if sys == "Darwin":
new_context = mp.get_context("forkserver")
def __set_compiler_flags():
# Workarounds for Theano compiler problems on various platforms
import platform
import theano
system = platform.system()
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment