From 4002713f7e17959359f2066c478efa620ffd9e6b Mon Sep 17 00:00:00 2001 From: AlexAndorra Date: Mon, 11 May 2020 18:14:46 +0200 Subject: [PATCH 1/3] Set start method to forkserver for MacOS --- pymc3/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pymc3/__init__.py b/pymc3/__init__.py index 624e9b9ab8..cb51ff4c9d 100644 --- a/pymc3/__init__.py +++ b/pymc3/__init__.py @@ -16,6 +16,8 @@ __version__ = "3.8" import logging +import multiprocessing as mp +import platform _log = logging.getLogger("pymc3") @@ -25,10 +27,13 @@ handler = logging.StreamHandler() _log.addHandler(handler) +sys = platform.system() +if sys == "Darwin": + _ = mp.get_context("forkserver") + def __set_compiler_flags(): # Workarounds for Theano compiler problems on various platforms - import platform import theano system = platform.system() From 1945485e187e30d7a045cb91a66c8ed1534ac046 Mon Sep 17 00:00:00 2001 From: AlexAndorra Date: Mon, 11 May 2020 18:51:06 +0200 Subject: [PATCH 2/3] Polished up changes --- pymc3/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymc3/__init__.py b/pymc3/__init__.py index cb51ff4c9d..83f7c745c9 100644 --- a/pymc3/__init__.py +++ b/pymc3/__init__.py @@ -27,9 +27,11 @@ handler = logging.StreamHandler() _log.addHandler(handler) +# 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": - _ = mp.get_context("forkserver") + new_context = mp.get_context("forkserver") def __set_compiler_flags(): From a5c1ad3b81f6975f1f8945ff022367969f59d9c6 Mon Sep 17 00:00:00 2001 From: AlexAndorra Date: Mon, 11 May 2020 19:17:46 +0200 Subject: [PATCH 3/3] Added release note --- RELEASE-NOTES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index d141236602..d593ad2141 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -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.