You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tensorflow Probability fatally crashes with Jax 0.7 #1994
Yes, you should probably skip. As of 0.5.0, jax.interpreters.xla.pytype_aval_mappings and jax.core.pytype_aval_mappings point to the same object, though the first reference is deprecated. Eventually the first reference will be removed and only jax.core.pytype_aval_mappings will remain.
.venv/lib/python3.13/site-packages/efax/_src/tools.py:84: in <module>
iv_ratio = tfp.math.bessel_iv_ratio
^^^^^^^^
.venv/lib/python3.13/site-packages/tensorflow_probability/python/internal/lazy_loader.py:56: in __getattr__
module = self._load()
^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/tensorflow_probability/python/internal/lazy_loader.py:43: in _load
module = importlib.import_module(self.__name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/tensorflow_probability/substrates/jax/__init__.py:42: in <module>
from tensorflow_probability.substrates.jax import bijectors
.venv/lib/python3.13/site-packages/tensorflow_probability/substrates/jax/bijectors/__init__.py:19: in <module>
from tensorflow_probability.substrates.jax.bijectors.absolute_value import AbsoluteValue
.venv/lib/python3.13/site-packages/tensorflow_probability/substrates/jax/bijectors/absolute_value.py:17: in <module>
from tensorflow_probability.python.internal.backend.jax.compat import v2 as tf
.venv/lib/python3.13/site-packages/tensorflow_probability/python/internal/backend/jax/__init__.py:19: in <module>
from tensorflow_probability.python.internal.backend.jax import compat
.venv/lib/python3.13/site-packages/tensorflow_probability/python/internal/backend/jax/compat.py:17: in <module>
from tensorflow_probability.python.internal.backend.jax import v1
.venv/lib/python3.13/site-packages/tensorflow_probability/python/internal/backend/jax/v1.py:23: in <module>
from tensorflow_probability.python.internal.backend.jax import linalg_impl
.venv/lib/python3.13/site-packages/tensorflow_probability/python/internal/backend/jax/linalg_impl.py:23: in <module>
from tensorflow_probability.python.internal.backend.jax import ops
.venv/lib/python3.13/site-packages/tensorflow_probability/python/internal/backend/jax/ops.py:681: in <module>
jax.interpreters.xla.pytype_aval_mappings[onp.ndarray])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/jax/_src/deprecations.py:54: in getattr
raise AttributeError(message)
E AttributeError: jax.interpreters.xla.pytype_aval_mappings was deprecated in JAX v0.5.0 and removed in JAX v0.7.0. jax.core.pytype_aval_mappings can be used as a replacement in most cases.
Can we please change the code from an attribute check to a Jax version check?
It's also False for me. You can test out my exact setup by pulling NeilGirdhar/efax, then doing uv lock -U and uv sync. Then the error turns up with pytest.
Alright, hopefully the TFP maintainers can sort this out. From the JAX point of view, things are behaving as expected (the deprecated symbol raised a DeprecationWarning starting in v0.5, and now raises an AttributeError starting in v0.7).
changed the title [-]jax.interpreters.xla.pytype_aval_mappings is deprecated[/-][+]Tensorflow Probability fatally crashes with Jax 0.7[/+]on Jul 23, 2025
Oh I see: the hasattr(jax.interpreters.xla, 'pytype_aval_mappings') check is in at HEAD, but is not part of the most recent release (v0.25.0, released November 2024). Fixing this will require a new TFP release.
@jburnim I can reproduce this with JAX v0.7.0 and TFP v0.25.0:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[/tmp/ipython-input-7-2785852718.py](https://localhost:8080/#) in <cell line: 0>()
1from tensorflow_probability.substrates import jax as tfp
----> 2 tfp.math
...
[/usr/local/lib/python3.11/dist-packages/jax/_src/deprecations.py](https://localhost:8080/#) in getattr(name)
52 message, fn = deprecations[name]
53if fn isNone: # Is the deprecation accelerated?
---> 54 raise AttributeError(message)
55 warnings.warn(message, DeprecationWarning, stacklevel=2)
56return fn
AttributeError: jax.interpreters.xla.pytype_aval_mappings was deprecated in JAX v0.5.0 and removed in JAX v0.7.0. jax.core.pytype_aval_mappings can be used as a replacement in most cases.
@jburnim Thanks for explaining! It’s a bit tough for users right now having to choose between older JAX versions or unstable TFP nightlies. Since dependency tools (like uv) don’t handle this automatically, it means extra hassle and manual work. A stable TFP release that supports the latest JAX would really make things easier and help everyone keep up without headaches 😄
Reacted by Johannes Brachem, partev, Stephan Hoyer and Marnix Van Soom
For TFP on JAX I would strongly advise using tfp-nightly. It's tested continuously against the latest JAX, and you can pin to a particular date's release if you need your dependencies to remain fixed.
The stable-vs-nightly distinction in TFP has grown anachronistic, at least as far as JAX users are concerned. Historically "stable" versioning has been tied to TF releases, which are immaterial to JAXers. I would suggest picking a nightly build, pinning to it, and updating that as you see fit, perhaps as new JAX builds are published.
Activity
NeilGirdhar commentedon Apr 17, 2025
@jakevdp Would it be better to skip this code entirely when Jax's version >= 0.5?
jakevdp commentedon Apr 17, 2025
Yes, you should probably skip. As of 0.5.0,
jax.interpreters.xla.pytype_aval_mappingsandjax.core.pytype_aval_mappingspoint to the same object, though the first reference is deprecated. Eventually the first reference will be removed and onlyjax.core.pytype_aval_mappingswill remain.NeilGirdhar commentedon Apr 18, 2025
Got it, just wanted to eliminate the warning.
NeilGirdhar commentedon Jul 22, 2025
This is just crashing now:
Can we please change the code from an attribute check to a Jax version check?
Also, given that the package is effectively incompatible with latest Jax, could we get another release too?
jakevdp commentedon Jul 22, 2025
I'm confused as to how this error is arising: with JAX v0.7.0 locally I see this:
Why is the
ifstatement evaluating toTruein your case?NeilGirdhar commentedon Jul 23, 2025
It's also False for me. You can test out my exact setup by pulling NeilGirdhar/efax, then doing
uv lock -Uanduv sync. Then the error turns up withpytest.jakevdp commentedon Jul 23, 2025
Alright, hopefully the TFP maintainers can sort this out. From the JAX point of view, things are behaving as expected (the deprecated symbol raised a DeprecationWarning starting in v0.5, and now raises an AttributeError starting in v0.7).
[-]jax.interpreters.xla.pytype_aval_mappings is deprecated[/-][+]Tensorflow Probability fatally crashes with Jax 0.7[/+]NeilGirdhar commentedon Jul 23, 2025
@SiegeLordEx Can you take a look at this? Tensorflow Probability seemst to be broken.
jburnim commentedon Jul 23, 2025
What versions of TFP and JAX are you using?
jakevdp commentedon Jul 23, 2025
Oh I see: the
hasattr(jax.interpreters.xla, 'pytype_aval_mappings')check is in at HEAD, but is not part of the most recent release (v0.25.0, released November 2024). Fixing this will require a new TFP release.@jburnim I can reproduce this with JAX v0.7.0 and TFP v0.25.0:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) [/tmp/ipython-input-7-2785852718.py](https://localhost:8080/#) in <cell line: 0>() 1 from tensorflow_probability.substrates import jax as tfp ----> 2 tfp.math ... [/usr/local/lib/python3.11/dist-packages/jax/_src/deprecations.py](https://localhost:8080/#) in getattr(name) 52 message, fn = deprecations[name] 53 if fn is None: # Is the deprecation accelerated? ---> 54 raise AttributeError(message) 55 warnings.warn(message, DeprecationWarning, stacklevel=2) 56 return fn AttributeError: jax.interpreters.xla.pytype_aval_mappings was deprecated in JAX v0.5.0 and removed in JAX v0.7.0. jax.core.pytype_aval_mappings can be used as a replacement in most cases.Using
tfp-nightly, the error does not occur.jburnim commentedon Jul 23, 2025
Someone from the TensorFlow Probability team can confirm, but I think everything is working as expected here.
TFP 0.25.0 is intended to work with JAX 0.4.35 -- see https://github.com/tensorflow/probability/releases/tag/v0.25.0 . Stable releases of TFP often work with later releases of JAX, but this is not guaranteed.
TFP nightly is intended to work with the latest JAX release.
NeilGirdhar commentedon Jul 23, 2025
@jburnim Thanks for explaining! It’s a bit tough for users right now having to choose between older JAX versions or unstable TFP nightlies. Since dependency tools (like uv) don’t handle this automatically, it means extra hassle and manual work. A stable TFP release that supports the latest JAX would really make things easier and help everyone keep up without headaches 😄
NeilGirdhar commentedon Jul 23, 2025
@jakevdp Sorry for the basic question, but how do you use tfp-nightly?
jakevdp commentedon Jul 23, 2025
I did
pip install tfp-nightlyand thenimport tensorflow_probability.jobrachem commentedon Jul 28, 2025
Is there a timeline for the next tfp release that will include the fix for this issue?
csuter commentedon Jul 28, 2025
For TFP on JAX I would strongly advise using tfp-nightly. It's tested continuously against the latest JAX, and you can pin to a particular date's release if you need your dependencies to remain fixed.
The stable-vs-nightly distinction in TFP has grown anachronistic, at least as far as JAX users are concerned. Historically "stable" versioning has been tied to TF releases, which are immaterial to JAXers. I would suggest picking a nightly build, pinning to it, and updating that as you see fit, perhaps as new JAX builds are published.
Remove dependency on tensorflow-probability
Remove dependency on tensorflow-probability
jobrachem commentedon Jul 29, 2025
Thank you @csuter ! We will try that approach.
csuter commentedon Jul 29, 2025
Thanks, @jobrachem. Please do let us know if you have any trouble.
Switch to tfp-nightly
Switch tensorflow-probability -> tfp-nightly[jax]