Skip to content

fix: replace removed batching.not_mapped with None for JAX 0.10.x compatibility - #16

Closed
gRox167 wants to merge 1 commit into
GragasLab:mainfrom
gRox167:main
Closed

gRox167 wants to merge 1 commit into
GragasLab:mainfrom
gRox167:main

Conversation

@gRox167

@gRox167 gRox167 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

JAX 0.10 removed jax.interpreters.batching.not_mapped (the 'not batched' sentinel in batching rules, now simply None). The _make_batcher function in primitives.py still referenced the removed attribute, raising AttributeError on JAX >= 0.10.

Replace batching.not_mapped with None in the batching rule generator, matching the new JAX batching convention.

…patibility

JAX 0.10 removed jax.interpreters.batching.not_mapped (the 'not batched'
sentinel in batching rules, now simply None). The `_make_batcher` function
in primitives.py still referenced the removed attribute, raising
AttributeError on JAX >= 0.10.

Replace `batching.not_mapped` with `None` in the batching rule
generator, matching the new JAX batching convention.
Copilot AI review requested due to automatic review settings June 25, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates NUFFT primitive batching rules to be compatible with JAX 0.10+, where the “not batched” sentinel jax.interpreters.batching.not_mapped was removed in favor of using None.

Changes:

  • Replaces the removed batching.not_mapped sentinel usage in _make_batcher.
  • Updates vmap in_axes construction to align with the new None-based convention.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def batcher(args, dims, **kwargs):
batched = [i for i, d in enumerate(dims) if d is not batching.not_mapped]
batched = [i for i, d in enumerate(dims) if d is not None]
@geoffroyO

geoffroyO commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Hi @gRox167, thanks this is already fixed in #7b5c79b

@geoffroyO geoffroyO closed this Jul 2, 2026
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.

3 participants