Lightning Hydra Template Versions Save

PyTorch Lightning + Hydra. A very user-friendly template for ML experimentation. โšก๐Ÿ”ฅโšก

v2.0.3

8 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/ashleve/lightning-hydra-template/compare/v2.0.2...v2.0.3

v2.0.2

1 year ago

What's Changed

Full Changelog: https://github.com/ashleve/lightning-hydra-template/compare/v2.0.1...v2.0.2

v2.0.1

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/ashleve/lightning-hydra-template/compare/v2.0.0...v2.0.1

v2.0.0

1 year ago

Release for alignment with PyTorch 2.0 and Lightning 2.0.

Changes

  • Release v2.0.0 @ashleve (#545)

๐Ÿš€ Features

  • Support for logging with Aim @tesfaldet (#534)
  • Add option for pytorch 2.0 model compilation @ashleve (#550)

๐Ÿงน Maintenance

  • Update template to Lightning 2.0 @johnnynunez (#548)
  • Update pre-commit hooks @ashleve (#549)
  • Refactor utils @ashleve (#541)

๐Ÿ“๏ธ Documentation

  • Update README.md @ashleve (#551)

Full Changelog: https://github.com/ashleve/lightning-hydra-template/compare/v1.5.3...v2.0.0

v1.5.3

1 year ago

Changes

  • Release v1.5.3 @ashleve (#543)

๐Ÿš€ Features

  • Add __init__.py to configs/ folder @ashleve (#539)
  • Support for installing dependencies with conda @tesfaldet (#532)
  • Encourage resetting all validation metrics when training starts @ashleve (#540)

๐Ÿงน Maintenance

  • Set hydra version to 1.3 in tests @ashleve (#542)
  • Bump hydra-core from 1.3.1 to 1.3.2 @dependabot (#536)

v1.5.2

1 year ago

Changes

  • Release 1.5.2 @ashleve (#521)

๐Ÿงน Maintenance

  • Deprecate Python 3.7 @ashleve (#523)
  • Bump pytorch-lightning from 1.8.3 to 1.9.1 @dependabot (#522)
  • Hotfix for isort poetry incompatibility @atong01 (#515)
  • Fix use of deprecated LightningLoggerBase class @colobas (#517)

๐Ÿ“๏ธ Documentation

  • Update README.md @ashleve (#524)
  • Fix readme typo @amorehead (#507)

v1.5.1

1 year ago

Changes

  • Release 1.5.1 @ashleve (#504)

๐Ÿงน Maintenance

  • Add PR authors to release draft config @ashleve (#503)
  • Remove object instantiation from __main__ methods @ashleve (#502)
  • Rename datamodules folder to data @ashleve (#501)
  • Refactor tests @ashleve (#498)
  • Change root setup to .project-root file @ashleve (#496)
  • Add dev branch to PR tests workflow @ashleve (#497)

๐Ÿ“๏ธ Documentation

  • Update README.md @ashleve (#499)
  • Update code examples in readme @eungbean (#494)

v1.5.0

1 year ago

Changes

๐Ÿš€ Features

  • Add release drafter (#493)
  • Add codecov.yml to prevent failing CI pipeline on coverage decrease (#484)
  • Add learning rate scheduler example (#439)
  • Make use of learning rate scheduler optional (#449)
  • Add shellcheck linter (#427)

๐Ÿ› Bug Fixes

  • Fix sending hparams to only one logger (#479)
  • Fix logging metrics in DDP mode (#426)
  • Fix make clean-logs command (#430)
  • Fix make sync command (#423)
  • Fix missing CPU trainer (#402)
  • Fix typing (#401)

๐Ÿงน Maintenance

  • Upgrade to hydra 1.3 (#480)
  • Rename step() to model_step() for compatibility with recent lightning release (#472)
  • Upgrade deprecated TPU import (#473)
  • Upgrade deprecated accuracy metric initialization to recent torchmetrics release (#475)
  • Refactor task_wrapper decorator (#488)
  • Move tasks code inside entry files (#421)
  • Pre-commit config updates for jupyter notebooks and flake8 (#435)
  • Add separate job for macos in CI test worfklow ( #474)
  • Add separate job for windows in CI test worfklow (#422)
  • Disable ignoring net in mnist module (#481)
  • Remove debug from makefile (#482)
  • Bump pytorch-lightning from 1.7.1 to 1.8.1 (#468)
  • Bump torchmetrics from 0.9.3 to 0.10.0 (#454)
  • Bump pytorch-lightning from 1.6.5 to 1.7.1 (#408)
  • Bump hydra-core from 1.3.0 to 1.3.1 (#492)

๐Ÿ“๏ธ Documentation & Comments

  • Add Vertex AI integration repo to readme (#440)
  • Add explicit comment warning to training_epoch_end() (#486)
  • Improve utils warnings (#483)
  • Fix filenames in docstring (#428)
  • Update example of using tags command in README.md (#465)
  • Improve comments (#429, #441, #476)
  • Fix broken link of datamodule (#444)
  • Update README.md (#419, #425, #442)

@ashleve @yipliu @amorehead @atong01 @YuCao16 @Yongtae723 @cauliyang

v1.4.0

1 year ago

What's Changed

  • Adapt template to hydra 1.2 - no more changing the working directory by default
  • Rename test.py and test.yaml to eval.py and eval.yaml (so as to avoid confusion with project tests)
  • Move train.py and eval.py inside src/
  • Add pyrootutils package for standardizing the project root setup in train.py and eval.py
  • Rename pipelines to tasks
  • Create a separate folder for tasks
  • Add task_name to main config, which determines hydra output folder path
  • Introduce @task_wrapper decorator for applying utilities before and after the task is executed
  • Standardize what is returned from tasks: Tuple[metric_dict, object_dict]
  • Add SimpleDenseNet config to model config with recursive instantiation
  • Add optimizer config to model config using _partial_: true
  • Remove _convert_=partial from trainer instantiation (no longer needed since recent lightning release)
  • Add ckpt_path to main config, trainer.fit() and trainer.test(), for compatibility with recent lightning release
  • Add resetting val_acc_best metric at the start of the training to prevent storing results from validation sanity checks
  • Add verifying logger is not None before logging hparams
  • Add tags to main config
  • Add prompting user to input tags when none are provide to utils.extras()
  • Remove experiment name (since tags and task_name are enough)
  • Rename config to cfg since it's the standard naming convention in hydra
  • Split utils into multiple files: utils.py, rich_utils.py, pylogger.py
  • Add utils.instantiate_callbacks() and utils.instantiate_loggers() to reduce the boilerplate in tasks
  • Add utils.get_metric_value() for safely retrieving optimized metric.
  • Rename utils.finish() to utils.close_loggers()
  • Move extra config utils to configs/extras/default.yaml
  • Replace deprecated trainer.gpus argument with trainer.accelerator and trainer.devices
  • Add separate trainer configs for GPU, CPU, simulating DDP on CPU and MPS accelerator (Accelerated PyTorch Training on Mac)
  • Add hydra.mode=MULTIRUN to mnist_optuna.yaml config (so using -m is no longer needed when attaching this config)
  • Update mnist_opuna.yaml for compatibility with new search space syntax in hydra 1.2
  • Disable callbacks in debug configs by default (fixes debug/overfit.yaml)
  • Disable hydra command line debug logger in debug configs by default
  • Split callbacks config into multiple files
  • Replace setup.cfg with pyproject.toml since it's a more versatile standard (PEP 518)
  • Add pre-commit hooks: pyupgrade (automatically upgrading python syntax to newer version), bandit (security linter), codespell (spelling linter), mdformat (markdown formatting)
  • Redesign testing and add tests covering ddp, multirun, loggers, resuming training and evaluation
  • Implement CI workflows with GitHub Actions: executing pytest, test code coverage measuring, code quality testing for main branch and PRs
  • Add depandabot
  • Add pull request template
  • Add setup.py
  • Add Makefile
  • Update README.md

@nils-werner @johnnynunez @elisim @yu-xiang-wang @yipliu @Gxinhu @binlee52

v1.3

2 years ago

The template has been significantly refactored.

List of changes:

  • Introduce multiple pipelines, to showcase example of how one can separate training from evaluation, run.py has been replaced by train.py and test.py
  • The mode group config has been removed since it was confusing, now every run is treated as an experiment, and debugging is moved to a separate config group
  • Introduce debug config group
  • Introduce log_dir config group
  • Move wandb callbacks to the branch wandb-callbacks to make template logger-agnostic
  • Refactor rich config printing, now all config groups are always printed instead of just the pre-selected ones, but you can still decide on the print order
  • Add nbstripout to pre-commit hooks, for automatic clearing of jupyter notebooks outputs before commit
  • Update packages in requirements.txt and pre-commit-config.yaml to newest versions
  • Remove some of the unimportant default optuna parameters in mnist_optuna.yaml and add more explanatory comments
  • Remove no longer needed utilities from utils.extras()
  • Add config flag for skipping training
  • Fix hydra package versions in requirements.txt for mac compatibility
  • Remove redundant parts in filenames: mnist_model.yaml -> mnist.yaml, mnist_datamodule.yaml -> datamodule.yaml
  • Change mnist_model.py -> mnist_module.py and MNISTLitModel -> MNISTLitModule
  • Rename folder modules/ to components/
  • Change accelerator="ddp" to strategy="ddp" since it was depracated by lightning
  • Remove trainer arguments depracated by lightning: weight summary and progress_bar_refresh_rate
  • Specify black profile for isort inside .pre-commit-config.yaml just in case someone deletes the setup.cfg
  • Specify testpath in setup.cfg so pytest knows all test files are placed only in tests/ folder
  • Allow for using relative checkpoint paths
  • Rename folder bash to scripts
  • Introduce vendor dir as a "best practice" for storing third party code
  • Introduce local config files in configs/local/, which can be used for storing machine/user specific configurations, e.g. configuration of slurm cluster
  • Unify logging directories structure
  • Add RichModelSummary to default callbacks
  • Fix missing parameter in "Accessing datamodule attributes" trick in README.md
  • General README.md improvements

Special thanks to: @nils-werner @charlesincharge @Steve-Tod for their PRs.