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

Incompatibility on Brax Problem of EvoX with the Latest Version of Flax #150

Open
liyc5929 opened this issue Oct 30, 2024 · 3 comments
Open

Comments

@liyc5929
Copy link

Hello,

I would like to report an incompatibility issue between the newly supported NNX in Flax and the existing version of EvoX.

The EvoX framework implements a Problem for Brax, which requires a policy argument that should be the apply function of a Flax model defined using flax.linen. In this context, the apply requires model weights to be passed as one of its arguments. However, in the latest implementation of flax.nnx, the policy argument for the Brax Problem no longer requires the model weights as input.

This discrepancy results in incompatibility with the existing Problem in EvoX, as the expected function signature no longer aligns with the new implementation of Flax.

It would be great if this issue could be addressed in a future update to ensure compatibility between these frameworks.

Thank you for your attention.

@BillHuang2001
Copy link
Collaborator

BillHuang2001 commented Oct 30, 2024

I noticed this issue as well. From the API's standpoint, we can address it fairly easily, given that the weight in NNX is stored directly in self. However, I am uncertain about NNX's compatibility with various transformations, such as tree_map and vmap (especially when mapping along the weight dimension, which is a must for the EC workflow, though perhaps not essential for them). In a way, the new NNX is not functional (as stated in their design), which is a bad thing for us, so for now I would advice not using the NNX.

@liyc5929
Copy link
Author

I see the point now. Thank you for the clarification.

@BillHuang2001
Copy link
Collaborator

We can keep this issue open to keep track of the progress.

@BillHuang2001 BillHuang2001 reopened this Oct 31, 2024
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

No branches or pull requests

2 participants