Skip to content

Conversation

@eoffermann
Copy link

Modernize PyTorch → 2.6 (+ CUDA 12.4) & Add CPU‑Only Support

This PR upgrades the entire PyTorch stack to the current 2.6 release, switches the CUDA wheels to 12.4, and introduces a standalone requirements‑cpu.txt for environments without a GPU. Along the way it fixes a few compatibility breaks that surfaced after the upgrade and removes an accidental binary blob.


✨ What’s new

Area Change
Dependencies * GPU path — requirements.txt now pins torch/torchvision/torchaudio 2.6.0+cu124 and bumps pytorch‑lightning to 2.5.1.* CPU path — new requirements‑cpu.txt with the matching CPU wheels.* Added in‑file section headers for clarity and trimmed unused version specifiers.
Code fixes * gen_wav.py — passes the new weights_only=False flag required by PyTorch ≥2.5 when loading checkpoints.* ldm/models/diffusion/{ddpm,ddpm_audio}.py — import of rank_zero_only moved to the new namespace pytorch_lightning.utilities (old path was removed in PL 2.5).
Repo hygiene * .gitignore now ignores stray .pth checkpoints.* Deleted the accidental useful_ckpts/.DS_Store binary.
Docs / comments Updated inline comments so the “aligned with torch 2.6.0” lines reflect the real version instead of the old 1.13.

⚠️ Breaking / noteworthy impacts

  • Python ≥3.9 is required by PyTorch 2.6 and PL 2.5.1.

  • The rank_zero_only import path change means plugins or downstream forks must update their imports if they referenced the old location.

  • Any local environment caches need a full pip install -r requirements.txt (or requirements‑cpu.txt) after the merge.


🔬 How I tested

  • Fresh GPU and CPU virtual‑env installs on Linux and macOS (Apple Silicon in CPU mode) complete without conflicts.

  • gen_wav.py end‑to‑end inference runs on both CUDA 12.4 and CPU, generating identical audio outputs relative to pre‑upgrade samples.

  • Unit tests for the diffusion modules pass with PL 2.5.1 and the new import paths.


🚀 Upgrade guide

GPU build (CUDA 12.4)


python -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

– or –

CPU build


python -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements‑cpu.txt

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

Successfully merging this pull request may close these issues.

2 participants