Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ When releasing, please add the new-release-boilerplate to docs/pallas/CHANGELOG.
* Bug fixes:
* Deprecations:
* Changes:
* JAX tracers that are not of `Array` type (e.g., of `Ref` type) will no
longer report themselves to be instances of `Array`.


## JAX 0.9.0 (January 20, 2026)

Expand Down
3 changes: 3 additions & 0 deletions jax/_src/pallas/mosaic/pallas_call_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def _maybe_cast_to_int(x: jax.Array | jax_core.AbstractValue):
"""
assert isinstance(
x, (jax.Array, jax_core.ShapedArray, state_types.AbstractLinVal)
) or (
isinstance(x, jax_core.Tracer)
and isinstance(x.aval, state_types.AbstractLinVal)
), type(x)
if isinstance(x, jax.Array):
if dtypes.issubdtype(x.dtype, jax.numpy.bool_):
Expand Down
17 changes: 5 additions & 12 deletions jaxlib/py_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2221,18 +2221,11 @@ absl::Status PyArray::Register(nb::module_& m) {
if (tracer_class.ptr() && self.ptr() == base_type.ptr() &&
PyObject_TypeCheck(x.ptr(), reinterpret_cast<PyTypeObject*>(
tracer_class.ptr())) != 0) {
// TODO(phawkins): we would like to change this to use the logic below
// but it is a somewhat breaking change. Let us defer it to a future
// PR.
return true;
// auto is_traced_array_fn =
// nb::getattr(x, "_is_traced_array", nb::none());
// if (!is_traced_array_fn.is_none()) {
// try {
// return nb::cast<bool>(is_traced_array_fn());
// } catch (...) {
// }
// }
auto is_traced_array_fn =
nb::getattr(x, "_is_traced_array", nb::none());
if (!is_traced_array_fn.is_none()) {
return nb::cast<bool>(is_traced_array_fn());
}
}
return false;
},
Expand Down
Loading