# PyMC3 -\> PyMC v4 migration

**URL:** <https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078>\
**Category:** News\
**Created:** [September 24, 2021, 6:49pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078 "2021-09-24T18:49:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![almostmeenal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/almostmeenal/32/3723_2.png) [@almostmeenal](https://discourse.pymc.io/u/almostmeenal)\
**Post date:** [September 24, 2021, 6:49pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/1 "2021-09-24T18:49:39Z")

</div>

The new v4 of PyMC3 will be renamed as PyMC v4. everything is still getting figured out. Everyone at [@PyMC\_Core](https://discourse.pymc.io/groups/pymc_core) wants to hear about worries, concerns, doubts or suggestions about this that you might have. We’d love to take care of things beforehand so the community doesn’t struggle with the change. Very soon a migration guide document will be released to help you out with all of this. You can find some updates in this PR and Github Project for the meantime:

- [https://github.com/pymc-devs/pymc3/pull/5018](https://github.com/pymc-devs/pymc3/pull/5018)
- [https://github.com/pymc-devs/pymc3/projects/3](https://github.com/pymc-devs/pymc3/projects/3)

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [September 25, 2021, 9:25am UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/2 "2021-09-25T09:25:30Z")

</div>

Can you change the title to say “PyMC”?

---

<div class="post-metadata">

**Author:** ![almostmeenal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/almostmeenal/32/3723_2.png) [@almostmeenal](https://discourse.pymc.io/u/almostmeenal)\
**Post date:** [September 25, 2021, 9:54am UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/3 "2021-09-25T09:54:11Z")

</div>

tried but title has a lower limit of 15 characters

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [September 26, 2021, 1:15pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/4 "2021-09-26T13:15:43Z")

</div>

I meant just to rename “Pymc3 → Pymc v4 migration” to “PyMC3 → PyMC v4 migration”

---

<div class="post-metadata">

**Author:** ![AllenDowney](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/allendowney/32/3089_2.png) [@AllenDowney](https://discourse.pymc.io/u/AllenDowney)\
**Post date:** [September 30, 2021, 2:09pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/5 "2021-09-30T14:09:35Z")

</div>

Sounds like a good move to me. I’ll have to update some of my material, but I don’t have any concerns.

---

<div class="post-metadata">

**Author:** ![ccaprani](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ccaprani/32/3224_2.png) [@ccaprani](https://discourse.pymc.io/u/ccaprani)\
**Post date:** [October 1, 2021, 1:25am UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/6 "2021-10-01T01:25:25Z")

</div>

Massive work - thanks to all involved.

I see my proposal for PyMC++ and then PyMC# wasn’t adopted disappointingly 🤣

On a more serious note: given the quite different APIs for v3 versus v4, where do you want new PRs to come? I presume targetting v3 would only lead to more work to port to v4, so should contributors hold off for a bit?

---

<div class="post-metadata">

**Author:** ![ricardoV94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ricardov94/32/5775_2.png) [@ricardoV94](https://discourse.pymc.io/u/ricardoV94)\
**Post date:** [October 1, 2021, 11:14am UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/7 "2021-10-01T11:14:21Z")

</div>

We have halted new features to V3. Everything should now go towards V4, unless it’s some sort of major bug fix

---

<div class="post-metadata">

**Author:** ![Dominik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/dominik/32/918_2.png) [@Dominik](https://discourse.pymc.io/u/Dominik)\
**Post date:** [October 6, 2021, 12:44am UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/8 "2021-10-06T00:44:55Z")

</div>

I am very excited about this development. Improved performance is always nice, especially given how massive some improvements seem to be. Another convenience that will hopefully make my live much easier is that then C-compilation will be dropped. The compilation directory had to be managed manually when multiple projects ran on the same file system and they could grow to terabytes in size. All this will probably go away and make working with PyMC even easier.

My main concern is that less commonly used features will go away in the new version. Specifically, using the `.dist` function of distributions without generating a named RV seems to work differently and I do not know how yet. I know that using the distributions in `pm.Potential` is sometimes considered “hacky”. But if you know the analytic form of the posterior, it can be more straight forward to use it in `pm.Potential` and in some use cases I have not found an alternative way. Another maybe less loved feature is the `find_MAP` since its results can be misleading and some of the advantages of Bayesian analysis are wasted. However, if one makes sure the posterior is concave and its mode aligns with the mean, then there is no quicker way to find it.

PyMC v4 seems to be an amazing advancement for the software in any case and I am very grateful for the awesome community and the extremely useful software! All the best for the lunch 🚀

---

<div class="post-metadata">

**Author:** ![michaelosthege](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/michaelosthege/32/371_2.png) [@michaelosthege](https://discourse.pymc.io/u/michaelosthege)\
**Post date:** [October 15, 2021, 5:37pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/9 "2021-10-15T17:37:19Z")

</div>

hi @Dominik ,  
while Aesara is giving you more options for compilation backends (numba, jax) and making it easier to add more, the C backend will likely remain supported for the foreseable future. Mainly because the other backends don’t have the full support/compatibility with all scenarios or OSes.  
But Aesara also got considerable refactoring of how it’s managing the compilation directory, so hopfully it’ll be less of a headache. [`aesara.compiledir`](https://github.com/aesara-devs/aesara/blob/main/aesara/compile/compiledir.py) also has `cleanup()` and `compiledir_purge()` that you might be interested in.

It’s correct that the `.dist()` API changed, but these changes should actually make it more compatible with `pm.Potential`, `pm.logp()` etc. Long story short. The `Distribution()` API implements niceties related to dims/coords management in the model, but inside creates the RVs with `Distribution.dist()`.  
Additionally, we’re (going to) using [Aeppl](https://github.com/aesara-devs/aeppl) for the construction of log-probability graphs, which reduces our dependency on information provided by `Distribution()`/`Model`.

---

<div class="post-metadata">

**Author:** ![Dominik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/dominik/32/918_2.png) [@Dominik](https://discourse.pymc.io/u/Dominik)\
**Post date:** [October 17, 2021, 2:46am UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/10 "2021-10-17T02:46:04Z")

</div>

Hi @michaelosthege! Thank you for clearing this up. I can’t wait to start modeling with it. Is there a place where I can already get a better look at these API changes?

---

<div class="post-metadata">

**Author:** ![michaelosthege](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/michaelosthege/32/371_2.png) [@michaelosthege](https://discourse.pymc.io/u/michaelosthege)\
**Post date:** [November 5, 2021, 3:45pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-migration/8078/11 "2021-11-05T15:45:31Z")

</div>

Hi @Dominik.

we just updated the [RELEASE-NOTES.md on the `main` branch](https://github.com/pymc-devs/pymc/blob/main/RELEASE-NOTES.md).  
It should be the go-to place to get informed about changes moving forward.
