Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move jax.extend.ffi module to top level jax.ffi #25633

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dfm
Copy link
Collaborator

@dfm dfm commented Dec 20, 2024

In #21531, @froystig and I decided to land the JAX foreign function interface (FFI) under that jax.extend submodule, since it can be considered a mechanism for extending JAX. Since then, this decision has been questioned (most recently from @mattjj and @jakevdp), because the jax.extend submodule really has a narrower scope: interfacing with JAX internals (see the extend JEP for more details). Instead, the FFI is designed to allow users to extend JAX without interacting with JAX internals. Furthermore, code under jax.extend isn't required to follow the API compatibility contract that JAX's public APIs, but our aim is for the FFI to be a stable and well-supported public API.

With this in mind, this PR moves the FFI submodule back into the top level jax.ffi namespace, while leaving a deprecated import shim under jax.extend.ffi.

@dfm dfm self-assigned this Dec 20, 2024
@dfm dfm added the pull ready Ready for copybara import and testing label Dec 20, 2024
@dfm dfm force-pushed the move-ffi branch 2 times, most recently from f901fab to b775ab5 Compare December 20, 2024 12:44
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jakevdp - As part of this PR, I'm renaming this file, and documenting the functions in their new location (under jax.ffi instead of jax.extend.ffi). This will break any existing links to the API docs. I think this is probably okay, but wanted to check with you if there are better ways of handling this kind of deprecation?

Copy link
Collaborator

@jakevdp jakevdp Dec 20, 2024

Choose a reason for hiding this comment

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

you can add a redirect here:

rediraffe_redirects = {

That will work for the module-level redirect. For the individual APIs, we'd have to keep documenting the deprecated versions until they're removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants