Skip to content

Deps/spike torch2 compat - #273

Open
kwehden wants to merge 3 commits into
GT4SD:mainfrom
kwehden:deps/spike-torch2-compat
Open

kwehden wants to merge 3 commits into
GT4SD:mainfrom
kwehden:deps/spike-torch2-compat

Conversation

@kwehden

@kwehden kwehden commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

GitHub Actions request

@drugilsberg: please add or advise on a dedicated Torch 2.x GitHub
Actions job. The existing workflow creates the Torch 1.12 environment, so it
cannot reproduce the validated Torch 2.6 result remotely.

Local validation with the published testing-fork pins:

  • 400 passed, 61 skipped
  • Black and Flake8 passed
  • all six CLI entry points passed

Karl Wehden added 2 commits August 26, 2026 20:19
Two minimal, backward-compatible source changes that let gt4sd-core run
under torch 2.6.0 (the runtime linchpin blocking ~22 Dependabot alerts,
incl. the CRITICAL torch.load RCE, CVE-2025-32434). Verified against a
torch-2.6 env; both changes are no-ops on torch 1.12.

- torchdrug/unpatch.py: torch 2.x renamed the base LR scheduler
  _LRScheduler -> LRScheduler (the private name survives only as a
  deprecated subclass). Use the public base for the subclass assertions
  and mirror the revert onto both names so torchdrug un-patching keeps
  working on torch 1.x and 2.x.

- frameworks/torch: add install_torch_load_compat(), a centralized shim
  that restores the pre-2.6 torch.load default (weights_only=False) only
  when the caller did not pass weights_only. GT4SD and several deps
  (pytorch_lightning, guacamol_baselines, reinvent_models) load full,
  trusted checkpoints; a centralized shim reaches those internal call
  sites, unlike per-site edits. No-op on torch < 2.6.

- __init__.py: install the shim at import time, before any checkpoint
  loads.

Spike result (torch 2.6.0 + torchvision 0.21.0 + PyG cp310 pt26 cpu
wheels + fast_transformers rebuild): 395 passed / 5 failed / 61 skipped.
All 5 failures are a torch-2.x uint8-mask masked_fill_ regression inside
the upstream `moses` package (moses/vae/model.py, moses/aae/model.py),
reached via guacamol_baselines -- not gt4sd-core source. Lint clean
(black + flake8) and all 6 CLI entry points OK under torch 2.6.
@cla-bot

cla-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Karl Wehden.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot

cla-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Karl Wehden.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

This branch has not been deployed

No deployments
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