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

python3Packages.torch: "unbundle" git submodules #239211

Open
ConnorBaker opened this issue Jun 22, 2023 · 1 comment · May be fixed by #239291
Open

python3Packages.torch: "unbundle" git submodules #239211

ConnorBaker opened this issue Jun 22, 2023 · 1 comment · May be fixed by #239291
Assignees
Labels
0.kind: enhancement Add something new 6.topic: cuda Parallel computing platform and API

Comments

@ConnorBaker
Copy link
Contributor

ConnorBaker commented Jun 22, 2023

Describe the bug

Pytorch "vendors" a number of dependencies via git-submodules. The bundled libraries are complex enough that they suffer from the "cabal hell"/the "diamond problem"1. The Nixpkgs' pytorch expression currently keeps the submodules as is, which means that:

  • ...we cannot configure or consistently apply patches to torch's dependencies,
  • cannot control the bootstrap process,
  • and potentially suffer the increased build times (as we cannot cache the built dependencies as separate store paths)
  • and increased closure sizes.

Pytorch's CMakeLists implement a custom mechanism, USE_SYSTEM_LIBS, that partially recovers the ability for dependency injection. Nonetheless, unbundling all of the vendored libraries apparently still takes substantial patching1234.

The Guix-HPC project has, apparently, made great progress addressing this issue12. Nixpkgs needs to catch up, but also we need to work with the upstream to render patching unnecessary.

Footnotes

  1. "What's in a package": https://hpc.guix.info/blog/2021/09/whats-in-a-package/ 2 3

  2. "[PATCH 00/31] Unbundle and update python-pytorch": https://issues.guix.gnu.org/69591 2

  3. "PyTorch with ROCm": https://lists.gnu.org/archive/html/guix-devel/2024-03/msg00242.html

  4. https://codeberg.org/dtelsing/Guix-HPC/commit/5da1afd389d5a0adcca83538d50c0a785f81eb29

@ConnorBaker ConnorBaker added 0.kind: enhancement Add something new 6.topic: cuda Parallel computing platform and API labels Jun 22, 2023
@ConnorBaker ConnorBaker self-assigned this Jun 22, 2023
@ConnorBaker ConnorBaker moved this from New to 📋 Backlog in CUDA Team Jun 22, 2023
@ConnorBaker ConnorBaker linked a pull request Jun 23, 2023 that will close this issue
42 tasks
@SomeoneSerge
Copy link
Contributor

SomeoneSerge commented Apr 9, 2024

AFAIU, Guix-HPC has patched pytorch enough to disentangle the submodules:


EDIT: @ConnorBaker I updated the description to reflect the fact that unvendoring is provably feasible

@SomeoneSerge SomeoneSerge changed the title python3Packages.torch: investigate switching from submodules to Nix-provided libraries python3Packages.torch: "unbundle" git submodules Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new 6.topic: cuda Parallel computing platform and API
Projects
Status: 📋 The forgotten
Development

Successfully merging a pull request may close this issue.

2 participants