Skip to content

Conversation

@nstarman
Copy link
Contributor

@nstarman nstarman commented Oct 1, 2025

Replaces #73

@nstarman
Copy link
Contributor Author

nstarman commented Oct 1, 2025

@patrick-kidger, the jax + jaxtyping PRs re LiteralArray fixed many of the problems, but we still have issues like:

plum.resolver.NotFoundLookupError: `convert_element_type_dispatcher(LiteralArray(0, dtype=int32))` could not be resolved.

Besides registering specific rules, is there a better way to automatically support these primitives?

@nstarman nstarman changed the title deps: bump jaxtyping v0.3.3+ fix: jax v0.7.2+ LiteralArray / TypedNdArray Oct 1, 2025
@nstarman nstarman force-pushed the deps-bump-jaxtyping branch from 825ac87 to d56084a Compare October 1, 2025 18:03
@patrick-kidger
Copy link
Owner

Hmm, this surprises me. If LiteralArray is included in the ArrayLike union then I would have imagined that plum would respect that when a rule is registered with an ArrayLike annotation, and thus be able to dispatch on it.

I'd suggest tracking down why that expected flow doesn't hold.

@nstarman
Copy link
Contributor Author

nstarman commented Oct 3, 2025

I'd suggest tracking down why that expected flow doesn't hold.

@patrick-kidger I think it's because of patrick-kidger/equinox#1112

@nstarman
Copy link
Contributor Author

nstarman commented Oct 3, 2025

I tested this PR with patrick-kidger/equinox#1112 and all tests passed, so hopefully that's all we need.

Signed-off-by: nstarman <[email protected]>
Signed-off-by: nstarman <[email protected]>
@nstarman
Copy link
Contributor Author

Some small code cleaning was introduced in the process of debugging. :)

@nstarman nstarman marked this pull request as ready for review October 10, 2025 09:02
@nstarman
Copy link
Contributor Author

@patrick-kidger it works!

def existing_rule():
assert False
def new_rule():
raise NotImplementedError("Abstract primitive") # pragma: no cover
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pragma?

@patrick-kidger patrick-kidger merged commit fef6a5b into patrick-kidger:main Oct 12, 2025
5 checks passed
@patrick-kidger
Copy link
Owner

LGTM, merged!

@nstarman nstarman deleted the deps-bump-jaxtyping branch October 12, 2025 18:09
"beartype>=0.20.2",
"pytest>=8.3.5",
"pytest-env>=1.1.5",
"ipykernel>=6.30.1",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, why did this sneak in as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess dev on Jupyter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants