-
Notifications
You must be signed in to change notification settings - Fork 670
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
0.6.3 introduced a circular dependency with orbax #2707
Comments
Thanks @mattsoulanille for filing this issue. We will look into it as soon as possible, I have assigned it to @IvyZX since she is leading the Orbax work so she has the most context here. |
Thanks! TFJS has pinned flax to 0.6.2 for now, so we are unblocked for the moment. |
In internal equivalents of Bazel, the BUILD rules are specified so that there is no actual code-level circular dependency between Flax and Orbax. Is it possible to specify BUILD rules in the open-source codebase so that Bazel knows how to run it? |
Discussed with @mattsoulanille and @levskaya offline. TFJS seems to be okay with pinning But in the long term this circular dependency of Flax and Orbax may be a blocker for other installations as well. Generally the right direction is probably to cut Orbax's dependency on Flax, since Orbax targets for general (JAX/TF) tooling. Right now Orbax is dependent on Flax for Either way, gonna have more discussion with Orbax and figure out a long-term solution. |
For the future, here are some ideas:
|
We have to maintain control of traversals / flattening nested-dict, struct dataclass, etc. As we use those for more things than just checkpoints. One hope is to enhance JAX pytree calls with the notion of "paths" such that we could remove our hacky state-dict registry altogether - but this is still in discussion. |
We hit this today using a rules_python Bazel repository :(. Has there been any further thought into resolving this? |
Just came across this today trying to upgrade flax in nixpkgs... |
We just released |
Looking at 0.6.5 it appears that there's still a dependency on orbax: Line 33 in 524629e
|
I guess this is a problem of orbax depending on flax? |
Or the other way around, depending on how you want to think about it. All comes down to how flax/orbax maintainers choose to remedy the situation. Seems like #2707 (comment) is the latest on that. |
This reverts commit fe0048c which broke flax due to google/flax#2707.
This reverts commit fe0048c which broke flax due to google/flax#2707.
Hi all - sorry for the delay on this issue! The underlying issue is that orbax has been using the flax serialization routines, partly for some backwards-compatibility reasons, but mainly because the simple flax "state dict" machinery was a common way to handle deriving the "key paths" to each leaf in a pytree. The circular dependency is occurring since we're trying to transition to being able to use orbax for checkpoints. We're trying to resolve this issue in a fundamental way by adopting a mechanism in jax itself to define the key-paths to pytree leaves so that we needn't use our relatively simple state-dict abstraction in other libraries (and ultimately to delete it ourselves). Our sincere apologies for the build troubles with this circular dependency - we and the orbax maintainers are working to try to resolve it in the next week or so. |
Hi! When will this be fixed? This makes pip dependency resolution broken when orbax/flax are listed dependencies. |
As Flax depends on |
Provide as much information as possible. At least, this should include a description of your issue and steps to reproduce the problem. If possible also provide a summary of what steps or workarounds you have already tried.
System information
pip show flax jax jaxlib
:Problem you have encountered:
Flax 0.6.3 added a dependency on orbax, which has a dependency on flax. This is causing tensorflow/tfjs#7159 in the TensorFlow.js repository. TFJS resolves pypi packages using Bazel, which does not support circular dependencies.
Was this change intentional? If so, I can file a bug with rules_python instead, although last time this kind of circular dependency issue arose, it was determined to be a bug in the downstream package. I'm not sure if that true in this case, though.
What you expected to happen:
No circular dependency.
Logs, error messages, etc:
Steps to reproduce:
Whenever possible, please provide a minimal example. Please consider submitting it as a Colab link.
The text was updated successfully, but these errors were encountered: