Skip to content

Make orbax-export an optional dependency? #5352

Closed

Description

@pfackeldey

Dear flax team,

We noticed that the latest flax requires orbax-export as a dependency (see PR #5188). orbax-export seems to require with TensorFlow, which is why currently its conda-forge build fails: conda-forge/staged-recipes#32625 (@matthewfeickert can comment more on this).

To make flax more lightweight on 'default' installation we were wondering what you think about making orbax-export an optional dependency to not make TensorFlow be a requirement for flax through orbax-export.

What do you think about something like pip install flax[export] ?

Best, Peter

cc @matthewfeickert

Activity

  1. vfdev-5 commented on Mar 18, 2026

    @vfdev-5
    Collaborator

    @pfackeldey thanks for the report! I agree and think that orbax-export should either testing dependency or installed manually in the notebook. @samanklesaria was it intentional to put orbax-export as hard dependency?

  2. matthewfeickert commented on Mar 18, 2026

    @matthewfeickert

    (Currently at a conference, so replying quickly now and then more later) c.f. conda-forge/flax-feedstock#61 (comment) for some context on things on the conda-forge distribution side.

    was it intentional to put orbax-export as hard dependency?

    The real issue is that orbax-export is not programmatically transparent about its runtime requirements (import orbax.export imports tensorflow and so at pip install orbax-export time import orbax.export is broken). This is both not good from a packaging standards view and I think fair to say that most people using JAX-based tooling don't expect (or want) TensorFlow to be a hard requirement.

  3. samanklesaria commented on Mar 18, 2026

    @samanklesaria
    Collaborator

    It was indeed not intended to make orbax-export a hard dependency. Apologies- will fix promptly!

  4. matthewfeickert commented on Mar 18, 2026

    @matthewfeickert

    It was indeed not intended to make orbax-export a hard dependency. Apologies- will fix promptly!

    Thanks. This is useful to know as for conda-forge builds we'll just patch that out of the pyproject.toml for all the affected releases (v0.12.3 to v0.12.5).

  5. matthewfeickert commented on Mar 26, 2026

    @matthewfeickert

    Note that PR #5353 didn't land until after https://github.com/google/flax/releases/tag/v0.12.6, and so

    "orbax-export>=0.0.8",

    is still a requirement in the latest flax release. This will get patched out in the conda-forge distribution (conda-forge/flax-feedstock#67), but flax without tensorflow as a requirement won't be available on PyPI until v0.12.7+.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions