Skip to content

Conversation

@samuelstanton
Copy link
Collaborator

@samuelstanton samuelstanton commented Apr 3, 2025

This PR upgrades the project from PyTorch Lightning 1.9.5 to 2.5.1. It implements necessary API changes including

  • updating import paths
  • replacing deprecated epoch hooks with their on_* counterparts
  • adding manual step output collection to replace the now-removed outputs parameter in epoch end hooks
  • updating checkpoint loading to use the new ckpt_path parameter.

The requirements have been updated to specify lightning>=2.0

@samuelstanton samuelstanton self-assigned this Apr 3, 2025
@samuelstanton samuelstanton requested a review from Copilot April 3, 2025 18:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the project from PyTorch Lightning 1.9.5 to 2.5.1 by updating API usage and import paths.

  • Updated import of CombinedLoader and removal of deprecated Lightning hooks
  • Replaced training_epoch_end/validation_epoch_end with on_train_epoch_end/on_validation_epoch_end and added manual accumulation of step outputs
  • Updated the trainer initialization to use the new ckpt_path parameter

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
cortex/model/tree/_seq_model_tree.py Updated import and hook methods; added manual step output accumulation
cortex/cmdline/train_cortex_model.py Updated checkpoint loading parameter to use ckpt_path
Files not reviewed (1)
  • requirements.in: Language not supported

samuelstanton and others added 2 commits April 3, 2025 18:16
This commit implements the following changes:
- Update imports from pytorch_lightning to lightning.pytorch
- Replace deprecated CombinedLoader import path
- Change *_epoch_end hooks to on_*_epoch_end hooks
- Add step output collection for epoch-end processing
- Update trainer.fit() to use ckpt_path
- Update requirements.in to use lightning>=2.5.1,<2.6
- Remove pytorch-lightning package dependency
@samuelstanton samuelstanton force-pushed the lightning-version-bump branch from 1e666d6 to c201717 Compare April 3, 2025 19:39
samuelstanton and others added 3 commits April 3, 2025 15:42
* specify deps in pyproject.toml and add uv.lock

* pre-commit and lint

* update github actions configuration

* add missing dep

* update readme

* remove setup.cfg

* cleanup

* relax some version bounds
@samuelstanton samuelstanton merged commit a8082e4 into main Apr 4, 2025
3 checks passed
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.

3 participants