Skip to content

optree package status in PyTorch #152535

@zou3519

Description

@zou3519

Motivation

"optree >= 0.13.0" is an optional dependency for PyTorch. There's not a good way to specify this in the package metadata, so we have code checks doing this. We ran into some issues with the PyTorch 2.7 release where the "optional dependency checking" code broken and we ended up (1) crashing on optree < 0.13.0 and (2) hard requiring optree >= 0.13.0. Furthermore, I submitted two fixes for this, where the first fix didn't work and the second one actually worked.

We should fix this so that future releases (e.g. 2.8.0) do not run into the risk of this problem.

Pitch

I see three high-level solutions:

  1. We continue to have optree as an optional dependency. We would need to beef up our CI. In particular, we want to test three configurations: optree == 0.13.0, no optree, and optree < 0.13.0
  2. We take the optree pypi package as a mandatory dependency.
  3. We take optree as a required pytorch submodule and build it into PyTorch.

From discussions with @malfet, @seemethere, @atalman and @albanD it sounded like we preferred (3). The risk of doing (2) is that we get into dependency hell: if a third-party library pins optree and pytorch pins optree then we end up in a not-so-good-place. The direction our project is going in is taking optree as a mandatory requirement somehow, so (1) seems not worth it.

Thoughts? @XuehaiPan @angelayi

cc @ezyang @gchanan @kadeng @msaroufim @XuehaiPan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy